Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --[dont-]install-packages option #237

Open
wants to merge 1 commit into
base: 1.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions reprounzip-vagrant/reprounzip/unpackers/vagrant/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,18 +251,21 @@ def vagrant_setup_create(args):
logging.info("Using box %s", box)
logging.debug("Distribution: %s", target_distribution or "unknown")

# If using chroot, we might still need to install packages to get missing
# (not packed) files
if use_chroot:
install_packages = args.install_packages
if install_packages is None:
install_packages = not use_chroot

# We might still need to install packages to get missing (not packed) files
if not install_packages:
packages = [pkg for pkg in packages if not pkg.packfiles]
if packages:
record_usage(vagrant_install_pkgs=True)
logging.info("Some packages were not packed, so we'll install and "
"copy their files\n"
"Packages that are missing:\n%s",
' '.join(pkg.name for pkg in packages))

if packages:
record_usage(vagrant_install_pkgs=True)
try:
installer = select_installer(pack, runs, target_distribution)
except CantFindInstaller as e:
Expand Down Expand Up @@ -823,6 +826,13 @@ def add_opt_setup(opts):
opts.add_argument('--distribution', nargs=1,
help="Distribution used in the Vagrant box (for "
"package installer selection)")
opts.add_argument('--install-packages', action='store_true',
default=None, dest='install_packages',
help="Install packages rather than using packed "
"files")
opts.add_argument('--dont-install-packages', action='store_false',
default=None, dest='install_packages',
help="Don't install packages, use packed files")
opts.add_argument('--memory', nargs=1,
help="Amount of RAM to allocate to VM (megabytes, "
"default: box default)")
Expand Down