summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Debian/Debhelper/Dh_Lib.pm18
-rw-r--r--debhelper.pod15
-rw-r--r--debian/changelog6
3 files changed, 30 insertions, 9 deletions
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 60f13c30..a86688a2 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -613,12 +613,21 @@ sub filedoublearray {
my $file=shift;
my $globdir=shift;
+ my $x=-x $file;
+ if ($x) {
+ require Cwd;
+ my $cmd=Cwd::abs_path($file);
+ open (DH_FARRAY_IN, "$cmd |") || error("cannot run $file: $!");
+ }
+ else {
+ open (DH_FARRAY_IN, $file) || error("cannot read $file: $!");
+ }
+
my @ret;
- open (DH_FARRAY_IN, $file) || error("cannot read $file: $!");
while (<DH_FARRAY_IN>) {
chomp;
# Only ignore comments and empty lines in v5 mode.
- if (! compat(4)) {
+ if (! compat(4) && ! $x) {
next if /^#/ || /^$/;
}
my @line;
@@ -627,7 +636,7 @@ sub filedoublearray {
# The tricky bit is that the glob expansion is done
# as if we were in the specified directory, so the
# filenames that come out are relative to it.
- if (defined $globdir && ! compat(2)) {
+ if (defined $globdir && ! compat(2) && ! $x) {
foreach (map { glob "$globdir/$_" } split) {
s#^$globdir/##;
push @line, $_;
@@ -638,7 +647,8 @@ sub filedoublearray {
}
push @ret, [@line];
}
- close DH_FARRAY_IN;
+
+ close DH_FARRAY_IN || error("problem reading $file: $!");
return @ret;
}
diff --git a/debhelper.pod b/debhelper.pod
index 98da7362..65616e39 100644
--- a/debhelper.pod
+++ b/debhelper.pod
@@ -69,9 +69,9 @@ Generally, these files will list files to act on, one file per line. Some
programs in debhelper use pairs of files and destinations or slightly more
complicated formats.
-Note that if a package is the first (or only) binary package listed in
-F<debian/control>, debhelper will use F<debian/foo> if no F<debian/package.foo>
-file can be found.
+Note for the first (or only) binary package listed in
+F<debian/control>, debhelper will use F<debian/foo> when there's no
+F<debian/package.foo> file.
In some rare cases, you may want to have different versions of these files
for different architectures or OSes. If files named debian/I<package>.foo.I<ARCH>
@@ -80,14 +80,19 @@ output of "B<dpkg-architecture -qDEB_HOST_ARCH>" /
"B<dpkg-architecture -qDEB_HOST_ARCH_OS>",
then they will be used in preference to other, more general files.
-In many cases, these config files are used to specify various types of
+Mostly, these config files are used to specify lists of various types of
files. Documentation or example files to install, files to move, and so on.
When appropriate, in cases like these, you can use standard shell wildcard
characters (B<?> and B<*> and B<[>I<..>B<]> character classes) in the files.
-
You can also put comments in these files; lines beginning with B<#> are
ignored.
+The syntax of these files is intentionally kept very simple to make then
+easy to read, understand, and modify. If you prefer power and complexity,
+you can make the file executable, and write a program that outputs
+whatever content is appropriate for a given situation. When you do so,
+the output is not further processed to expand wildcards or strip comments.
+
=head1 SHARED DEBHELPER OPTIONS
The following command line options are supported by all debhelper programs.
diff --git a/debian/changelog b/debian/changelog
index ffcc2ceb..8538b22b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,11 @@
debhelper (8.9.12) UNRELEASED; urgency=low
+ * Debhelper config files may be made executable programs that output the
+ desired configuration. No further changes are planned to the config file
+ format; those needing powerful syntaxes may now use a programming language
+ of their choice. (Be careful aiming that at your feet.)
+ Closes: #235302, #372310, #235302, #614731,
+ Closes: #438601, #477625, #632860, #642129
* Added German translation of man pages, done by Chris Leick. Closes: #651221
* Typo fixes. Closes: #651224 Thanks, Chris Leick