[debhelper-devel] [debhelper] 02/02: Dh_Lib: Add stub default_sourcedir function

Niels Thykier nthykier at moszumanska.debian.org
Sat Jul 22 18:54:21 UTC 2017


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

nthykier pushed a commit to branch master
in repository debhelper.

commit 2edbf91edc01ffb067111eda44b56fb60cbbb359
Author: Niels Thykier <niels at thykier.net>
Date:   Sun Jul 16 13:36:55 2017 +0000

    Dh_Lib: Add stub default_sourcedir function
    
    This function does not do anything particularly useful at the moment,
    but we hope to make it do that in the future.  By including it now,
    other tools can migrate to it easier if/when it becomes useful.
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 Debian/Debhelper/Dh_Lib.pm | 10 +++++++++-
 dh_install                 |  5 ++---
 dh_installdocs             |  4 ++--
 dh_installexamples         |  5 ++---
 dh_installinfo             |  5 ++---
 dh_installman              |  6 +++---
 6 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 792019e..fec7f2f 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -63,7 +63,7 @@ our (@EXPORT, %dh);
 	    XARGS_INSERT_PARAMS_HERE &glob_expand_error_handler_reject
 	    &glob_expand_error_handler_warn_and_discard &glob_expand
 	    &glob_expand_error_handler_silently_ignore DH_BUILTIN_VERSION
-	    &print_and_complex_doit
+	    &print_and_complex_doit &default_sourcedir
 );
 
 # The Makefile changes this if debhelper is installed in a PREFIX.
@@ -677,6 +677,14 @@ sub tmpdir {
 	}
 }
 
+# Pass it a name of a binary package, it returns the name of the staging dir to
+# use, for that package.  (Usually debian/tmp)
+sub default_sourcedir {
+	my ($package) = @_;
+
+	return 'debian/tmp';
+}
+
 # Pass this the name of a binary package, and the name of the file wanted
 # for the package, and it will return the actual existing filename to use.
 #
diff --git a/dh_install b/dh_install
index b5a3248..656b921 100755
--- a/dh_install
+++ b/dh_install
@@ -154,13 +154,12 @@ if ($dh{EXCLUDE_FIND}) {
 	$exclude = '! \( '.$dh{EXCLUDE_FIND}.' \)';
 }
 
-my @search_dirs = ($srcdir);
-push(@search_dirs, 'debian/tmp') if not compat(6);
-
 # PROMISE: DH NOOP WITHOUT pkgfile-logged(install)
 
 foreach my $package (getpackages()) {
 	my (@installed, %dest2sources);
+	my @search_dirs = ($srcdir);
+	push(@search_dirs, default_sourcedir($package)) if not compat(6);
 
 	# Look at the install files for all packages to handle
 	# list-missing/fail-missing, but skip really installing for
diff --git a/dh_installdocs b/dh_installdocs
index 7b81e00..a85d056 100755
--- a/dh_installdocs
+++ b/dh_installdocs
@@ -185,10 +185,8 @@ init(options => {
 });
 
 my $called_getpackages = 0;
-my @search_dirs = ('.');
 my $error_handler = compat(10) ? \&glob_expand_error_handler_warn_and_discard : \&glob_expand_error_handler_reject;
 my $nodocs = is_build_profile_active('nodoc') ? 1 : 0;
- at search_dirs = ($dh{SOURCEDIR} // '.', 'debian/tmp') if not compat(10);
 
 foreach my $package (getpackages()) {
 	next if is_udeb($package);
@@ -197,6 +195,8 @@ foreach my $package (getpackages()) {
 	my $file=pkgfile($package,"docs");
 	my $link_doc=($dh{LINK_DOC} && $dh{LINK_DOC} ne $package);
 	my $skip_install = process_pkg($package) ? 0 : 1;
+	my @search_dirs = ('.');
+	@search_dirs = ($dh{SOURCEDIR} // '.', default_sourcedir($package)) if not compat(10);
 
 	if (not $skip_install) {
 		if ($link_doc) {
diff --git a/dh_installexamples b/dh_installexamples
index 79e6802..ce3d7aa 100755
--- a/dh_installexamples
+++ b/dh_installexamples
@@ -78,20 +78,19 @@ init(options => {
 # PROMISE: DH NOOP WITHOUT pkgfile-logged(examples)
 
 my $pwd;
-my @search_dirs = ('.');
 my $error_handler = compat(10) ? \&glob_expand_error_handler_warn_and_discard : \&glob_expand_error_handler_reject;
 my $nodocs = is_build_profile_active('nodoc') ? 1 : 0;
 # We cannot assume documentation is built under nodoc, but if it is we must flag it as handled
 # or dh_missing might make noise.
 $error_handler = \&glob_expand_error_handler_silently_ignore if $nodocs;
 
- at search_dirs = ($dh{SOURCEDIR} // '.', 'debian/tmp') if not compat(10);
-
 foreach my $package (getpackages()) {
 	next if is_udeb($package);
 
 	my $tmp=tmpdir($package);
 	my $file=pkgfile($package,"examples");
+	my @search_dirs = ('.');
+	@search_dirs = ($dh{SOURCEDIR} // '.', default_sourcedir($package)) if not compat(10);
 	
 	my @examples;
 	
diff --git a/dh_installinfo b/dh_installinfo
index ff9bbe2..eeaa395 100755
--- a/dh_installinfo
+++ b/dh_installinfo
@@ -63,18 +63,17 @@ init();
 
 # PROMISE: DH NOOP WITHOUT info
 
-my @search_dirs = ('.');
 my $error_handler = compat(10) ? \&glob_expand_error_handler_warn_and_discard : \&glob_expand_error_handler_reject;
 my $nodocs = is_build_profile_active('nodoc') ? 1 : 0;
 # We cannot assume documentation is built under nodoc, but if it is we must flag it as handled
 # or dh_missing might make noise.
 $error_handler = \&glob_expand_error_handler_silently_ignore if $nodocs;
 
- at search_dirs = ($dh{SOURCEDIR} // '.', 'debian/tmp') if not compat(10);
-
 foreach my $package (getpackages()) {
 	my $tmp=tmpdir($package);
 	my $file=pkgfile($package,"info");
+	my @search_dirs = ('.');
+	@search_dirs = ($dh{SOURCEDIR} // '.', default_sourcedir($package)) if not compat(10);
 
 	my @info;
 	
diff --git a/dh_installman b/dh_installman
index 704dbbc..d25f31e 100755
--- a/dh_installman
+++ b/dh_installman
@@ -140,15 +140,13 @@ init(options => {
 
 my (@sofiles, @sodests);
 my @all_packages = getpackages();
-my @search_dirs = ('.');
+
 my $error_handler = compat(10) ? \&glob_expand_error_handler_warn_and_discard : \&glob_expand_error_handler_reject;
 my $nodocs = is_build_profile_active('nodoc') ? 1 : 0;
 # We cannot assume documentation is built under nodoc, but if it is we must flag it as handled
 # or dh_missing might make noise.
 $error_handler = \&glob_expand_error_handler_silently_ignore if $nodocs;
 
- at search_dirs = ($dh{SOURCEDIR} // '.', 'debian/tmp') if not compat(10);
-
 on_items_in_parallel(\@all_packages, sub {
 
 	foreach my $package (@_) {
@@ -157,6 +155,8 @@ on_items_in_parallel(\@all_packages, sub {
 		my $tmp = tmpdir($package);
 		my $file = pkgfile($package, "manpages");
 		my @manpages;
+		my @search_dirs = ('.');
+		@search_dirs = ($dh{SOURCEDIR} // '.', default_sourcedir($package)) if not compat(10);
 
 		@manpages = filearray($file, \@search_dirs, $error_handler) if $file;
 

-- 
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