vagrant-export 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 092e8d4c803b9328bc7bed261ba4c5af5ab88815
4
- data.tar.gz: 6afa02956e79e0101e33e6022adc4e1ee6a7564e
3
+ metadata.gz: a8f0ea634ac85a2b665cdc0361595517b92f6937
4
+ data.tar.gz: 46e778a223f126e41c9eaa35037eaf6bf0006dbe
5
5
  SHA512:
6
- metadata.gz: 356aea56f25d699cdfaed23fff712f57ae50f04361810c2d3b66753c80fa5be9509775595f20ce0a94ee8f6be246b16e63be222fb6568c96e90245629596fbb1
7
- data.tar.gz: f0a8e9528057aa7c4825cbd7dbc9b3b1749e9f632c12088be1f28b58d6aa641f0c1ff06e014420188342fa82c21de9d10936b93623625a8c3ab27d63e600c9bc
6
+ metadata.gz: 11371c4ce8c2fcaec74d8b43fb18b67c7b64f6f5878b4a8b78c2f66cd7d7c0910f541dd6d95c77c8ae2fdf73939777e1301238e099a97bbe6d168fb4a43b13fd
7
+ data.tar.gz: 073cb31479b171f97f17d2c992b6d4cdedc2fd2950a679ac58f6352540b54951e86e6b678a4a94f30286da66af7866f4daecd12ae79fe2b2abc928a3a29252b7
@@ -186,7 +186,7 @@ module VagrantPlugins
186
186
  end
187
187
 
188
188
  # Export to file
189
- exported_path = File.join(@env.tmp_path, Time.now.to_i.to_s)
189
+ exported_path = File.join(@env.tmp_path, 'export-' + Time.now.strftime('%Y%m%d%H%M%S'))
190
190
  @tmp_path = exported_path
191
191
  FileUtils.mkdir_p(exported_path)
192
192
 
@@ -271,11 +271,8 @@ module VagrantPlugins
271
271
  end
272
272
 
273
273
  # Add metadata json
274
- begin
275
- metadata = File.open(File.join(@tmp_path, 'metadata.json'), 'wb')
276
- metadata.write('{"provider":"' + provider_name + '"}')
277
- ensure
278
- metadata.close
274
+ File.open(File.join(@tmp_path, 'metadata.json'), 'wb') do |f|
275
+ f.write('{"provider":"' + provider_name + '"}')
279
276
  end
280
277
 
281
278
  target_include_path = File.join(@tmp_path, 'include')
@@ -339,18 +336,20 @@ module VagrantPlugins
339
336
 
340
337
  Vagrant::Util::SafeChdir.safe_chdir(@tmp_path) do
341
338
 
342
- files = Dir.glob(File.join('.', '**', '*'))
339
+ files = Dir.glob(File.join(@tmp_path, '**', '*'))
343
340
  @logger.debug("Create box file #{@box_file_name} containing #{files}")
344
341
  bash_exec = Vagrant::Util::Which.which('bash').to_s;
345
342
 
346
- if File.executable?(bash_exec) && Vagrant::Util::Which.which('pv') != nil && Vagrant::Util::Which.which('tar') && Vagrant::Util::Which.which('gzip')
343
+ if File.executable?(bash_exec) && ['pv', 'tar', 'gzip'].all? {|cmd| Vagrant::Util::Which.which(cmd) != nil }
347
344
  total_size = 0
345
+ files_list = []
348
346
 
349
347
  @logger.debug('Using custom packaging command to create progress output')
350
348
  @env.ui.info('Starting compression', new_line: false)
351
349
 
352
350
  files.each { |f|
353
351
  total_size += File.size(f)
352
+ files_list.push(f.to_s.gsub(@tmp_path.to_s, '').gsub(/^[\/\\]+/, ''))
354
353
  }
355
354
 
356
355
  @logger.debug("Complete size of files is #{total_size} bytes")
@@ -359,8 +358,11 @@ module VagrantPlugins
359
358
  opts[:notify] = [:stderr, :stdout]
360
359
 
361
360
  script_file = File.absolute_path(File.expand_path('../../../res/progress_tar.sh', __FILE__))
361
+ files_list = files_list.join(' ')
362
+
363
+ @logger.debug("Files argument for bash script: #{files_list}")
362
364
 
363
- Vagrant::Util::Subprocess.execute(bash_exec, script_file, @tmp_path.to_s, total_size.to_s, @box_file_name, opts) { |io, data|
365
+ Vagrant::Util::Subprocess.execute(bash_exec, script_file, @tmp_path.to_s, total_size.to_s, @box_file_name, files_list, opts) { |io, data|
364
366
  d = data.to_s
365
367
  p = d.match(/\d+/).to_a
366
368
 
@@ -5,6 +5,6 @@
5
5
 
6
6
  module VagrantPlugins
7
7
  module Export
8
- VERSION = '0.3.7'
8
+ VERSION = '0.3.8'
9
9
  end
10
10
  end
data/res/progress_tar.sh CHANGED
@@ -3,5 +3,7 @@
3
3
  DIRECTORY=$1
4
4
  TOTAL_SIZE=$2
5
5
  TARGET_TAR=$3
6
+ FILES_LIST=$4
6
7
 
7
- tar -C ${DIRECTORY} -c ${DIRECTORY}/* | pv -f -n -s ${TOTAL_SIZE} | gzip -c > ${TARGET_TAR}
8
+ cd ${DIRECTORY}
9
+ tar -C ${DIRECTORY} -c ${FILES_LIST} | pv -f -n -s ${TOTAL_SIZE} | gzip -c > ${TARGET_TAR}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-export
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Georg Grossberger
@@ -19,6 +19,7 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - ".gitignore"
21
21
  - Gemfile
22
+ - Gemfile.lock
22
23
  - README.md
23
24
  - lib/vagrant-export.rb
24
25
  - lib/vagrant-export/command.rb
@@ -28,7 +29,6 @@ files:
28
29
  - lib/vagrant-export/version.rb
29
30
  - res/cleanup.sh
30
31
  - res/progress_tar.sh
31
- - vagrant-export-0.3.6.gem
32
32
  - vagrant-export.gemspec
33
33
  homepage: https://github.com/trenker/vagrant-export
34
34
  licenses: