]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_python
r595: * dh_clean: Clean the *.debhelper temp files on a per-package basis, in
[debhelper.git] / dh_python
index 5618c52cc333032875e64958adc7689bb0b003f0..81da6da5e6e215a35ee28e555cc1bd85c2b86653 100755 (executable)
--- a/dh_python
+++ b/dh_python
@@ -26,7 +26,7 @@ current major version, or on pythonX.Y if your scripts or modules need a
 specific python version. The dependency will be substituted into your
 package's control file wherever you place the token "${python:Depends}".
 
-If some modules need to be byte-compiled at build time, appropriate
+If some modules need to be byte-compiled at install time, appropriate
 postinst and prerm scripts will be generated.
 
 If you use this program, your package should build-depend on python.
@@ -67,7 +67,7 @@ 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$/) {
+elsif ($python_version =~ m/^Python\s+(\d+)\.(\d+)\.\d+/) {
        $python_version = "$1.$2" ;
        $python_major = $1 ;
 } else { 
@@ -187,12 +187,12 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                        }
                        $verdeps{$pyver} |= PY_MODULE if($deps & PY_MODULE);
                }
-               if ($verdeps{$pyver} & PY_MODULE) {
+               if ($verdeps{$pyver} & PY_MODULE && ! $dh{NOSCRIPTS}) {
                        autoscript($package,"postinst","postinst-python","s%#PYVER#%$pyver%;s%#DIRLIST#%$pydir%");
                        $need_prerm = 1;
                }
        }
-       if ($need_prerm) {
+       if ($need_prerm && ! $dh{NOSCRIPTS}) {
                autoscript($package,"prerm","prerm-python","s%#PACKAGE#%$package%");
        }
 }