Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
ruby-build
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ruby-build
Commits
29f1a191
Commit
29f1a191
authored
Sep 08, 2014
by
Mislav Marohnić
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pr-checksum'
parents
66fd3ec2
95b32acc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
5 deletions
+36
-5
script/mirror
+34
-5
script/test
+2
-0
No files found.
script/mirror
View file @
29f1a191
#!/usr/bin/env bash
# Usage: script/mirror update <COMMIT-RANGE>
# script/mirror verify <COMMIT-RANGE>
# script/mirror stats
set
-e
commit_range
=
"
${
1
?
}
"
eval
"
$(
grep
RUBY_BUILD_MIRROR_URL
=
./bin/ruby-build | head
-1
)
"
help_text
()
{
sed
-ne
'/^#/!q;s/.\{1,2\}//;1d;p'
<
"
$0
"
}
test_mirrored
()
{
curl
-qsSfIL
"
$RUBY_BUILD_MIRROR_URL
/
$1
"
>
/dev/null 2>&1
}
...
...
@@ -64,6 +67,19 @@ update() {
done
}
verify
()
{
local
url
local
checksum
local
file
for
url
in
$(
potentially_new_packages
"
$1
"
)
;
do
checksum
=
"
${
url
#*#
}
"
url
=
"
${
url
%#*
}
"
echo
"Verifying checksum for
$url
"
file
=
"
${
TMPDIR
:-
/tmp
}
/
$checksum
"
download_and_verify
"
$url
"
"
$file
"
"
$checksum
"
done
}
stats
()
{
local
packages
=(
$(
extract_urls ./share/ruby-build/
*)
)
local
total
=
"
${#
packages
[@]
}
"
...
...
@@ -82,6 +98,19 @@ stats() {
echo
"
$confirmed
/
$total
mirrored"
}
cmd
=
"
${
1
?
}
"
shift
1
"
$cmd
"
"
$@
"
cmd
=
"
$1
"
case
"
$cmd
"
in
update
|
verify
|
stats
)
shift
1
"
$cmd
"
"
$@
"
;;
-h
|
--help
)
help_text
exit
0
;;
*
)
help_text
>
&2
exit
1
;;
esac
script/test
View file @
29f1a191
...
...
@@ -8,6 +8,8 @@ bats -t test || STATUS="$?"
if
[
"
$TRAVIS_SECURE_ENV_VARS
"
=
"true"
]
;
then
./script/mirror update
"
$TRAVIS_COMMIT_RANGE
"
elif
[
"
$TRAVIS_PULL_REQUEST
"
!=
"false"
]
;
then
./script/mirror verify
"
$TRAVIS_COMMIT_RANGE
"
fi
exit
"
$STATUS
"
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