=head1 DESCRIPTION
+Note: This program is deprecated. You should use dh_pysupport or
+dh_pycentral instead. This program will do nothing if debian/pycompat
+or a Python-Version control file field exists.
+
dh_python is a debhelper program that is responsible for generating the
${python:Depends} substitutions and adding them to substvars files. It
will also add a postinst and a prerm script if required.
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
# Check for -V
my $usepython = "python$python_version";
if($dh{V_FLAG_SET}) {
- $python_version = $dh{V_FLAG};
$usepython = $dh{V_FLAG};
$usepython =~ s/^/python/;
if (! grep { $_ eq $usepython } @python_allversions) {
}
}
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;
}