]> git.donarmstrong.com Git - debhelper.git/commitdiff
refactor
authorJoey Hess <joey@gnu.kitenet.net>
Sun, 19 Jul 2009 14:01:23 +0000 (16:01 +0200)
committerJoey Hess <joey@gnu.kitenet.net>
Sun, 19 Jul 2009 14:01:23 +0000 (16:01 +0200)
Debian/Debhelper/Buildsystem/python_distutils.pm

index e1b1aef0ac94842622d6455e9596572c66635106..4838cada3c7c5ca4ec5c042895e6b6093c3dfe0d 100644 (file)
@@ -124,20 +124,23 @@ sub setup_py {
                @python_requested = ("python", grep(!/^\Q$python_default\E/,
                                        @python_requested));
        }
+
+       my @python_dbg;
         my @dbg_build_needed = $this->dbg_build_needed();
+       foreach my $python (map { $_."-dbg" } @python_requested) {
+               if (grep /^(python-all-dbg|\Q$python\E)/, @dbg_build_needed) {
+                       push @python_dbg, $python;
+               }
+               elsif (($python eq "python-dbg")
+                      and (grep /^\Q$python_default\E/, @dbg_build_needed)) {
+                       push @python_dbg, $python_default."-dbg";
+               }
+       }
 
-       foreach my $python (@python_requested) {
+       foreach my $python (@python_requested, @python_dbg) {
                if (-x "/usr/bin/".$python) {
                        $this->doit_in_sourcedir($python, "setup.py", $act, @_);
                }
-               $python = $python . "-dbg";
-               if (grep /^(python-all-dbg|\Q$python\E)/, @dbg_build_needed) {
-                       $this->doit_in_sourcedir($python, "setup.py", $act, @_);
-               } elsif (($python eq "python-dbg")
-                       and (grep /^$python_default/, @dbg_build_needed)) {
-                       $this->doit_in_sourcedir($python_default."-dbg",
-                               "setup.py", $act, @_);
-               }
        }
 }