Permalink
Browse files

Merge pull request #60 from daniel-pittman/feature/master/59-version-…

…specification-for-gem-mirroring

version specification for gem mirroring
  • Loading branch information...
2 parents 104a9bc + 8410611 commit e42128280c5537e1e32da360236c82702782fd05 @slippycheeze slippycheeze committed Feb 12, 2013
Showing with 16 additions and 3 deletions.
  1. +14 −1 bin/mirror-gem
  2. +1 −1 build-bundle-file.sh
  3. +1 −1 opt/gems/gem.list
View
@@ -24,6 +24,10 @@ EOT
o.on('--server URL', '--gem-server URL', '-s URL', 'the remote gem source to use') do |url|
$server = url
end
+
+ o.on('--gemfile FILE', '-f FILE', 'a file with the list of gems to mirror') do |file|
+ $gemfile = file
+ end
end
optparse.parse!
@@ -74,7 +78,16 @@ $server and Gem.sources = [$server]
# We actually want the gems one level down, in their repository structure.
# REVISIT: Should we support gem version information here? (eg: ~> 2.7)
-ARGV.each {|gem| mirror_gem($where, gem) }
+if $gemfile then
+ File.read($gemfile).each_line do |line|
+ gem, version = line.chomp.split(/\s+/, 2)
+ gem or next # skip empty lines, just in case
+ gem =~ /^\s*#/ and next # also comments
+ mirror_gem($where, gem, version)
+ end
+else
+ ARGV.each {|gem| mirror_gem($where, gem) }
+end
puts "Generating the GEM mirror indexes..."
system('gem', 'generate_index', '-d', $where.parent.to_s)
@@ -260,7 +260,7 @@ mkdir -p tmp-build-dir/opt
cp -t tmp-build-dir/opt -p opt/boot*.sh
chmod +rx tmp-build-dir/opt/boot*.sh
[ -n "$GEM_SERVER_URI" ] && GEM_SERVER_ARG="-s $GEM_SERVER_URI"
-./bin/mirror-gem $GEM_SERVER_ARG -d tmp-build-dir/tmp/gem-mirror `cat opt/gems/gem.list`
+./bin/mirror-gem $GEM_SERVER_ARG -d tmp-build-dir/tmp/gem-mirror -f opt/gems/gem.list
# Add GemRC file to the ISO to use the mirror
cp -p opt/gems/gem.list tmp-build-dir/tmp/gem-mirror/gems/gem.list
View
@@ -1,4 +1,4 @@
stomp
facter
-json_pure
+json_pure >= 1.7.7
daemons

0 comments on commit e421282

Please sign in to comment.