Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
f3519cf0
Commit
f3519cf0
authored
Jan 09, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #527 from chriscool/sharness_download
install-sharness.sh: use git instead of wget and shasum
parents
06299297
9e8fc382
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
42 deletions
+9
-42
test/sharness/lib/install-sharness.sh
test/sharness/lib/install-sharness.sh
+9
-42
No files found.
test/sharness/lib/install-sharness.sh
View file @
f3519cf0
...
...
@@ -7,53 +7,20 @@
# settings
version
=
50229a79ba22b2f13ccd82451d86570fecbd194c
urlprefix
=
https://raw.githubusercontent.com/mlafeldt/sharness/
$version
installpath
=
lib/sharness
# files to download
sfile
=
sharness.sh
shash
=
eeaf96630fc25ec58fb678b64ef9772d5eb92f64
afile
=
aggregate-results.sh
ahash
=
948d6bc03222c5c00a1ed048068508d5ea1cce59
urlprefix
=
https://github.com/mlafeldt/sharness.git
clonedir
=
lib
sharnessdir
=
sharness
die
()
{
echo
>
&2
$@
echo
>
&2
"
$@
"
exit
1
}
verified_download
()
{
file
=
$1
hash1
=
$2
url
=
$urlprefix
/
$file
# download it
wget
-q
$url
-O
$file
.test
# verify it's the right file
hash2
=
`
cat
$file
.test | shasum |
cut
-c1-40
`
if
test
"
$hash1
"
!=
"
$hash2
"
;
then
echo
"
$file
verification failed:"
echo
"
$hash1
!=
$hash2
"
return
-1
fi
return
0
}
mkdir
-p
$installpath
||
die
"Could not create 'sharness' directory"
cd
$installpath
||
die
"Could not cd into 'sharness' directory"
mkdir
-p
"
$clonedir
"
||
die
"Could not create '
$clonedir
' directory"
cd
"
$clonedir
"
||
die
"Could not cd into '
$clonedir
' directory"
verified_download
"
$sfile
"
"
$shash
"
;
sok
=
$?
verified_download
"
$afile
"
"
$ahash
"
;
aok
=
$?
if
test
"
$sok
"
!=
0
||
test
"
$aok
"
!=
0
;
then
rm
$afile
.test
rm
$sfile
.test
exit
-1
fi
git clone
"
$urlprefix
"
||
die
"Could not clone '
$urlprefix
'"
cd
"
$sharnessdir
"
||
die
"Could not cd into '
$sharnessdir
' directory"
git checkout
"
$version
"
||
die
"Could not checkout '
$version
'"
# ok, move things into place
mv
$sfile
.test
$sfile
mv
$afile
.test
$afile
chmod
+x
$sfile
chmod
+x
$afile
exit
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment