summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Meyer <carl@oddbird.net>2011-10-24 10:50:56 -0600
committerCarl Meyer <carl@oddbird.net>2011-10-24 10:50:56 -0600
commitcfc123736038832469d536ea61fc5d2c2ece95f7 (patch)
treef3de5cb91d935d8cf9b469c428c69fcca55b40bd
parent07001c93100dc06d5130ea320af7a0d2ebb69c0b (diff)
downloadpip-cfc123736038832469d536ea61fc5d2c2ece95f7.tar.gz
Handle option defaults better in bundle command; fixes failing test introduced in pull request #340.
-rw-r--r--pip/commands/bundle.py13
-rw-r--r--pip/req.py1
2 files changed, 10 insertions, 4 deletions
diff --git a/pip/commands/bundle.py b/pip/commands/bundle.py
index fb0f75704..f782f1bc3 100644
--- a/pip/commands/bundle.py
+++ b/pip/commands/bundle.py
@@ -13,14 +13,19 @@ class BundleCommand(InstallCommand):
def __init__(self):
super(BundleCommand, self).__init__()
+ # bundle uses different default source and build dirs
+ build_opt = self.parser.get_option("--build")
+ build_opt.default = backup_dir(build_prefix, '-bundle')
+ src_opt = self.parser.get_option("--src")
+ src_opt.default = backup_dir(src_prefix, '-bundle')
+ self.parser.set_defaults(**{
+ src_opt.dest: src_opt.default,
+ build_opt.dest: build_opt.default,
+ })
def run(self, options, args):
if not args:
raise InstallationError('You must give a bundle filename')
- if not options.build_dir:
- options.build_dir = backup_dir(build_prefix, '-bundle')
- if not options.src_dir:
- options.src_dir = backup_dir(src_prefix, '-bundle')
# We have to get everything when creating a bundle:
options.ignore_installed = True
logger.notify('Putting temporary build files in %s and source/develop files in %s'
diff --git a/pip/req.py b/pip/req.py
index c3c791785..f2fa2e585 100644
--- a/pip/req.py
+++ b/pip/req.py
@@ -1063,6 +1063,7 @@ class RequirementSet(object):
remove_dir.append(self.build_dir)
# The source dir of a bundle can always be removed.
+ # FIXME: not if it pre-existed the bundle!
if bundle:
remove_dir.append(self.src_dir)