Skip to content
This repository
Browse code

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

…specification-for-gem-mirroring

version specification for gem mirroring
  • Loading branch information...
commit e42128280c5537e1e32da360236c82702782fd05 2 parents 104a9bc + 8410611
Daniel Pittman daniel-pittman authored
15 bin/mirror-gem
@@ -24,6 +24,10 @@ EOT
24 24 o.on('--server URL', '--gem-server URL', '-s URL', 'the remote gem source to use') do |url|
25 25 $server = url
26 26 end
  27 +
  28 + o.on('--gemfile FILE', '-f FILE', 'a file with the list of gems to mirror') do |file|
  29 + $gemfile = file
  30 + end
27 31 end
28 32
29 33 optparse.parse!
@@ -74,7 +78,16 @@ $server and Gem.sources = [$server]
74 78
75 79 # We actually want the gems one level down, in their repository structure.
76 80 # REVISIT: Should we support gem version information here? (eg: ~> 2.7)
77   -ARGV.each {|gem| mirror_gem($where, gem) }
  81 +if $gemfile then
  82 + File.read($gemfile).each_line do |line|
  83 + gem, version = line.chomp.split(/\s+/, 2)
  84 + gem or next # skip empty lines, just in case
  85 + gem =~ /^\s*#/ and next # also comments
  86 + mirror_gem($where, gem, version)
  87 + end
  88 +else
  89 + ARGV.each {|gem| mirror_gem($where, gem) }
  90 +end
78 91
79 92 puts "Generating the GEM mirror indexes..."
80 93 system('gem', 'generate_index', '-d', $where.parent.to_s)
2  build-bundle-file.sh
@@ -260,7 +260,7 @@ mkdir -p tmp-build-dir/opt
260 260 cp -t tmp-build-dir/opt -p opt/boot*.sh
261 261 chmod +rx tmp-build-dir/opt/boot*.sh
262 262 [ -n "$GEM_SERVER_URI" ] && GEM_SERVER_ARG="-s $GEM_SERVER_URI"
263   -./bin/mirror-gem $GEM_SERVER_ARG -d tmp-build-dir/tmp/gem-mirror `cat opt/gems/gem.list`
  263 +./bin/mirror-gem $GEM_SERVER_ARG -d tmp-build-dir/tmp/gem-mirror -f opt/gems/gem.list
264 264
265 265 # Add GemRC file to the ISO to use the mirror
266 266 cp -p opt/gems/gem.list tmp-build-dir/tmp/gem-mirror/gems/gem.list
2  opt/gems/gem.list
... ... @@ -1,4 +1,4 @@
1 1 stomp
2 2 facter
3   -json_pure
  3 +json_pure >= 1.7.7
4 4 daemons

0 comments on commit e421282

Please sign in to comment.
Something went wrong with that request. Please try again.