]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] dist: less use of transforms, prefer make variables (1)
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 11 Aug 2012 11:52:54 +0000 (13:52 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 11 Aug 2012 12:00:09 +0000 (14:00 +0200)
* automake.in (handle_dist): Turn the '%FILENAME_FILTER%' transform
into the 'am.dist.filename-filter' internal variable.
* lib/am/distdir.am (distdir): Adjust and simplify accordingly (and
improve an error message while at it).  In particular, this removed
the need for ...
(am.dist.skip-length-check): ... this variable.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
automake.in
lib/am/distdir.am

index bc2ece953d3c27938884cf0e7b83218b4039d0da..177b43f277223c0d2be35b0a5e5c1e328ce6446b 100644 (file)
@@ -3292,6 +3292,10 @@ sub handle_dist ()
                    $seen_gettext && !$seen_gettext_external ? 'yes' : '');
   define_variable ('am.dist.formats', INTERNAL, @archive_formats);
 
+  my $flm = option 'filename-length-max';
+  define_variable ('am.dist.filename-filter', INTERNAL,
+                   $flm ? ('.' x $flm->[1]) : '');
+
   # If the target 'dist-hook' exists, make sure it is run.  This
   # allows users to do random weird things to the distribution
   # before it is packaged up.
@@ -3299,13 +3303,9 @@ sub handle_dist ()
     if user_phony_rule 'dist-hook';
   $transform{'DIST-TARGETS'} = join (' ', @dist_targets);
 
-  my $flm = option ('filename-length-max');
-  my $filename_filter = $flm ? '.' x $flm->[1] : '';
-
   $output_rules .= &file_contents ('distdir',
                                   new Automake::Location,
                                   %transform,
-                                  FILENAME_FILTER => $filename_filter,
                                    'DIST-COMMON' => "@dist_common");
   verbatim ('distcheck') if $relative_dir eq '.';
 }
index b8cc67d962005fc879e4087f762ac8364f3a8038..cf1333b02b1b0c0e0e486c76e98c37671efefbb9 100644 (file)
@@ -247,10 +247,10 @@ if %?SUBDIRS%
 ## directory we have already cleared and might even have populated
 ## (e.g. shared AUX dir in the sub-package).
                am.dist.remove-distdir=: \
-## Disable filename length check:
-               am.dist.skip-length-check=: \
 ## No need to fix modes more than once:
                am.dist.skip-mode-fix=: \
+## Disable filename length check:
+               am.dist.filename-filter='' \
              || exit 1; \
          fi; \
        done
@@ -291,11 +291,10 @@ if %?TOPDIR_P%
          ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
          ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
        || chmod -R a+r "$(distdir)"
-if %?FILENAME_FILTER%
-       @if test -z "$(am.dist.skip-length-check)" && find "$(distdir)" -type f -print | \
-         grep '^%FILENAME_FILTER%' 1>&2; then \
-         echo 'error: the above filenames are too long' 1>&2; \
+       @$(if $(am.dist.filename-filter), \
+       if find "$(distdir)" -type f -print \
+           | grep '^$(am.dist.filename-filter)' 1>&2; then \
+         echo '$@: error: the above filenames are too long' 1>&2; \
          exit 1; \
-       else :; fi
-endif %?FILENAME_FILTER%
+       else :; fi)
 endif %?TOPDIR_P%