2003-07-23 Ralf Corsepius * lib/am/data.am: Rewrite for-loops to accept filenames with blanks. * lib/am/distdir.am: Rewrite for-loops to accept filenames with blanks. Quote filenames in ""-quotes to acceept filenames with blanks. Index: lib/am/data.am =================================================================== RCS file: /cvs/automake/automake/lib/am/data.am,v retrieving revision 1.39 diff -u -r1.39 data.am --- lib/am/data.am 8 Jul 2002 19:41:23 -0000 1.39 +++ lib/am/data.am 23 Jul 2003 16:19:28 -0000 @@ -31,7 +31,7 @@ $(mkinstalldirs) $(DESTDIR)$(%NDIR%dir) ## Funny invocation because Makefile variable can be empty, leading to ## a syntax error in sh. - @list='$(%DIR%_%PRIMARY%)'; for p in $$list; do \ + if test -n '$(%DIR%_%PRIMARY%)'; then for p in $(%DIR%_%PRIMARY%); do \ ## A file can be in the source directory or the build directory. if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ ## If the _%PRIMARY% variable has an entry like foo/bar, install it as @@ -40,8 +40,8 @@ ?BASE? f="`echo $$p | sed -e 's|^.*/||'`"; \ ?!BASE? f="$$p"; \ echo " $(%DIR%%PRIMARY%_INSTALL) $$d$$p $(DESTDIR)$(%NDIR%dir)/$$f"; \ - $(%DIR%%PRIMARY%_INSTALL) $$d$$p $(DESTDIR)$(%NDIR%dir)/$$f; \ - done + $(%DIR%%PRIMARY%_INSTALL) "$$d$$p" "$(DESTDIR)$(%NDIR%dir)/$$f"; \ + done; else true; fi endif %?INSTALL% @@ -53,12 +53,12 @@ .PHONY uninstall-am: uninstall-%DIR%%PRIMARY% uninstall-%DIR%%PRIMARY%: @$(NORMAL_UNINSTALL) - @list='$(%DIR%_%PRIMARY%)'; for p in $$list; do \ + if test -n '$(%DIR%_%PRIMARY%)'; then for p in $(%DIR%_%PRIMARY%); do \ ?BASE? f="`echo $$p | sed -e 's|^.*/||'`"; \ ?!BASE? f="$$p"; \ echo " rm -f $(DESTDIR)$(%NDIR%dir)/$$f"; \ - rm -f $(DESTDIR)$(%NDIR%dir)/$$f; \ - done + rm -f "$(DESTDIR)$(%NDIR%dir)/$$f"; \ + done; else true; fi endif %?INSTALL% Index: lib/am/distdir.am =================================================================== RCS file: /cvs/automake/automake/lib/am/distdir.am,v retrieving revision 1.40.2.5 diff -u -r1.40.2.5 distdir.am --- lib/am/distdir.am 15 Apr 2003 20:41:11 -0000 1.40.2.5 +++ lib/am/distdir.am 23 Jul 2003 16:19:30 -0000 @@ -64,7 +64,7 @@ ## @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ + if test -n '$(DISTFILES)'; then for file in $(DISTFILES); do \ ## ## Yet another hack to support SUN make. ## @@ -89,7 +89,7 @@ ## implies we are in a subdirectory (so `../bar' is within the package), ## hence `$srcdir' is something like `../../subdir'. ## - case $$file in \ + case "$$file" in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ ## Also rewrite $(top_srcdir) (which sometimes appears in DISTFILES, and can ## be absolute) by $(top_builddir) (which is always relative). $(srcdir) will @@ -102,7 +102,7 @@ ## version. Also check for directories in the build directory first, ## so one can ship generated directories. ## - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -f "$$file" || test -d "$$file"; then d=.; else d=$(srcdir); fi; \ ## ## Make the subdirectory for the file. This is going to make `dist' ## really crawl, but it seems like the only way to do it, given that @@ -121,7 +121,7 @@ ## symlink -- this can easily happen if "gettextize" was run on the ## distribution. ## - if test -d $$d/$$file; then \ + if test -d "$$d/$$file"; then \ ## Don't mention $$file in destination argument, since this fails if ## destination directory already exists. Also, use `-R' and not `-r'. ## `-r' is almost always incorrect. @@ -132,19 +132,19 @@ ## source files _and_ generated files. It is also important when the ## directory exists only in $(srcdir), because some vendor Make (such ## as Tru64) will magically create an empty directory in `.' - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + if test -d "$(srcdir)/$$file" && test $$d != $(srcdir); then \ + cp -pR "$(srcdir)/$$file" $(distdir)$$dir || exit 1; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -pR "$$d/$$file" $(distdir)$$dir || exit 1; \ else \ ## Test for file existence because sometimes a file gets included in ## DISTFILES twice. For example this happens when a single source ## file is used in building more than one program. - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p "$$d/$$file" "$(distdir)/$$file" \ || exit 1; \ fi; \ - done + done; else true; fi ## ## Test for directory existence here because previous automake ## invocation might have created some directories. Note that we @@ -155,7 +155,7 @@ ## us work correctly with an enclosing package. ## if %?SUBDIRS% - list='$(%DIST_SUBDIR_NAME%)'; for subdir in $$list; do \ + if test -n '$(%DIST_SUBDIR_NAME%)'; then for subdir in $(%DIST_SUBDIR_NAME%); do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ @@ -167,7 +167,7 @@ distdir) \ || exit 1; \ fi; \ - done + done; else true; fi endif %?SUBDIRS% ## ## We might have to perform some last second updates, such as updating