From 5bf3a96bd125548f058907001904b552f952e279 Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Mon, 16 Jun 2014 18:40:11 +0100 Subject: 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 - --- morphlib/builder2.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'morphlib') 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( -- cgit v1.2.1