[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Proposal: dirlist.d/ directory support

From: Robert Schiele
Subject: Proposal: dirlist.d/ directory support
Date: Wed, 23 Aug 2006 18:24:48 +0200
User-agent: Mutt/1.5.9i


I'd like to make the proposal to invent dirlist.d/ directory support into
aclocal.  Currently the macro search path can be modified by a user by adding
the repective path or a pattern that includes this path to the dirlist file
contained in ACDIR.  This is a very useful feature if you have some additional
software installed on your system you want to be considered on the search.  In
such a case the system administrator can easily add this path to the dirlist
file.  Unfortunately this is a bit problematic for package vendors if they
want to provide a package (.rpm, .deb, ...) that automatically adds a specific
directory to this search path.  Currently this package has to modify the
dirlist file by a script or leave it up to the installer of the package to do
this work manually.  If now a dirlist.d/ directory would exist that can
contain various scripts that are handled in the same way like the current
dirlist file, the package could just provide a file
ACDIR/dirlist.d/PACKAGENAME to extend the search path.  The user could still
make modifications to the dirlist file or create a private dirlist.d/* file
without conflicting with any automatic setting of a package.

Currently SUSE does use such a feature but due to the lack of this support in
aclocal they do create a dirlist file from all diles in the dirlist.d/
directory by a script.  This is quite an ugly solution in my opinion because
it silently overwrites all manual edits one does in the dirlist file.  I am
not aware whether other vendors use similar features.

The following patch does provide the feature as described above and I would
like to see it in future automake releases.  Comments, suggestions, questions,
or rants are always welcome.

RCS file: /cvs/automake/automake/,v
retrieving revision 1.139
diff -u -r1.139
---  4 Aug 2006 08:42:54 -0000       1.139
+++  23 Aug 2006 16:00:40 -0000
@@ -1001,22 +1001,26 @@
-      # Finally, adds any directory listed in the `dirlist' file.
-      if (open (DIRLIST, "$system_includes[0]/dirlist"))
-       {
-         while (<DIRLIST>)
+      # Finally, adds any directory listed in the `dirlist' file
+      # and `dirlist.d' directories.
+      foreach my $dirlistfile (<$system_includes[0]/dirlist{,.d/*}>)
+        {
+         if (open (DIRLIST, $dirlistfile))
-             # Ignore '#' lines.
-             next if /^#/;
-             # strip off newlines and end-of-line comments
-             s/\s*\#.*$//;
-             chomp;
-             foreach my $dir (glob)
+             while (<DIRLIST>)
-                 push (@system_includes, $dir) if -d $dir;
+                 # Ignore '#' lines.
+                 next if /^#/;
+                 # strip off newlines and end-of-line comments
+                 s/\s*\#.*$//;
+                 chomp;
+                 foreach my $dir (glob)
+                   {
+                     push (@system_includes, $dir) if -d $dir;
+                   }
+             close (DIRLIST);
-         close (DIRLIST);
Index: doc/automake.texi
RCS file: /cvs/automake/automake/doc/automake.texi,v
retrieving revision 1.149
diff -u -r1.149 automake.texi
--- doc/automake.texi   22 Aug 2006 10:04:52 -0000      1.149
+++ doc/automake.texi   23 Aug 2006 16:00:59 -0000
@@ -3206,6 +3206,14 @@
 list @emph{after} all other directories.  @file{dirlist} entries may
 use shell wildcards such as @samp{*}, @samp{?}, or @code{[...]}.
+All files contained in a @file{dirlist.d} directory in @var{acdir} are
+handled in the same way.  Putting pathes into various files within the
address@hidden directory instead of putting them directly into the
address@hidden file is especially useful for packagers that want to
+make their package to automatically customize the system
address@hidden when their package is installed without changing any
+user's config file.
 For example, suppose
 @address@hidden/dirlist} contains the following:


Robert Schiele                  Tel.: +49-621-181-2214
Dipl.-Wirtsch.informatiker      mailto:address@hidden

"Quidquid latine dictum sit, altum sonatur."

Attachment: pgpsiaNlZ3X1k.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]