Merge branch 'fix-vagrant-package' of github.com:gwillem/vagrant-lxc
This commit is contained in:
commit
24daffc92c
1 changed files with 5 additions and 1 deletions
|
@ -109,7 +109,11 @@ module Vagrant
|
||||||
Dir.chdir base_path do
|
Dir.chdir base_path do
|
||||||
@logger.info "Compressing '#{rootfs_path}' rootfs to #{target_path}"
|
@logger.info "Compressing '#{rootfs_path}' rootfs to #{target_path}"
|
||||||
@sudo_wrapper.run('rm', '-f', 'rootfs.tar.gz')
|
@sudo_wrapper.run('rm', '-f', 'rootfs.tar.gz')
|
||||||
@sudo_wrapper.run('tar', '--numeric-owner', '-czf', target_path, 'rootfs')
|
# "vagrant package" will copy the existing lxc-template in the new box file
|
||||||
|
# To keep this function backwards compatible with existing boxes, the path
|
||||||
|
# included in the tarball needs to have the same amount of path components (2)
|
||||||
|
# that will be stripped before extraction, hence the './.'
|
||||||
|
@sudo_wrapper.run('tar', '--numeric-owner', '-czf', target_path, '-C', "#{rootfs_path}", './.')
|
||||||
|
|
||||||
@logger.info "Changing rootfs tarball owner"
|
@logger.info "Changing rootfs tarball owner"
|
||||||
user_details = Etc.getpwnam(Etc.getlogin)
|
user_details = Etc.getpwnam(Etc.getlogin)
|
||||||
|
|
Loading…
Reference in a new issue