[tlbuild] linked scripts when script names only differ by their extensions

Karl Berry karl at freefriends.org
Tue Mar 19 22:45:42 CET 2024


    unlike in BSD where the two are distinct.  

I was afraid of that. Sorry for not checking in advance.

    > "grep -E" should solve this issue.

Unfortunately grep -E creates other problems. As far as I know, there
are ancient greps still in wide use (Solaris 10) which don't support
-E. (Although Solaris 10 also has /usr/xpg4/bin/grep which supports -E,
/usr/bin/grep doesn't, and configuring which one to use is just as
problematic as anything else.) Because of that, plus GNU grep's
painfully strict changes in recent releases, it is no longer possibly to
easily use grep -E/egrep functionality portably (i.e., without a
configure test of some kind), as far as I've been able to figure out.

Instead, I made the change below to split up the test (r70706).

    Besides, why \. after memoize-.* ?

I felt that the reasons these were special cases was because of the
extension, so I wanted to put the literal . into the pattern. Maybe
someday there will be a memoize-somethingelse without a dot. Pedantic I
admit ... -k

--- Makefile.am	(revision 70703)
+++ Makefile.am	(working copy)
@@ -326,7 +326,9 @@ else !WIN32
 	cd $(DESTDIR)$(bindir) && \
 	  for s in $(nobase_dist_texmf_scripts_SCRIPTS); do \
 	    target=`basename $$s | tr '[A-Z]' '[a-z]'`; \
-	    echo "$$s" | grep 'listings-ext.sh\|memoize-.*\.' >/dev/null \
+## we can't use egrep or grep -E or ere patterns portably.
+	    echo "$$s" | grep 'memoize-.*\.' >/dev/null \
+	    || echo "$$s" | grep 'listings-ext.sh' >/dev/null \
 	    || target=`echo $$target | sed 's,\.[^/]*$$,,'`; \
 	    rm -f $$target; \
 	    echo "creating link '$$target' -> '$$REL/texmf-dist/scripts/$$s'"; \
@@ -362,7 +364,8 @@ endif WIN32
 uninstall-hook:
 	@for s in $(nobase_dist_texmf_scripts_SCRIPTS); do \
 	  target=`basename $$s | tr '[A-Z]' '[a-z]'`; \
-	  echo "$$s" | grep 'listings-ext.sh\|memoize-.*\.' >/dev/null \
+	  echo "$$s" | grep 'memoize-.*\.' >/dev/null \
+	  || echo "$$s" | grep 'listings-ext.sh' >/dev/null \
 	  || target=`echo $$target | sed 's,\.[^/]*$$,,'`; \
 	  rm -f $(DESTDIR)$(bindir)/$$target$(WINEXT); \
 	done


More information about the tlbuild mailing list.