summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2013-07-19 18:49:11 -0400
committerJoey Hess <joey@kitenet.net>2013-07-19 18:49:11 -0400
commit6d994134a907ab4bce94749bda9994a267d45008 (patch)
tree2e3402f2146a1c8b5ba6538f048c62a8afecc0d4
parent91e3ae6aa5a49de6b39514e43253641fc8093fc0 (diff)
dh_python: Removed this deprecated and unused command. Closes: #717374 (Thanks, Luca Falavigna)
-rw-r--r--debian/changelog8
-rw-r--r--debian/copyright4
-rwxr-xr-xdh_python292
-rw-r--r--doc/TODO1
-rw-r--r--man/po4a/po/debhelper.pot6
-rw-r--r--man/po4a/po4a.cfg1
-rwxr-xr-xt/size3
7 files changed, 12 insertions, 303 deletions
diff --git a/debian/changelog b/debian/changelog
index bea8e42d..0acf43ee 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+debhelper (9.20130631) UNRELEASED; urgency=low
+
+ * dh_python: Removed this deprecated and unused command.
+ Closes: #717374
+ (Thanks, Luca Falavigna)
+
+ -- Joey Hess <joeyh@debian.org> Fri, 19 Jul 2013 18:47:27 -0400
+
debhelper (9.20130630) unstable; urgency=low
* perl_build: Use -- long option names, for compatibility with
diff --git a/debian/copyright b/debian/copyright
index 4ec9761d..0e79f07a 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -19,10 +19,6 @@ Files: dh_perl
Copyright: Brendan O'Dea <bod@debian.org>
License: GPL-2+
-Files: dh_python
-Copyright: Josselin Mouette <josselin.mouette@ens-lyon.org>
-License: GPL-2+
-
Files: dh_installcatalogs
Copyright: Adam Di Carlo <aph@debian.org>
License: GPL-2+
diff --git a/dh_python b/dh_python
deleted file mode 100755
index 722d8135..00000000
--- a/dh_python
+++ /dev/null
@@ -1,292 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_python - calculates Python dependencies and adds postinst and prerm Python scripts (deprecated)
-
-=cut
-
-use strict;
-use File::Find;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_python> [S<I<debhelper options>>] [B<-n>] [B<-V> I<version>] [S<I<module dirs> ...>]
-
-=head1 DESCRIPTION
-
-Note: This program is deprecated. You should use B<dh_python2> instead.
-This program will do nothing if F<debian/pycompat> or a
-B<Python-Version> F<control> file field exists.
-
-B<dh_python> is a debhelper program that is responsible for generating the
-B<${python:Depends}> substitutions and adding them to substvars files. It
-will also add a F<postinst> and a F<prerm> script if required.
-
-The program will look at Python scripts and modules in your package, and
-will use this information to generate a dependency on B<python>, with the
-current major version, or on B<python>I<X>B<.>I<Y> if your scripts or modules need a
-specific B<python> version. The dependency will be substituted into your
-package's F<control> file wherever you place the token B<${python:Depends}>.
-
-If some modules need to be byte-compiled at install time, appropriate
-F<postinst> and F<prerm> scripts will be generated. If already byte-compiled
-modules are found, they are removed.
-
-If you use this program, your package should build-depend on B<python>.
-
-=head1 OPTIONS
-
-=over 4
-
-=item I<module dirs>
-
-If your package installs Python modules in non-standard directories, you
-can make F<dh_python> check those directories by passing their names on the
-command line. By default, it will check F</usr/lib/site-python>,
-F</usr/lib/$PACKAGE>, F</usr/share/$PACKAGE>, F</usr/lib/games/$PACKAGE>,
-F</usr/share/games/$PACKAGE> and F</usr/lib/python?.?/site-packages>.
-
-Note: only F</usr/lib/site-python>, F</usr/lib/python?.?/site-packages> and the
-extra names on the command line are searched for binary (F<.so>) modules.
-
-=item B<-V> I<version>
-
-If the F<.py> files your package ships are meant to be used by a specific
-B<python>I<X>B<.>I<Y> version, you can use this option to specify the desired version,
-such as B<2.3>. Do not use if you ship modules in F</usr/lib/site-python>.
-
-=item B<-n>, B<--noscripts>
-
-Do not modify F<postinst>/F<prerm> scripts.
-
-=back
-
-=head1 CONFORMS TO
-
-Debian policy, version 3.5.7
-
-Python policy, version 0.3.7
-
-=cut
-
-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_python2 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_python2 instead.");
-}
-
-my $python = 'python';
-
-# The current python major version
-my $python_major;
-my $python_version = `$python -V 2>&1`;
-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+)*/) {
- $python_version = "$1.$2" ;
- $python_major = $1 ;
-} else {
- error("Unable to parse python version out of \"$python_version\".");
-}
-
-# The next python version
-my $python_nextversion = $python_version + 0.1;
-my $python_nextmajor = $python_major + 1;
-
-my @python_allversions = ('1.5','2.1','2.2','2.3','2.4');
-foreach (@python_allversions) {
- s/^/python/;
-}
-
-# Check for -V
-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
-foreach (@ARGV) {
- s#/$##;
- s#^/##;
-}
-
-# dependency types
-use constant PROGRAM => 1;
-use constant PY_MODULE => 2;
-use constant PY_MODULE_NONSTANDARD => 4;
-use constant SO_MODULE => 8;
-use constant SO_MODULE_NONSTANDARD => 16;
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp = tmpdir($package);
-
- my @dirs = ("usr/lib/site-python", "usr/lib/$package", "usr/share/$package", "usr/lib/games/$package", "usr/share/games/$package", @ARGV );
- my @dirs_so = ("usr/lib/site-python", @ARGV );
-
- my $dep_on_python = 0;
- my $strong_dep = 0;
- my $look_for_pythonXY = 1;
-
- # First, the case of python-foo and pythonX.Y-foo
- if ($package =~ /^python-/) {
- $dep_on_python = 1;
- $strong_dep = 1;
- my $pack = $package;
- $pack =~ s/^python/python$python_version/;
- if (grep { "$_" eq "$pack" } getpackages()) {
- addsubstvar($package, "python:Depends", $pack);
- }
- }
- if ($package !~ /^python[0-9].[0-9]-/) {
- push @dirs, "usr/lib/$usepython/site-packages";
- push @dirs_so, "usr/lib/$usepython/site-packages";
- $look_for_pythonXY = 0;
- }
-
- @dirs = grep -d, map "$tmp/$_", @dirs;
- @dirs_so = grep -d, map "$tmp/$_", @dirs_so;
-
- my $deps = 0;
- my %verdeps = ();
- foreach (@python_allversions) {
- $verdeps{$_} = 0;
- }
-
- # Find scripts
- find sub {
- return unless -f and (-x or /\.py$/);
- local *F;
- return unless open F, $_;
- if (read F, local $_, 32 and m%^#!\s*/usr/bin/(env\s+)?(python(\d+\.\d+)?)\s%) {
- if ( "python" eq $2 ) {
- $deps |= PROGRAM;
- } elsif(defined $verdeps{$2}) {
- $verdeps{$2} |= PROGRAM;
- }
- }
- close F;
- }, $tmp;
-
- # Look for python modules
- my $dirlist="";
- if (@dirs) {
- foreach my $curdir (@dirs) {
- my $has_module = 0;
- $curdir =~ s%^$tmp/%%;
- find sub {
- return unless -f;
- if (/\.py$/) {
- $has_module = 1;
- doit(("rm","-f",$_."c",$_."o"));
- }
- }, "$tmp/$curdir" ;
- if ($has_module) {
- if ($dh{V_FLAG_SET}) {
- $verdeps{$usepython} |= PY_MODULE_NONSTANDARD;
- } else {
- $deps |= PY_MODULE;
- }
- $dirlist="$dirlist /$curdir";
- }
- }
- }
- if (@dirs_so) {
- foreach my $curdir (@dirs_so) {
- my $has_module = 0;
- $curdir =~ s%^$tmp/%%;
- find sub {
- return unless -f;
- $has_module = 1 if /\.so$/;
- }, "$tmp/$curdir" ;
- if ($has_module) {
- if ($dh{V_FLAG_SET}) {
- $verdeps{$usepython} |= SO_MODULE_NONSTANDARD;
- }
- else {
- $deps |= SO_MODULE;
- }
- }
- }
- }
-
- # Dependencies on current python
- $dep_on_python = 1 if $deps;
- $strong_dep = 1 if($deps & (PY_MODULE|SO_MODULE));
-
- if ($dep_on_python) {
- addsubstvar($package, "python:Depends", $python, ">= $python_version");
- if ($strong_dep) {
- addsubstvar($package, "python:Depends", $python, "<< $python_nextversion");
- } else {
- addsubstvar($package, "python:Depends", $python, "<< $python_nextmajor");
- }
- }
-
- my $need_prerm = 0;
-
- # Look for specific pythonX.Y modules
- foreach my $pyver (@python_allversions) {
- my $pydir="/usr/lib/$pyver/site-packages";
- if ($look_for_pythonXY) {
- if (grep -d,"$tmp$pydir") {
- find sub {
- return unless -f;
- if (/\.py$/) {
- $verdeps{$pyver} |= PY_MODULE;
- doit(("rm","-f",$_."c",$_."o"));
- }
- $verdeps{$pyver} |= SO_MODULE if /\.so$/;
- }, "$tmp$pydir";
- }
- }
-
- # Go for the dependencies
- addsubstvar($package, "python:Depends", $pyver) if $verdeps{$pyver};
-
- # And now, the postinst and prerm stuff
- if ($pyver eq "$usepython") {
- if ($verdeps{$pyver} & PY_MODULE) {
- $pydir = $pydir.$dirlist;
- } else {
- $pydir = $dirlist;
- }
- $verdeps{$pyver} |= PY_MODULE if($deps & PY_MODULE);
- }
- if ($verdeps{$pyver} & (PY_MODULE|PY_MODULE_NONSTANDARD) && ! $dh{NOSCRIPTS}) {
- autoscript($package,"postinst","postinst-python","s%#PYVER#%$pyver%;s%#DIRLIST#%$pydir%");
- $need_prerm = 1;
- }
- }
- if ($need_prerm && ! $dh{NOSCRIPTS}) {
- autoscript($package,"prerm","prerm-python","s%#PACKAGE#%$package%");
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Josselin Mouette <joss@debian.org>
-
-most ideas stolen from Brendan O'Dea <bod@debian.org>
-
-=cut
diff --git a/doc/TODO b/doc/TODO
index cd2721f6..822295fc 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -15,7 +15,6 @@ Deprecated:
docs or message yet.
* dh_undocumented
* dh_installinit --init-script (make it warn)
-* dh_python
* dh_clean -k
* dh_desktop, dh_scrollkeeper. Remove eventually..
* -s flag, not formally deprecated yet; remove eventually
diff --git a/man/po4a/po/debhelper.pot b/man/po4a/po/debhelper.pot
index 18339aab..c03a8ac1 100644
--- a/man/po4a/po/debhelper.pot
+++ b/man/po4a/po/debhelper.pot
@@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
#. type: =head1
-#: debhelper.pod:1 dh:3 dh_auto_build:3 dh_auto_clean:3 dh_auto_configure:3 dh_auto_install:3 dh_auto_test:3 dh_bugfiles:3 dh_builddeb:3 dh_clean:3 dh_compress:3 dh_desktop:3 dh_fixperms:3 dh_gconf:3 dh_gencontrol:3 dh_icons:3 dh_install:3 dh_installcatalogs:3 dh_installchangelogs:3 dh_installcron:3 dh_installdeb:3 dh_installdebconf:3 dh_installdirs:3 dh_installdocs:3 dh_installemacsen:3 dh_installexamples:3 dh_installifupdown:3 dh_installinfo:3 dh_installinit:3 dh_installlogcheck:3 dh_installlogrotate:3 dh_installman:3 dh_installmanpages:3 dh_installmenu:3 dh_installmime:3 dh_installmodules:3 dh_installpam:3 dh_installppp:3 dh_installudev:3 dh_installwm:3 dh_installxfonts:3 dh_link:3 dh_lintian:3 dh_listpackages:3 dh_makeshlibs:3 dh_md5sums:3 dh_movefiles:3 dh_perl:3 dh_prep:3 dh_python:3 dh_scrollkeeper:3 dh_shlibdeps:3 dh_strip:3 dh_suidregister:3 dh_testdir:3 dh_testroot:3 dh_undocumented:3 dh_usrlocal:3
+#: debhelper.pod:1 dh:3 dh_auto_build:3 dh_auto_clean:3 dh_auto_configure:3 dh_auto_install:3 dh_auto_test:3 dh_bugfiles:3 dh_builddeb:3 dh_clean:3 dh_compress:3 dh_desktop:3 dh_fixperms:3 dh_gconf:3 dh_gencontrol:3 dh_icons:3 dh_install:3 dh_installcatalogs:3 dh_installchangelogs:3 dh_installcron:3 dh_installdeb:3 dh_installdebconf:3 dh_installdirs:3 dh_installdocs:3 dh_installemacsen:3 dh_installexamples:3 dh_installifupdown:3 dh_installinfo:3 dh_installinit:3 dh_installlogcheck:3 dh_installlogrotate:3 dh_installman:3 dh_installmanpages:3 dh_installmenu:3 dh_installmime:3 dh_installmodules:3 dh_installpam:3 dh_installppp:3 dh_installudev:3 dh_installwm:3 dh_installxfonts:3 dh_link:3 dh_lintian:3 dh_listpackages:3 dh_makeshlibs:3 dh_md5sums:3 dh_movefiles:3 dh_perl:3 dh_prep:3 dh_scrollkeeper:3 dh_shlibdeps:3 dh_strip:3 dh_suidregister:3 dh_testdir:3 dh_testroot:3 dh_undocumented:3 dh_usrlocal:3
msgid "NAME"
msgstr ""
@@ -27,7 +27,7 @@ msgid "debhelper - the debhelper tool suite"
msgstr ""
#. type: =head1
-#: debhelper.pod:5 dh:12 dh_auto_build:12 dh_auto_clean:13 dh_auto_configure:12 dh_auto_install:15 dh_auto_test:13 dh_bugfiles:12 dh_builddeb:12 dh_clean:12 dh_compress:13 dh_desktop:12 dh_fixperms:12 dh_gconf:12 dh_gencontrol:12 dh_icons:13 dh_install:13 dh_installcatalogs:14 dh_installchangelogs:12 dh_installcron:12 dh_installdeb:12 dh_installdebconf:12 dh_installdirs:12 dh_installdocs:12 dh_installemacsen:12 dh_installexamples:12 dh_installifupdown:12 dh_installinfo:12 dh_installinit:13 dh_installlogcheck:12 dh_installlogrotate:12 dh_installman:13 dh_installmanpages:13 dh_installmenu:12 dh_installmime:12 dh_installmodules:13 dh_installpam:12 dh_installppp:12 dh_installudev:13 dh_installwm:12 dh_installxfonts:12 dh_link:13 dh_lintian:12 dh_listpackages:12 dh_makeshlibs:12 dh_md5sums:13 dh_movefiles:12 dh_perl:14 dh_prep:12 dh_python:13 dh_scrollkeeper:12 dh_shlibdeps:13 dh_strip:13 dh_suidregister:7 dh_testdir:12 dh_testroot:7 dh_undocumented:12 dh_usrlocal:15
+#: debhelper.pod:5 dh:12 dh_auto_build:12 dh_auto_clean:13 dh_auto_configure:12 dh_auto_install:15 dh_auto_test:13 dh_bugfiles:12 dh_builddeb:12 dh_clean:12 dh_compress:13 dh_desktop:12 dh_fixperms:12 dh_gconf:12 dh_gencontrol:12 dh_icons:13 dh_install:13 dh_installcatalogs:14 dh_installchangelogs:12 dh_installcron:12 dh_installdeb:12 dh_installdebconf:12 dh_installdirs:12 dh_installdocs:12 dh_installemacsen:12 dh_installexamples:12 dh_installifupdown:12 dh_installinfo:12 dh_installinit:13 dh_installlogcheck:12 dh_installlogrotate:12 dh_installman:13 dh_installmanpages:13 dh_installmenu:12 dh_installmime:12 dh_installmodules:13 dh_installpam:12 dh_installppp:12 dh_installudev:13 dh_installwm:12 dh_installxfonts:12 dh_link:13 dh_lintian:12 dh_listpackages:12 dh_makeshlibs:12 dh_md5sums:13 dh_movefiles:12 dh_perl:14 dh_prep:12 dh_scrollkeeper:12 dh_shlibdeps:13 dh_strip:13 dh_suidregister:7 dh_testdir:12 dh_testroot:7 dh_undocumented:12 dh_usrlocal:15
msgid "SYNOPSIS"
msgstr ""
@@ -39,7 +39,7 @@ msgid ""
msgstr ""
#. type: =head1
-#: debhelper.pod:9 dh:16 dh_auto_build:16 dh_auto_clean:17 dh_auto_configure:16 dh_auto_install:19 dh_auto_test:17 dh_bugfiles:16 dh_builddeb:16 dh_clean:16 dh_compress:17 dh_desktop:16 dh_fixperms:16 dh_gconf:16 dh_gencontrol:16 dh_icons:17 dh_install:17 dh_installcatalogs:18 dh_installchangelogs:16 dh_installcron:16 dh_installdeb:16 dh_installdebconf:16 dh_installdirs:16 dh_installdocs:16 dh_installemacsen:16 dh_installexamples:16 dh_installifupdown:16 dh_installinfo:16 dh_installinit:17 dh_installlogcheck:16 dh_installlogrotate:16 dh_installman:17 dh_installmanpages:17 dh_installmenu:16 dh_installmime:16 dh_installmodules:17 dh_installpam:16 dh_installppp:16 dh_installudev:17 dh_installwm:16 dh_installxfonts:16 dh_link:17 dh_lintian:16 dh_listpackages:16 dh_makeshlibs:16 dh_md5sums:17 dh_movefiles:16 dh_perl:18 dh_prep:16 dh_python:17 dh_scrollkeeper:16 dh_shlibdeps:17 dh_strip:17 dh_suidregister:11 dh_testdir:16 dh_testroot:11 dh_undocumented:16 dh_usrlocal:19
+#: debhelper.pod:9 dh:16 dh_auto_build:16 dh_auto_clean:17 dh_auto_configure:16 dh_auto_install:19 dh_auto_test:17 dh_bugfiles:16 dh_builddeb:16 dh_clean:16 dh_compress:17 dh_desktop:16 dh_fixperms:16 dh_gconf:16 dh_gencontrol:16 dh_icons:17 dh_install:17 dh_installcatalogs:18 dh_installchangelogs:16 dh_installcron:16 dh_installdeb:16 dh_installdebconf:16 dh_installdirs:16 dh_installdocs:16 dh_installemacsen:16 dh_installexamples:16 dh_installifupdown:16 dh_installinfo:16 dh_installinit:17 dh_installlogcheck:16 dh_installlogrotate:16 dh_installman:17 dh_installmanpages:17 dh_installmenu:16 dh_installmime:16 dh_installmodules:17 dh_installpam:16 dh_installppp:16 dh_installudev:17 dh_installwm:16 dh_installxfonts:16 dh_link:17 dh_lintian:16 dh_listpackages:16 dh_makeshlibs:16 dh_md5sums:17 dh_movefiles:16 dh_perl:18 dh_prep:16 dh_scrollkeeper:16 dh_shlibdeps:17 dh_strip:17 dh_suidregister:11 dh_testdir:16 dh_testroot:11 dh_undocumented:16 dh_usrlocal:19
msgid "DESCRIPTION"
msgstr ""
diff --git a/man/po4a/po4a.cfg b/man/po4a/po4a.cfg
index a6b82c4f..8c2ac2d7 100644
--- a/man/po4a/po4a.cfg
+++ b/man/po4a/po4a.cfg
@@ -52,7 +52,6 @@
[type: pod] dh_movefiles $lang:man/$lang/dh_movefiles.pod add_fr:man/po4a/add.fr add_es:man/po4a/add2.es add_de:man/po4a/add.de
[type: pod] dh_perl $lang:man/$lang/dh_perl.pod add_fr:man/po4a/add.fr add_es:man/po4a/add2.es add_de:man/po4a/add.de
[type: pod] dh_prep $lang:man/$lang/dh_prep.pod add_fr:man/po4a/add.fr add_es:man/po4a/add2.es add_de:man/po4a/add.de
-[type: pod] dh_python $lang:man/$lang/dh_python.pod add_fr:man/po4a/add.fr add_es:man/po4a/add2.es add_de:man/po4a/add.de
[type: pod] dh_scrollkeeper $lang:man/$lang/dh_scrollkeeper.pod add_fr:man/po4a/add.fr add_es:man/po4a/add2.es add_de:man/po4a/add.de
[type: pod] dh_shlibdeps $lang:man/$lang/dh_shlibdeps.pod add_fr:man/po4a/add.fr add_es:man/po4a/add2.es add_de:man/po4a/add.de
[type: pod] dh_strip $lang:man/$lang/dh_strip.pod add_fr:man/po4a/add.fr add_es:man/po4a/add2.es add_de:man/po4a/add.de
diff --git a/t/size b/t/size
index fb915544..d8b98964 100755
--- a/t/size
+++ b/t/size
@@ -5,8 +5,7 @@
# bug.
use Test::More;
-# exclude dh_python since it's deprecated
-my @progs=grep { -x $_ && !/dh_python/ } glob("dh_*");
+my @progs=grep { -x $_ } glob("dh_*");
plan(tests => (@progs + @progs));