X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=dh_python;h=a2dde7b92036bab3981e9359b83e93eaf1df9a8c;hb=d5453631808c4af4f985f5dacc74b77b68624c30;hp=5c19ef7d4acbe3f9433600b02296a6fc1c9eb81d;hpb=5dd373940d0348cc4dce74d0b0aa148d35b29934;p=debhelper.git diff --git a/dh_python b/dh_python index 5c19ef7..a2dde7b 100755 --- a/dh_python +++ b/dh_python @@ -50,9 +50,8 @@ extra names on the command line are searched for binary (.so) modules. =item B<-V> I If the .py files your package ships are meant to be used by a specific -pythonX.Y version, you can set this option with the desired X.Y python -version. -Do not use if you ship modules in /usr/lib/site-python. +pythonX.Y version, you can use this option to specify the desired version, +such as 2.3. Do not use if you ship modules in /usr/lib/site-python. =item B<-n>, B<--noscripts> @@ -75,7 +74,7 @@ my $python = 'python'; # The current python major version my $python_major; my $python_version = `$python -V 2>&1`; -if ("$python_version" eq "") { +if (! defined $python_version || $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+)*/) { @@ -89,7 +88,7 @@ elsif ($python_version =~ m/^Python\s+(\d+)\.(\d+)(\.\d+)*/) { my $python_nextversion = $python_version + 0.1; my $python_nextmajor = $python_major + 1; -my @python_allversions = ('1.5','2.1','2.2','2.3'); +my @python_allversions = ('1.5','2.1','2.2','2.3','2.4'); foreach (@python_allversions) { s/^/python/; } @@ -99,6 +98,9 @@ my $usepython = "python$python_version"; if($dh{V_FLAG_SET}) { $usepython = $dh{V_FLAG}; $usepython =~ s/^/python/; + if (! grep { $_ eq $usepython } @python_allversions) { + error("Unknown python version $dh{V_FLAG}"); + } } # Cleaning the paths given on the command line @@ -132,7 +134,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) { $strong_dep = 1; my $pack = $package; $pack =~ s/^python/python$python_version/; - if (grep { "$_" eq "$pack" } GetPackages()) { + if (grep { "$_" eq "$pack" } getpackages()) { addsubstvar($package, "python:Depends", $pack); } }