{"thread":{"id":"3292","subject":"[PATCH 3/3] Use active CPIO, FIND, and XARGS to set built-in defaults.","startedAt":"2006-02-10T23:36:42Z","lastAt":"2006-02-10T23:36:42Z","messageCount":1,"participants":["Jason Riedy"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"15882","messageId":"1112.1139614602@lotus.CS.Berkeley.EDU","threadId":"3292","inReplyTo":null,"subject":"[PATCH 3/3] Use active CPIO, FIND, and XARGS to set built-in defaults.","fromName":"Jason Riedy","fromEmail":"ejr@eecs.berkeley.edu","sentAt":"2006-02-10T23:36:42Z","receivedAt":"2006-02-10T23:36:42Z","isPatch":true,"sender":{"key":"ejr@eecs.berkeley.edu","avatar":"https://gravatar.com/avatar/547fa56f887cab01599edab4e9f813c949c1269e02714f20e0496c56185d9837?d=mp&s=160"},"body":"Move the sed program in the % : %.sh pattern into the shellsedprog\nvariable.  Add clauses to change the CPIO, FIND, and XARGS built-in\ndefaults if those variables are set.  With appropriate settings, all\nthe current tests pass on Solaris 8 with my personal bizarre setup.\nI'll try on a modules-based AIX once the machine's back next week.\n\nI don't really like how I build the sed program, but I can't think of\nan easier / better way.\n\nSigned-off-by: Jason Riedy <ejr@cs.berkeley.edu>\n\n---\n\n Makefile |   16 +++++++++++++---\n 1 files changed, 13 insertions(+), 3 deletions(-)\n\ne512a44ccd488fec29af59e95b35741d4454b118\ndiff --git a/Makefile b/Makefile\nindex f240e45..edf785c 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -415,11 +415,21 @@ git$X: git.c $(LIB_FILE)\n \t$(CC) -DGIT_VERSION='\"$(GIT_VERSION)\"' \\\n \t\t$(CFLAGS) $(COMPAT_CFLAGS) -o $@ $(filter %.c,$^) $(LIB_FILE)\n \n+shellsedprog=-e '1s|\\#!.*/sh|\\#!$(call shq,$(SHELL_PATH))|;'\n+shellsedprog+= -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g;'\n+ifdef CPIO\n+\tshellsedprog+= -e 's@^: \\$${CPIO:=cpio}@: \\$${CPIO:=$(CPIO)}@;'\n+endif\n+ifdef FIND\n+\tshellsedprog+= -e 's@^: \\$${FIND:=find}@: \\$${FIND:=$(FIND)}@;'\n+endif\n+ifdef XARGS\n+\tshellsedprog+= -e 's@^: \\$${XARGS:=xargs}@: \\$${XARGS:=$(XARGS)}@;'\n+endif\n+\n $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh\n \trm -f $@\n-\tsed -e '1s|#!.*/sh|#!$(call shq,$(SHELL_PATH))|' \\\n-\t    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n-\t    $@.sh >$@\n+\tsed $(shellsedprog) $@.sh >$@\n \tchmod +x $@\n \n $(patsubst %.perl,%,$(SCRIPT_PERL)) : % : %.perl\n-- \n1.1.6.g0d39d\n"}]}