PR 2117 - Only check the prefix is writable if installing and not a dry run.

This commit is contained in:
Chris Johns 2013-04-15 12:16:26 +10:00
parent ff91af27c3
commit 2cc7a974a5
2 changed files with 4 additions and 3 deletions

View File

@ -260,9 +260,6 @@ class command_line:
raise error.general('macro file not found: %s' % (um[checked.index(False)])) raise error.general('macro file not found: %s' % (um[checked.index(False)]))
for m in um: for m in um:
self.defaults.load(m) self.defaults.load(m)
# Check the prefix permission
if not self.no_install() and not path.ispathwritable(self.defaults['_prefix']):
raise error.general('prefix is not writable: %s' % (path.host(self.defaults['_prefix'])))
def command(self): def command(self):
return path.join(self.command_path, self.command_name) return path.join(self.command_path, self.command_name)

View File

@ -367,6 +367,10 @@ def run():
else: else:
deps = None deps = None
if not list_bset_cfg_files(opts, configs): if not list_bset_cfg_files(opts, configs):
prefix = opts.defaults.expand('%{_prefix}')
if not opts.dry_run() and not opts.no_install() and \
not path.ispathwritable(prefix):
raise error.general('prefix is not writable: %s' % (path.host(prefix)))
for bset in opts.params(): for bset in opts.params():
b = buildset(bset, configs, opts) b = buildset(bset, configs, opts)
b.build(deps) b.build(deps)