[debhelper-devel] [debhelper] 01/01: Revert "dh_builddeb: Let dpkg determine the udeb filename by default"

Niels Thykier nthykier at moszumanska.debian.org
Sun Aug 30 14:01:43 UTC 2015


This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository debhelper.

commit a677d8763e4b62e63bfecbb050f3f6861834ca61
Author: Niels Thykier <niels at thykier.net>
Date:   Sun Aug 30 16:01:14 2015 +0200

    Revert "dh_builddeb: Let dpkg determine the udeb filename by default"
    
    This reverts commit b418f73de540dcc3c050c935dab90eed23fe610c.
    
    While dpkg-gencontrol does the right thing, dpkg-deb does not realise
    it is building a udeb.
---
 Debian/Debhelper/Dh_Lib.pm | 20 +++++++++++++++++++-
 debian/changelog           |  3 ---
 dh_builddeb                |  9 ++++++---
 doc/PROGRAMMING            |  2 ++
 4 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 07c1d89..83ad659 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -16,7 +16,7 @@ use vars qw(@EXPORT %dh);
 	    &autoscript &filearray &filedoublearray
 	    &getpackages &basename &dirname &xargs %dh
 	    &compat &addsubstvar &delsubstvar &excludefile &package_arch
-	    &is_udeb &debhelper_script_subst &escape_shell
+	    &is_udeb &udeb_filename &debhelper_script_subst &escape_shell
 	    &inhibit_log &load_log &write_log &commit_override_log
 	    &dpkg_architecture_value &sourcepackage &make_symlink
 	    &is_make_jobserver_unavailable &clean_jobserver_makeflags
@@ -971,6 +971,24 @@ sub is_udeb {
 	return $package_types{$package} eq 'udeb';
 }
 
+sub _xdeb_filename {
+	my ($package, $ext, $actual_name) = @_;
+
+	my $filearch=package_arch($package);
+	isnative($package); # side effect
+	my $version=$dh{VERSION};
+	$version=~s/^[0-9]+://; # strip any epoch
+	$actual_name = $package if not defined($actual_name);
+	return "${actual_name}_${version}_${filearch}.${ext}";
+}
+
+# Generates the filename that is used for a udeb package.
+sub udeb_filename {
+	my ($package) = @_;
+
+	return _xdeb_filename($package, 'udeb');
+}
+
 # Handles #DEBHELPER# substitution in a script; also can generate a new
 # script from scratch if none exists but there is a .debhelper file for it.
 sub debhelper_script_subst {
diff --git a/debian/changelog b/debian/changelog
index 9fccc7d..5c1c022 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,9 +23,6 @@ debhelper (9.20150811+unreleased) UNRELEASED; urgency=medium
   * d/control: Remove the homepage field.
   * dh: Make dh_strip_nondeterminism optional, so debhelper
     does not need to build-depend on it.
-  * dh_builddeb: Let dpkg figure out the filename of udebs
-    itself.  (Closes: #516721, #677353)
-  * Dh_Lib: Drop now unused udeb_filename subroutine.
 
   [ Paul Tagliamonte ]
   * dh_gencontrol: Put debug debs back in the "debug" section.
diff --git a/dh_builddeb b/dh_builddeb
index cf35c07..e36f0a3 100755
--- a/dh_builddeb
+++ b/dh_builddeb
@@ -139,9 +139,12 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 		doit("dpkg-deb", @{$dh{U_PARAMS}}, "--build", $tmp, $dh{DESTDIR}.$dh{FILENAME});
 	}
 	else {
-		my @dpkg_args = default_compressor_args(["-z1", "-Zxz", "-Sextreme"],
-												@{$dh{U_PARAMS}});
-		doit("dpkg-deb", @dpkg_args, "--build", $tmp, $dh{DESTDIR}.$dh{FILENAME});
+		my $filename=$dh{FILENAME};
+		if (! $filename) {
+			$filename="/".udeb_filename($package);
+		}
+		doit("dpkg-deb", "-z1", "-Zxz", "-Sextreme",
+			@{$dh{U_PARAMS}}, "--build", $tmp, $dh{DESTDIR}.$filename);
 	}
 	exit 0;
 }
diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING
index 945d192..3b0bc13 100644
--- a/doc/PROGRAMMING
+++ b/doc/PROGRAMMING
@@ -260,6 +260,8 @@ excludefile($filename)
 is_udeb($package)
 	Returns true if the package is marked as a udeb in the control
 	file.
+udeb_filename($package)
+	Returns the filename of the udeb package.
 getpackages($type)
 	Returns a list of packages in the control file.
 	Pass "arch" or "indep" to specify arch-dependent or

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git




More information about the debhelper-devel mailing list