summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2017-06-29 11:30:09 +0000
committerNiels Thykier <niels@thykier.net>2017-06-29 11:38:19 +0000
commit6f811431832f6c00d420b0bdeec373acbf5911c9 (patch)
tree7a8c11e4a139062723853864cd9656b40dae2c9f
parentecb452465fb31c817f185130dca5d42f576d7463 (diff)
downloaddebhelper-6f811431832f6c00d420b0bdeec373acbf5911c9.tar.gz
dh_installexamples: Support --sourcedir and fallback to d/tmp [c11]
Signed-off-by: Niels Thykier <niels@thykier.net>
-rwxr-xr-xdh_installexamples16
1 files changed, 15 insertions, 1 deletions
diff --git a/dh_installexamples b/dh_installexamples
index 0956d6c6..e4598533 100755
--- a/dh_installexamples
+++ b/dh_installexamples
@@ -39,6 +39,16 @@ Lists example files or directories to be installed.
Install any files specified by command line parameters in ALL packages
acted on.
+=item B<--sourcedir=>I<dir>
+
+Look in the specified directory for files to be installed. This option
+requires compat 11 or later (it is silently ignored in compat 10 or earlier).
+
+Note that this is not the same as the B<--sourcedirectory> option used
+by the B<dh_auto_>I<*> commands. You rarely need to use this option, since
+B<dh_installexamples> automatically looks for files in F<debian/tmp> in debhelper
+compatibility level 11 and above.
+
=item B<-X>I<item>, B<--exclude=>I<item>
Exclude files that contain I<item> anywhere in their filename from
@@ -59,7 +69,9 @@ directory, it will install the complete contents of the directory.
=cut
-init();
+init(options => {
+ "sourcedir=s" => \$dh{SOURCEDIR},
+});
# PROMISE: DH NOOP WITHOUT examples
@@ -71,6 +83,8 @@ my $nodocs = is_build_profile_active('nodoc') ? 1 : 0;
# or dh_missing might make noise.
$error_handler = \&glob_expand_error_handler_silently_ignore if $nodocs;
+@search_dirs = ($dh{SOURCEDIR} // '.', 'debian/tmp') if not compat(10);
+
foreach my $package (getpackages()) {
next if is_udeb($package);