]> git.donarmstrong.com Git - debhelper.git/commitdiff
Use ASCII RS for separating options in DH_INTERNAL_OPTIONS.
authorModestas Vainius <modestas@vainius.eu>
Mon, 29 Jun 2009 23:55:41 +0000 (02:55 +0300)
committerModestas Vainius <modestas@vainius.eu>
Mon, 29 Jun 2009 23:55:41 +0000 (02:55 +0300)
Since now extra options via dh command line arguments are encouraged, dh will
break when a bit more complex option gets added to DH_INTERNAL_OPTIONS and it
gets misparsed by the debhelper command called from the override. E.g.
debian/rules:

| %:
|  dh --builddirectory="build dir"
|
| override_dh_install:
|  dh_install

Will fail with something like:

| ....
| make[1]: Entering directory `............'
| dh_install
| cp: cannot stat `debian/tmp/dir': No such file or directory
| dh_install: cp returned exit code 1
| make[1]: *** [override_dh_install] Error 1

So since DH_INTERNAL_OPTIONS is exclusively for internal use, why not to use an
old good ASCII unrepresentable control character as a separator? So I chose
ASCII 1E - RS Record Separator.

Signed-off-by: Modestas Vainius <modestas@vainius.eu>
Debian/Debhelper/Dh_Getopt.pm
dh

index 86f3cdba585cf5bb77bc074dfb491fe779513347..6e5cacdd9c0bf941779fe65e1e314df810a018e3 100644 (file)
@@ -168,7 +168,7 @@ sub parseopts {
        # DH_INTERNAL_OPTIONS is used to pass additional options from
        # dh through an override target to a command.
        if (defined $ENV{DH_INTERNAL_OPTIONS}) {
-               @ARGV_extra=split_options_string($ENV{DH_INTERNAL_OPTIONS});
+               @ARGV_extra=split(/\x1e/, $ENV{DH_INTERNAL_OPTIONS});
                getoptions(\@ARGV_extra, $options);
 
                # Avoid forcing acting on packages specified in
diff --git a/dh b/dh
index 4ea69b25a6fb025ee990e72db56336c1a5b5752b..c34a5a0273e952f359e8b92cf14c19ab7f73c24b 100755 (executable)
--- a/dh
+++ b/dh
@@ -462,7 +462,7 @@ sub run {
                $override_command=$command;
                # This passes the options through to commands called
                # inside the target.
-               $ENV{DH_INTERNAL_OPTIONS}=join(" ", @options);
+               $ENV{DH_INTERNAL_OPTIONS}=join("\x1e", @options);
                $command="debian/rules";
                @options="override_".$override_command;
        }