summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoey <joey>2002-12-19 02:27:35 +0000
committerjoey <joey>2002-12-19 02:27:35 +0000
commita68baf307c4cb61605ad117bfff39332a4e41484 (patch)
treec224dd96b0c2b88267ed6a0090073f29d97b369b
parent8113612bc822e5d2cc3bbe900fa5d3c44250b057 (diff)
downloaddebhelper-a68baf307c4cb61605ad117bfff39332a4e41484.tar.gz
r570: * List binary-common in .PHONY in rules.multi2. Closes: #173278
* Cleaned up error message if python is not installed. Closes: #173524 * dh_python: Bug fix from Josselin Mouette for case of building an arch indep python package depending on a arch dependent package. However, I used GetPackages() rather than add yet another control file parser. Untested.
-rw-r--r--debian/changelog11
-rwxr-xr-xdh_python29
-rwxr-xr-xexamples/rules.multi22
3 files changed, 29 insertions, 13 deletions
diff --git a/debian/changelog b/debian/changelog
index 6cebf98c..9553319e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+debhelper (4.1.29) unstable; urgency=low
+
+ * List binary-common in .PHONY in rules.multi2. Closes: #173278
+ * Cleaned up error message if python is not installed. Closes: #173524
+ * dh_python: Bug fix from Josselin Mouette for case of building an arch
+ indep python package depending on a arch dependent package. However, I
+ used GetPackages() rather than add yet another control file parser.
+ Untested.
+
+ -- Joey Hess <joeyh@debian.org> Wed, 18 Dec 2002 21:20:41 -0500
+
debhelper (4.1.28) unstable; urgency=low
* Fix dh_install to install empty directories even if it is excluding some
diff --git a/dh_python b/dh_python
index b2a9ad7a..a2bede94 100755
--- a/dh_python
+++ b/dh_python
@@ -29,6 +29,8 @@ package's control file wherever you place the token "${python:Depends}".
If some modules need to be byte-compiled at build time, appropriate
postinst and prerm scripts will be generated.
+If you use this program, your package should build-depend on python.
+
=head1 OPTIONS
=over 4
@@ -60,13 +62,16 @@ init();
my $python = 'python';
# The current python major version
-my $python_version;
my $python_major;
-if(`$python -V 2>&1` =~ m/^Python\s+(\d+)\.(\d+)\.\d+\n$/) {
+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$/) {
$python_version = "$1.$2" ;
$python_major = $1 ;
} else {
- error("Cannot obtain python version.");
+ error("Unable to parse python version out of \"$python_version\".");
}
# The next python version
@@ -128,7 +133,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
return unless -f;
$has_module = 1 if /\.py$/;
}, "$tmp/$curdir" ;
- if($has_module) {
+ if ($has_module) {
$deps |= PY_MODULE;
$dirlist="$dirlist /$curdir";
}
@@ -140,18 +145,18 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
my $strong_dep = 0;
$dep_on_python = 1 if $deps;
$strong_dep = 1 if($deps & PY_MODULE);
- if($package =~ /^python-/) {
+ if ($package =~ /^python-/) {
my $pack = $package;
$pack =~ s/^python/python$python_version/;
- if(grep { "$_" eq "$pack" } @{$dh{DOPACKAGES}}) {
+ if (grep { "$_" eq "$pack" } GetPackages()) {
addsubstvar($package, "python:Depends", $pack);
$dep_on_python = 1;
$strong_dep = 1;
}
}
- if($dep_on_python) {
+ if ($dep_on_python) {
addsubstvar($package, "python:Depends", $python, ">= $python_version");
- if($strong_dep) {
+ if ($strong_dep) {
addsubstvar($package, "python:Depends", $python, "<< $python_nextversion");
} else {
addsubstvar($package, "python:Depends", $python, "<< $python_nextmajor");
@@ -174,20 +179,20 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
addsubstvar($package, "python:Depends", $pyver) if $verdeps{$pyver};
# And now, the postinst and prerm stuff
- if($pyver eq "python$python_version") {
- if($verdeps{$pyver} & PY_MODULE) {
+ if ($pyver eq "python$python_version") {
+ if ($verdeps{$pyver} & PY_MODULE) {
$pydir = $pydir.$dirlist;
} else {
$pydir = $dirlist;
}
$verdeps{$pyver} |= PY_MODULE if($deps & PY_MODULE);
}
- if($verdeps{$pyver} & PY_MODULE) {
+ if ($verdeps{$pyver} & PY_MODULE) {
autoscript($package,"postinst","postinst-python","s%#PYVER#%$pyver%;s%#DIRLIST#%$pydir%");
$need_prerm = 1;
}
}
- if($need_prerm) {
+ if ($need_prerm) {
autoscript($package,"prerm","prerm-python","s%#PACKAGE#%$package%");
}
}
diff --git a/examples/rules.multi2 b/examples/rules.multi2
index 8c9f3a3f..5690fdbf 100755
--- a/examples/rules.multi2
+++ b/examples/rules.multi2
@@ -91,4 +91,4 @@ binary-%: build install
make -f debian/rules binary-common DH_OPTIONS=-p$*
binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
+.PHONY: build clean binary-indep binary-arch binary-common binary install