summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richardipsum@fastmail.co.uk>2014-06-16 18:40:11 +0100
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2014-06-18 11:16:32 +0000
commit5bf3a96bd125548f058907001904b552f952e279 (patch)
tree2e7c53cdefcf5729442c8f2838c82b3661cfd1aa
parentb2a9d8443023505acacb447dc95a001a3eacd238 (diff)
downloadmorph-5bf3a96bd125548f058907001904b552f952e279.tar.gz
Fix: use end of options option with run-parts
We want to supply the end of options option before the SYSTEM_INTEGRATION_PATH so that the system integration path doesn't get interpreted as an option if it happens to begin with a -
-rw-r--r--morphlib/builder2.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/morphlib/builder2.py b/morphlib/builder2.py
index f8969973..3c0d9e02 100644
--- a/morphlib/builder2.py
+++ b/morphlib/builder2.py
@@ -742,8 +742,13 @@ class SystemBuilder(BuilderBase): # pragma: no cover
mount_type)
mounted.append(path)
+ # The single - is just a shell convention to fill $0 when using -c,
+ # since ordinarily $0 contains the program name.
+ # -- is used to indicate the end of options for run-parts,
+ # we don't want SYSTEM_INTEGRATION_PATH to be interpreted
+ # as an option if it happens to begin with a -
self.app.runcmd(['chroot', rootdir, 'sh', '-c',
- 'cd / && run-parts "$1"', '-', SYSTEM_INTEGRATION_PATH],
+ 'cd / && run-parts -- "$1"', '-', SYSTEM_INTEGRATION_PATH],
env=env)
except BaseException, e:
self.app.status(