]> git.donarmstrong.com Git - debhelper.git/commitdiff
r570: * List binary-common in .PHONY in rules.multi2. Closes: #173278
authorjoey <joey>
Thu, 19 Dec 2002 02:27:35 +0000 (02:27 +0000)
committerjoey <joey>
Thu, 19 Dec 2002 02:27:35 +0000 (02:27 +0000)
   * Cleaned up error message if python is not installed. Closes: #173524
   * dh_python: Bug fix from Josselin Mouette for case of building an arch
     indep python package depending on a arch dependent package. However, I
     used GetPackages() rather than add yet another control file parser.
     Untested.

debian/changelog
dh_python
examples/rules.multi2

index 6cebf98c904c3779d695cb198532fba8fb27e3b4..9553319e305c33db64624d8aa1c22ac0aa99910d 100644 (file)
@@ -1,3 +1,14 @@
+debhelper (4.1.29) unstable; urgency=low
+
+  * List binary-common in .PHONY in rules.multi2. Closes: #173278
+  * Cleaned up error message if python is not installed. Closes: #173524
+  * dh_python: Bug fix from Josselin Mouette for case of building an arch
+    indep python package depending on a arch dependent package. However, I
+    used GetPackages() rather than add yet another control file parser.
+    Untested.
+
+ -- Joey Hess <joeyh@debian.org>  Wed, 18 Dec 2002 21:20:41 -0500
+
 debhelper (4.1.28) unstable; urgency=low
 
   * Fix dh_install to install empty directories even if it is excluding some
index b2a9ad7a56b6c3ac8dbc7bad8f65318fea8ea880..a2bede94ab900443cf1e70363e5ea2a9b676cd5e 100755 (executable)
--- a/dh_python
+++ b/dh_python
@@ -29,6 +29,8 @@ package's control file wherever you place the token "${python:Depends}".
 If some modules need to be byte-compiled at build time, appropriate
 postinst and prerm scripts will be generated.
 
+If you use this program, your package should build-depend on python.
+
 =head1 OPTIONS
 
 =over 4
@@ -60,13 +62,16 @@ init();
 my $python = 'python';
 
 # The current python major version
-my $python_version;
 my $python_major;
-if(`$python -V 2>&1` =~ m/^Python\s+(\d+)\.(\d+)\.\d+\n$/) {
+my $python_version = `$python -V 2>&1`;
+if ("$python_version" eq "") {
+       error("Python is not installed, aborting. (Probably forgot to Build-Depend on python.)");
+}
+elsif ($python_version =~ m/^Python\s+(\d+)\.(\d+)\.\d+\n$/) {
        $python_version = "$1.$2" ;
        $python_major = $1 ;
 } else { 
-       error("Cannot obtain python version.");
+       error("Unable to parse python version out of \"$python_version\".");
 }
 
 # The next python version
@@ -128,7 +133,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                                return unless -f;
                                $has_module = 1 if /\.py$/;
                        }, "$tmp/$curdir" ;
-                       if($has_module) {
+                       if ($has_module) {
                                $deps |= PY_MODULE;
                                $dirlist="$dirlist /$curdir";
                        }
@@ -140,18 +145,18 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
        my $strong_dep = 0;
        $dep_on_python = 1 if $deps;
        $strong_dep = 1 if($deps & PY_MODULE);
-       if($package =~ /^python-/) {
+       if ($package =~ /^python-/) {
                my $pack = $package;
                $pack =~ s/^python/python$python_version/;
-               if(grep { "$_" eq "$pack" } @{$dh{DOPACKAGES}}) {
+               if (grep { "$_" eq "$pack" } GetPackages()) {
                        addsubstvar($package, "python:Depends", $pack);
                        $dep_on_python = 1;
                        $strong_dep = 1;
                }
        }
-       if($dep_on_python) {
+       if ($dep_on_python) {
                addsubstvar($package, "python:Depends", $python, ">= $python_version");
-               if($strong_dep) {
+               if ($strong_dep) {
                        addsubstvar($package, "python:Depends", $python, "<< $python_nextversion");
                } else {
                        addsubstvar($package, "python:Depends", $python, "<< $python_nextmajor");
@@ -174,20 +179,20 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                addsubstvar($package, "python:Depends", $pyver) if $verdeps{$pyver};
 
                # And now, the postinst and prerm stuff
-               if($pyver eq "python$python_version") {
-                       if($verdeps{$pyver} & PY_MODULE) {
+               if ($pyver eq "python$python_version") {
+                       if ($verdeps{$pyver} & PY_MODULE) {
                                $pydir = $pydir.$dirlist;
                        } else {
                                $pydir = $dirlist;
                        }
                        $verdeps{$pyver} |= PY_MODULE if($deps & PY_MODULE);
                }
-               if($verdeps{$pyver} & PY_MODULE) {
+               if ($verdeps{$pyver} & PY_MODULE) {
                        autoscript($package,"postinst","postinst-python","s%#PYVER#%$pyver%;s%#DIRLIST#%$pydir%");
                        $need_prerm = 1;
                }
        }
-       if($need_prerm) {
+       if ($need_prerm) {
                autoscript($package,"prerm","prerm-python","s%#PACKAGE#%$package%");
        }
 }
index 8c9f3a3fcbd86a8d3144e4273cd364fec8ce3152..5690fdbf087c3f9ffa44b71d43d284b543be311e 100755 (executable)
@@ -91,4 +91,4 @@ binary-%: build install
        make -f debian/rules binary-common DH_OPTIONS=-p$*
 
 binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
+.PHONY: build clean binary-indep binary-arch binary-common binary install