X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=dh_python;h=857504f7163c09879107ea15b6267cee78f5013b;hb=14f322661663b3d95231fa2a499e856fc1689e14;hp=eb32fd46e36719b441cd55c61a46b47b380e562e;hpb=4f162e192c3563d740490cc99ced1513104ac34c;p=debhelper.git diff --git a/dh_python b/dh_python index eb32fd4..857504f 100755 --- a/dh_python +++ b/dh_python @@ -16,6 +16,10 @@ B [S>] [B<-n>] [B<-V> I] [S 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> @@ -70,6 +73,18 @@ Python policy, version 0.3.7 init(); +if (-e "debian/pycompat") { + warning("Doing nothing since dh_pycompat exists; dh_pysupport or dh_pycentral should do the work. You can remove dh_python from your rules file."); + exit 0; +} +elsif (`grep Python-Version: debian/control`) { + warning("Doing nothing since Python-Version is set; dh_pysupport or dh_pycentral should do the work. You can remove dh_python from your rules file."); + exit 0; +} +else { + warning("This program is deprecated, you should use dh_pysupport or dh_pycentral instead."); +} + my $python = 'python'; # The current python major version @@ -89,7 +104,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 +114,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 @@ -137,8 +155,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) { } } if ($package !~ /^python[0-9].[0-9]-/) { - push @dirs, "usr/lib/python$python_version/site-packages" ; - push @dirs_so, "usr/lib/python$python_version/site-packages" ; + push @dirs, "usr/lib/$usepython/site-packages"; + push @dirs_so, "usr/lib/$usepython/site-packages"; $look_for_pythonXY = 0; }