On Di, 2010-05-18 at 16:05 +0200, Julian Andres Klode wrote:
> On Tue, May 18, 2010 at 03:38:17PM +0200, Thomas Koch wrote:
> > Package: dh-autoreconf
> > Version: 1
> > Severity: wishlist
> > 
> > Hi,
> > 
> > I'd like to run dh_autoreconf on a multiple subdirs of my java project, 
> > which has
> > some C stuff in src/c and src/contrib/zktreeutil.
> > Could you please make this possible?
> > Thank you!
> If I read your wish correctly, you want to restrict the
> directories dh_autoreconf will act on. That could be added.
> 
> For now, you could probably just use something like
> 
>       dh_override_dh_autoreconf:
>               dh_autoreconf -X.java autoreconf -- -f -i \
>                               src/c src/contrib/zktreeutil
> 
> which will run autoreconf in your two subdirectories while
> ignoring any java file (since it still has to scan the whole
> source tree).
Does the attached patch make sense? You would need to create a file
debian/autoreconf containing:
  src/c
  src/contrib/zktreeutil

and that's it. Currently, it restricts find to act on the directories
listed in this file and passes the list to autoreconf.

In the future, this could be changed to only pass those directories to
autoreconf that contain a configure.{ac,in} file while also scanning the
other pathes given there for changes.

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.

>From 8b15d102e9f2b58679706a39702f8d18b9bdd00e Mon Sep 17 00:00:00 2001
From: Julian Andres Klode <j...@debian.org>
Date: Tue, 22 Jun 2010 12:53:47 +0200
Subject: [PATCH] Make it possible to run on sub directories only (Closes: #582114).

Introduce support for debian/autoreconf, a file which contains
a list of directories autoreconf should be run on. If present,
dh_autoreconf will only scan the given directories instead of
the complete source tree.
---
 dh_autoreconf |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/dh_autoreconf b/dh_autoreconf
index ad2e317..29c3bfa 100755
--- a/dh_autoreconf
+++ b/dh_autoreconf
@@ -21,6 +21,19 @@ debian/autoreconf.before and debian/autoreconf.after which contain checksums
 of all files before/after the build. It is complemented by dh_autoreconf_clean
 which creates a list of all changed and added files and removes them.
 
+=head1 FILES
+
+=over 4
+
+=item debian/autoreconf
+
+This file can contain a list of directories. If present, dh_autoreconf will
+only scan the given directories for changes. If no special command is given
+to dh_autoreconf, it will also forward the directory list to autoreconf
+which causes it to be run only on those sub directories.
+
+=back
+
 =head1 OPTIONS
 
 =over 4
@@ -64,11 +77,18 @@ shall not be run:
 
 init(options => { "mode=s" => \$dh{MODE}});
 
+my @directories;
 my $find_options='! -ipath "./debian/*" -a ';
 if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
     $find_options .= "! \\( $dh{EXCLUDE_FIND} \\) -a";
 }
 
+if (-e "debian/autoreconf") {
+    @directories=filearray("debian/autoreconf", ".");
+    $find_options = join(" ",@directories)." ".$find_options;
+}
+
+
 my %modes = (
     'md5' => "find $find_options -type f -exec md5sum {} \\;",
     'timesize' => "find $find_options -type f -printf \"%s|%T@  %p\n\""
@@ -80,7 +100,7 @@ my $find = $modes{$dh{MODE} || "md5"} ||
 complex_doit("$find > debian/autoreconf.before");
 
 # Run autoreconf to recreate the needed files.
-...@argv ? doit(@ARGV) : doit('autoreconf', '-f', '-i');
+...@argv ? doit(@ARGV) : doit('autoreconf', '-f', '-i', @directories);
 
 complex_doit("$find > debian/autoreconf.after");
 
-- 
1.7.1

Reply via email to