{"thread":{"id":"1199","subject":"[PATCH 1/6] git-gnu-progs: parameterize git","startedAt":"2005-07-11T10:14:25Z","lastAt":"2005-07-12T09:03:59Z","messageCount":18,"participants":["Bryan Larsen","Linus Torvalds","Junio C Hamano","Matthias Urlichs"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"5941","messageId":"20050711101417.10318.64006.sendpatchset@bryan-larsens-ibook-g4.local","threadId":"1199","inReplyTo":null,"subject":"[PATCH 0/6] parameterize gnu tool names; add Portfile for OS X darwinports","fromName":"Bryan Larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-11T10:14:25Z","receivedAt":"2005-07-11T10:14:25Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"Cogito and git rely on the gnu version of 4 standard utilities:  cp,\ndate, stat and xargs.  On most non-Linux based Unix's, the gnu tools\nare optional installs, and are installed under different names.\n\nThese patches parameterize the names of these 4 tools, determine what\nname should be used, and verify that the tools work.  The final patch in\nthe series creates a Portfile that can be used with OS X's\ndarwinports.\n\nIn this series, patches 3 and 5 conflict:  patch 3 is for the git\nMakefile, and patch 5 is for the cogito Makefile.\n\nPatches 1-3 should be applied to git.\nPatches 1,2,4,5,6 should be applied to cogito.\n"},{"id":"5940","messageId":"20050711101428.10318.90621.sendpatchset@bryan-larsens-ibook-g4.local","threadId":"1199","inReplyTo":"20050711101417.10318.64006.sendpatchset@bryan-larsens-ibook-g4.local","subject":"[PATCH 1/6] git-gnu-progs: parameterize git","fromName":"Bryan Larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-11T10:14:38Z","receivedAt":"2005-07-11T10:14:38Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"Patch git so that the utilities 'cp' 'stat' 'xargs' and 'date' are configurable.  Git requires the gnu versions of these tools, and on some BSD derived systems, the gnu versions of these tools have a different name.\n\nSigned-off-by: Bryan Larsen <bryan.larsen@gmail.com>\n---\n\n git-clone-script |    4 +++-\n git-prune-script |    4 +++-\n 2 files changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/git-clone-script b/git-clone-script\n--- a/git-clone-script\n+++ b/git-clone-script\n@@ -5,6 +5,8 @@\n # \n # Clone a repository into a different directory that does not yet exist.\n \n+CP=cp\n+\n usage() {\n \techo >&2 \"* git clone [-l] <repo> <dir>\"\n \texit 1\n@@ -68,7 +70,7 @@ yes,yes)\n \t\tl=l\n \tfi &&\n \trm -f \"$D/.git/objects/sample\" &&\n-\tcp -r$l \"$repo/objects\" \"$D/.git/\" || exit 1\n+\t${CP} -r$l \"$repo/objects\" \"$D/.git/\" || exit 1\n \n \t# Make a duplicate of refs and HEAD pointer\n \tHEAD=\ndiff --git a/git-prune-script b/git-prune-script\n--- a/git-prune-script\n+++ b/git-prune-script\n@@ -1,5 +1,7 @@\n #!/bin/sh\n \n+XARGS=xargs\n+\n . git-sh-setup-script || die \"Not a git archive\"\n \n dryrun=\n@@ -20,6 +22,6 @@ sed -ne '/unreachable /{\n     s|\\(..\\)|\\1/|p\n }' | {\n \tcd \"$GIT_OBJECT_DIRECTORY\" || exit\n-\txargs -r $dryrun rm -f\n+\t${XARGS} -r $dryrun rm -f\n }\n \n"},{"id":"5943","messageId":"20050711101443.10318.71126.sendpatchset@bryan-larsens-ibook-g4.local","threadId":"1199","inReplyTo":"20050711101417.10318.64006.sendpatchset@bryan-larsens-ibook-g4.local","subject":"[PATCH 2/6] config-sh: find and verify utils","fromName":"Bryan Larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-11T10:14:49Z","receivedAt":"2005-07-11T10:14:49Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"Add config.sh which searches for gnu versions of 'cp' 'stat' 'date' and 'xargs'.\n\nSigned-off-by: Bryan Larsen <bryan.larsen@gmail.com>\n---\n\n config.sh |   65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 65 insertions(+), 0 deletions(-)\n\ndiff --git a/config.sh b/config.sh\nnew file mode 100755\n--- /dev/null\n+++ b/config.sh\n@@ -0,0 +1,65 @@\n+#!/bin/sh\n+#\n+# Search for gnu utils.\n+# Copyright (c) Bryan Larsen, 2005\n+#\n+# cogito and git-*-script rely on gnu versions of\n+# cp, date, xargs and stat.  Look for them and\n+# ensure they're gnu.\n+#\n+\n+set -e\n+\n+if which gdate > /dev/null ; then \n+    DATE=gdate ;\n+else \n+    DATE=date ; \n+fi ;\n+\n+# you don't actually have to have gnu date, it just works better.\n+\n+if which gcp > /dev/null ; then \n+    CP=gcp ; \n+else \n+    CP=cp ; \n+fi ;\n+\n+if $CP -a config.sh cp-test-dummy ; then \n+    rm cp-test-dummy ;\n+else \n+    echo 'You must have gnu cp installed'; \n+    exit 1; \n+fi ;\n+\n+if which gnuxargs > /dev/null ; then \n+    XARGS=gnuxargs ; \n+else \n+    XARGS=xargs ; \n+fi ;\n+\n+if ! ( echo | $XARGS -r ) ; then \n+    echo 'You must have gnu xargs installed'; \n+    exit 1; \n+fi ;\n+\n+if which gstat > /dev/null ; then\n+    STAT=gstat ;\n+else\n+    STAT=stat ;\n+fi ;\n+\n+if ! ($STAT -c '%s' config.sh > /dev/null ) ; then\n+    if which awk > /dev/null ; then\n+\tSTAT=dont_have_stat ;\n+    else\n+\techo 'You must have awk or gnu stat installed.';\n+\texit 1;\n+    fi\n+fi ;\n+\n+echo CP=$CP > config\n+echo XARGS=$XARGS >> config\n+echo DATE=$DATE >> config\n+echo STAT=$STAT >> config\n+\n+set +e\n"},{"id":"5942","messageId":"20050711101454.10318.70399.sendpatchset@bryan-larsens-ibook-g4.local","threadId":"1199","inReplyTo":"20050711101417.10318.64006.sendpatchset@bryan-larsens-ibook-g4.local","subject":"[PATCH 3/6] git-gnu-progs-Makefile: git Makefile update","fromName":"Bryan Larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-11T10:15:02Z","receivedAt":"2005-07-11T10:15:02Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"Update the git Makefile to put the results of config.sh into the scripts.  \nconfig.sh searches for gnu utilities cp, stat, date and xargs.\n\nSigned-off-by: Bryan Larsen <bryan.larsen@gmail.com>\n---\n\n Makefile |   13 +++++++++++--\n 1 files changed, 11 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\n--- a/Makefile\n+++ b/Makefile\n@@ -51,9 +51,18 @@ PROG=   git-update-cache git-diff-files \n \n all: $(PROG)\n \n-install: $(PROG) $(SCRIPTS)\n+config: config.sh\n+\t./config.sh\n+\n+install: $(PROG) $(SCRIPTS) config\n \t$(INSTALL) -m755 -d $(dest)$(bin)\n \t$(INSTALL) $(PROG) $(SCRIPTS) $(dest)$(bin)\n+\t. ./config ; \\\n+\tcd $(dest)$(bin) ; \\\n+\tfor file in $(SCRIPTS); do \\\n+\t\tsed -e \"s/DATE\\=date/DATE=$${DATE}/\" -e \"s/CP\\=cp/CP=$${CP}/\" -e \"s/XARGS\\=xargs/XARGS=$${XARGS}/\" -e \"s/STAT\\=stat/STAT=$${STAT}/\" $$file > $$file.new; \\\n+\t\tcat $$file.new > $$file; rm $$file.new; \\\n+\tdone\n \n LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o \\\n \t tag.o date.o index.o diff-delta.o patch-delta.o entry.o path.o \\\n@@ -190,7 +199,7 @@ test: all\n \t$(MAKE) -C t/ all\n \n clean:\n-\trm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(LIB_FILE)\n+\trm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(LIB_FILE) config\n \t$(MAKE) -C Documentation/ clean\n \n backup: clean\n"},{"id":"5944","messageId":"20050711101507.10318.54730.sendpatchset@bryan-larsens-ibook-g4.local","threadId":"1199","inReplyTo":"20050711101417.10318.64006.sendpatchset@bryan-larsens-ibook-g4.local","subject":"[PATCH 4/6] cogito-gnu-progs: parameterize cogito","fromName":"Bryan Larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-11T10:15:12Z","receivedAt":"2005-07-11T10:15:12Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"Patch cogito so that the utilities 'cp' 'stat' 'xargs' and 'date' are configurable.  Cogito requires the gnu versions of these tools, and on some BSD derived systems, the gnu versions of these tools have a different name.\n\nSigned-off-by: Bryan Larsen <bryan.larsen@gmail.com>\n---\n\n cg-Xlib    |   15 ++++++++++-----\n cg-Xnormid |    2 +-\n cg-add     |    2 +-\n cg-commit  |    4 ++--\n cg-diff    |    4 ++--\n cg-init    |    4 ++--\n cg-patch   |    2 +-\n cg-pull    |    2 +-\n 8 files changed, 20 insertions(+), 15 deletions(-)\n\ndiff --git a/cg-Xlib b/cg-Xlib\n--- a/cg-Xlib\n+++ b/cg-Xlib\n@@ -6,6 +6,11 @@\n # This file provides a library containing common code shared with all the\n # Cogito programs.\n \n+DATE=date\n+CP=cp\n+XARGS=xargs\n+STAT=stat\n+\n _cg_cmd=${0##*/}\n \n _git=${GIT_DIR:-.git}\n@@ -70,9 +75,9 @@ showdate () {\n \tsecs=$(($secs + $tzhours * 3600 + $tzmins * 60))\n \t[ \"$format\" ] || format=\"+%a, %d %b %Y %H:%M:%S $2\"\n \tif [ \"$has_gnudate\" ]; then\n-\t\tLANG=C date -ud \"1970-01-01 UTC + $secs sec\" \"$format\"\n+\t\tLANG=C ${DATE} -ud \"1970-01-01 UTC + $secs sec\" \"$format\"\n \telse\n-\t\tLANG=C date -u -r $secs \"$format\"\n+\t\tLANG=C ${DATE} -u -r $secs \"$format\"\n \tfi\n }\n \n@@ -104,7 +109,7 @@ tree_timewarp () {\n \t[ \"$no_head_update\" ] || echo \"$branch\" > $_git/HEAD\n \n \t# Kill gone files\n-\tgit-diff-tree -z -r $base $branch | xargs -0 bash -c '\n+\tgit-diff-tree -z -r $base $branch | ${XARGS} -0 bash -c '\n \t\twhile [ \"$1\" ]; do\n \t\t\theader=\"$1\"; shift\n \t\t\tfile=\"$1\"; shift\n@@ -234,5 +239,5 @@ fi\n \n export BROKEN_MKTEMP=1\n del=$($(which mktemp) -t 2>/dev/null) && { rm $del; export BROKEN_MKTEMP=; }\n-has_stat=$(which stat 2>/dev/null)\n-has_gnudate=$(date -Rud \"1970-01-01 UTC\" 2>/dev/null)\n+has_stat=$(which ${STAT} 2>/dev/null)\n+has_gnudate=$(${DATE} -Rud \"1970-01-01 UTC\" 2>/dev/null)\ndiff --git a/cg-Xnormid b/cg-Xnormid\n--- a/cg-Xnormid\n+++ b/cg-Xnormid\n@@ -50,7 +50,7 @@ fi\n \n valid=; [ ${#id} -eq 40 ] && [ \"$(git-rev-parse --revs-only \"$id\")\" ] && valid=1\n if ([ \"$id\" ] && [ \"$id\" != \" \" ]) && [ ! \"$valid\" ]; then\n-\treqsecs=$(date --date=\"$id\" +'%s' 2>/dev/null)\n+\treqsecs=$(${DATE} --date=\"$id\" +'%s' 2>/dev/null)\n \n \tif [ \"$reqsecs\" ]; then\n \t\tid=$(git-rev-list --min-age=$reqsecs --max-count=1 HEAD)\ndiff --git a/cg-add b/cg-add\n--- a/cg-add\n+++ b/cg-add\n@@ -43,6 +43,6 @@ find \"${ARGS[@]}\" -type f -print0 > $TMP\n }\n \n cat $TMPFILE | tr '\\0' '\\n' | sed 's/^/Adding file /'\n-cat $TMPFILE | xargs -0r git-update-cache --add ${infoonly} --\n+cat $TMPFILE | ${XARGS} -0r git-update-cache --add ${infoonly} --\n \n rm $TMPFILE\ndiff --git a/cg-commit b/cg-commit\n--- a/cg-commit\n+++ b/cg-commit\n@@ -168,7 +168,7 @@ written=\n if [ \"$merging\" ]; then\n \techo -n 'Merge with ' >>$LOGMSG\n \t[ \"$msgs\" ] && echo -n 'Merge with '\n-\t[ -s $_git/merging-sym ] || cp $_git/merging $_git/merging-sym\n+\t[ -s $_git/merging-sym ] || ${CP} $_git/merging $_git/merging-sym\n \tfor sym in $(cat $_git/merging-sym); do\n \t\turi=$(cat $_git/branches/$sym)\n \t\t[ \"$uri\" ] || uri=\"$sym\"\n@@ -229,7 +229,7 @@ fi\n echo \"CG: -----------------------------------------------------------------------\" >>$LOGMSG\n echo \"CG: vim: textwidth=75\" >>$LOGMSG\n \n-cp $LOGMSG $LOGMSG2\n+${CP} $LOGMSG $LOGMSG2\n if tty -s; then\n \tif ! [ \"$msgs\" ] || [ \"$forceeditor\" ]; then\n \t\t${EDITOR:-vi} $LOGMSG2\ndiff --git a/cg-diff b/cg-diff\n--- a/cg-diff\n+++ b/cg-diff\n@@ -155,7 +155,7 @@ if [ \"$id2\" = \" \" ]; then\n \t# FIXME: Update ret based on what did we match. And take \"$@\"\n \t# to account after all.\n \tret=\n-\tcat $filter | xargs git-diff-cache -r -p $tree | colorize | pager\n+\tcat $filter | ${XARGS} git-diff-cache -r -p $tree | colorize | pager\n \n \trm $filter\n \n@@ -169,7 +169,7 @@ id2=$(tree-id \"$id2\") || exit 1\n \n [ \"$id1\" = \"$id2\" ] && die \"trying to diff $id1 against itself\"\n \n-cat $filter | xargs git-diff-tree -r -p $id1 $id2 | colorize | pager\n+cat $filter | ${XARGS} git-diff-tree -r -p $id1 $id2 | colorize | pager\n \n rm $filter\n exit 0\ndiff --git a/cg-init b/cg-init\n--- a/cg-init\n+++ b/cg-init\n@@ -47,7 +47,7 @@ if [ \"$uri\" ]; then\n \techo \"$uri\" >$_git/branches/origin\n \tcg-pull origin || die \"pull failed\"\n \n-\tcp $_git/refs/heads/origin $_git/refs/heads/master\n+\t${CP} $_git/refs/heads/origin $_git/refs/heads/master\n \tgit-read-tree HEAD\n \tgit-checkout-cache -a\n \tgit-update-cache --refresh\n@@ -55,7 +55,7 @@ if [ \"$uri\" ]; then\n \techo \"Cloned (origin $uri available as branch \\\"origin\\\")\"\n else\n \tgit-read-tree # Seed the dircache\n-\tfind * \\( -type f -o -type l \\) -print0 | xargs -0r cg-add ${infoonly}\n+\tfind * \\( -type f -o -type l \\) -print0 | ${XARGS} -0r cg-add ${infoonly}\n \tcg-commit -C -m\"Initial commit\" -E ${infoonly}\n fi\n \ndiff --git a/cg-patch b/cg-patch\n--- a/cg-patch\n+++ b/cg-patch\n@@ -129,7 +129,7 @@ wait\n touchfiles=\"$(git-ls-files --deleted | join -v 2 $gonefile -)\"\n [ \"$touchfiles\" ] && touch $touchfiles\n \n-cat $todo | xargs -0 bash -c '\n+cat $todo | ${XARGS} -0 bash -c '\n while [ \"$1\" ]; do\n \top=\"$1\"; shift;\n \tcase \"$op\" in\ndiff --git a/cg-pull b/cg-pull\n--- a/cg-pull\n+++ b/cg-pull\n@@ -233,7 +233,7 @@ fetch_local () {\n \tdest=\"$2\"\n \t[ \"$cut_last\" ] && dest=${dest%/*}\n \n-\tcp $cp_flags_l \"$src\" \"$dest\"\n+\t${CP} $cp_flags_l \"$src\" \"$dest\"\n }\n \n pull_local () {\n"},{"id":"5946","messageId":"20050711101517.10318.5359.sendpatchset@bryan-larsens-ibook-g4.local","threadId":"1199","inReplyTo":"20050711101417.10318.64006.sendpatchset@bryan-larsens-ibook-g4.local","subject":"[PATCH 5/6] cogito-gnu-progs-Makefile: cogito Makefile update","fromName":"Bryan Larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-11T10:15:25Z","receivedAt":"2005-07-11T10:15:25Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"Update the cogito Makefile to put the results of config.sh into the scripts.  config.sh searches for gnu utilities cp, stat, date and xargs.\n\nSigned-off-by: Bryan Larsen <bryan.larsen@gmail.com>\n---\n\n Makefile |   18 ++++++++++++++----\n 1 files changed, 14 insertions(+), 4 deletions(-)\n\ndiff --git a/Makefile b/Makefile\n--- a/Makefile\n+++ b/Makefile\n@@ -195,11 +195,20 @@ sedlibdir=$(shell echo $(libdir) | sed '\n .PHONY: install install-git install-cogito\n install: install-git install-cogito\n \n-install-git: $(PROG) $(SCRIPTS)\n+config: config.sh\n+\t./config.sh\n+\n+install-git: $(PROG) $(SCRIPTS) config\n \t$(INSTALL) -m755 -d $(DESTDIR)$(bindir)\n \t$(INSTALL) $(PROG) $(SCRIPTS) $(DESTDIR)$(bindir)\n+\t. ./config ; \\\n+\tcd $(DESTDIR)$(bindir) ;\\\n+\tfor file in $(SCRIPTS); do \\\n+\t\tsed -e \"s/DATE\\=date/DATE=$${DATE}/\" -e \"s/CP\\=cp/CP=$${CP}/\" -e \"s/XARGS\\=xargs/XARGS=$${XARGS}/\" -e \"s/STAT\\=stat/STAT=$${STAT}/\" $$file > $$file.new; \\\n+\t\tcat $$file.new > $$file; rm $$file.new; \\\n+\tdone\n \n-install-cogito: $(SCRIPT) $(LIB_SCRIPT) $(GEN_SCRIPT)\n+install-cogito: $(SCRIPT) $(LIB_SCRIPT) $(GEN_SCRIPT) config\n \t$(INSTALL) -m755 -d $(DESTDIR)$(bindir)\n \t$(INSTALL) $(SCRIPT) $(GEN_SCRIPT) $(DESTDIR)$(bindir)\n \trm -f $(DESTDIR)$(bindir)/cg-cancel\n@@ -211,9 +220,10 @@ install-cogito: $(SCRIPT) $(LIB_SCRIPT) \n \t\tsed -e 's/\\$${COGITO_LIB}/\\$${COGITO_LIB:-$(sedlibdir)\\/}/g' $$file > $$file.new; \\\n \t\tcat $$file.new > $$file; rm $$file.new; \\\n \tdone\n+\t. ./config ; \\\n \tcd $(DESTDIR)$(libdir); \\\n \tfor file in $(LIB_SCRIPT); do \\\n-\t\tsed -e 's/\\$${COGITO_LIB}/\\$${COGITO_LIB:-$(sedlibdir)\\/}/g' $$file > $$file.new; \\\n+\t\tsed -e 's/\\$${COGITO_LIB}/\\$${COGITO_LIB:-$(sedlibdir)\\/}/g' -e \"s/DATE\\=date/DATE=$${DATE}/\" -e \"s/CP\\=cp/CP=$${CP}/\" -e \"s/XARGS\\=xargs/XARGS=$${XARGS}/\" -e \"s/STAT\\=stat/STAT=$${STAT}/\" $$file > $$file.new; \\\n \t\tcat $$file.new > $$file; rm $$file.new; \\\n \tdone\n \n@@ -232,7 +242,7 @@ dist: cogito.spec\n \tgzip -9 $(tarname).tar\n \n clean:\n-\trm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(GEN_SCRIPT) $(LIB_FILE)\n+\trm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(GEN_SCRIPT) $(LIB_FILE) config\n \t$(MAKE) -C Documentation/ clean\n \n backup: clean\n"},{"id":"5945","messageId":"20050711101530.10318.21470.sendpatchset@bryan-larsens-ibook-g4.local","threadId":"1199","inReplyTo":"20050711101417.10318.64006.sendpatchset@bryan-larsens-ibook-g4.local","subject":"[PATCH 6/6] darwinports-Portfile: Portfile for cogito","fromName":"Bryan Larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-11T10:15:39Z","receivedAt":"2005-07-11T10:15:39Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"A Portfile for darwinports.\n\nSigned-off-by: Bryan Larsen <bryan.larsen@gmail.com>\n---\n\n Makefile    |    2 ++\n Portfile.in |   25 +++++++++++++++++++++++++\n 2 files changed, 27 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\n--- a/Makefile\n+++ b/Makefile\n@@ -240,6 +240,8 @@ dist: cogito.spec\n \t@rm $(tarname)/cogito.spec\n \t@rmdir $(tarname)\n \tgzip -9 $(tarname).tar\n+\tsed -e 's/@@VERSION@@/$(shell cat $(VERSION) | cut -d\"-\" -f2)/g' < Portfile.in > Portfile\n+\techo \"checksums md5 \" `md5sum $(tarname).tar.gz | cut -d ' ' -f 1` >> Portfile\n \n clean:\n \trm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(GEN_SCRIPT) $(LIB_FILE) config\ndiff --git a/Portfile.in b/Portfile.in\nnew file mode 100644\n--- /dev/null\n+++ b/Portfile.in\n@@ -0,0 +1,25 @@\n+# $Id: $\n+PortSystem        1.0\n+name              cogito\n+version           @@VERSION@@\n+categories        devel\n+maintainers       bryan.larsen@gmail.com\n+description       Git core + cogito tools to provide a full distributed SCM.\n+long_description  The git core, developed by Linus Torvalds provides \\\n+\t\t  an extremely fast and flexible filesystem-based \\\n+\t\t  database designed to store directory trees with \\\n+\t\t  regard to their history.  The cogito tools, \\\n+\t\t  developed by Petr Baudis, provide full distributed \\\n+\t\t  SCM (software change management) functionality.\n+homepage          http://kernel.org/pub/software/scm/cogito/\n+master_sites      http://kernel.org/pub/software/scm/cogito/\n+configure\t  {}\n+depends_lib       bin:gcp:coreutils\n+depends_lib       bin:gnuxargs:findutils\n+build.type        gnu\n+destroot.type     gnu\n+destroot.destdir  prefix=${prefix} DESTDIR=${destroot}\n+test.run          yes\n+test.cmd          make\n+test.target       test\n+test.dir          ${worksrcpath}\n"},{"id":"5959","messageId":"7vk6jxupxs.fsf@assigned-by-dhcp.cox.net","threadId":"1199","inReplyTo":"20050711101454.10318.70399.sendpatchset@bryan-larsens-ibook-g4.local","subject":"Re: [PATCH 3/6] git-gnu-progs-Makefile: git Makefile update","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-07-11T19:02:07Z","receivedAt":"2005-07-11T19:02:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bryan Larsen <bryanlarsen@yahoo.com> writes:\n\n> Update the git Makefile to put the results of config.sh into the scripts.  \n> config.sh searches for gnu utilities cp, stat, date and xargs.\n>\n> Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>\n\n> +install: $(PROG) $(SCRIPTS) config\n>  \t$(INSTALL) -m755 -d $(dest)$(bin)\n>  \t$(INSTALL) $(PROG) $(SCRIPTS) $(dest)$(bin)\n> +\t. ./config ; \\\n> +\tcd $(dest)$(bin) ; \\\n> +\tfor file in $(SCRIPTS); do \\\n> +\t\tsed -e \"s/DATE\\=date/DATE=$${DATE}/\" -e \"s/CP\\=cp/CP=$${CP}/\" -e \"s/XARGS\\=xargs/XARGS=$${XARGS}/\" -e \"s/STAT\\=stat/STAT=$${STAT}/\" $$file > $$file.new; \\\n> +\t\tcat $$file.new > $$file; rm $$file.new; \\\n> +\tdone\n\nI am not yet convinced \"one variable per GNU program\" is the\nright way to do (I do agree it is a problem and I appreciate\nyour trying to solving it; an obvious alternative cop-out would\nbe to fix this in the user's environment, but there might be a\nsaner solution).  Assuming that this is the way to go, wouldn't\nit be saner if this sed munging is done in only one place, say\ngit-sh-setup-script, and have everybody include that?  If we\nwant to have some scripts usable not at the top-level GIT\ndirectory, then git-sh-setup-script may not be a good place; in\nwhich case introduce git-sh-compat-script and have everybody\ninclude _that_ instead?\n"},{"id":"5957","messageId":"Pine.LNX.4.58.0507111206240.17536@g5.osdl.org","threadId":"1199","inReplyTo":"7vk6jxupxs.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 3/6] git-gnu-progs-Makefile: git Makefile update","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-07-11T19:10:55Z","receivedAt":"2005-07-11T19:10:55Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 11 Jul 2005, Junio C Hamano wrote:\n> \n> I am not yet convinced \"one variable per GNU program\" is the\n> right way to do (I do agree it is a problem and I appreciate\n> your trying to solving it; an obvious alternative cop-out would\n> be to fix this in the user's environment, but there might be a\n> saner solution)\n\nYes. As you say, if we do this (and I think it's so ugly that I'm not\nconvinced we want to), it should be done in git-sh-setup-script _once_\ninstead of editing every single script.\n\nMost everything includes git-sh-setup-script anyway by now.\n\nHowever, what are the features that break the default apple tools anyway? \nMaybe we should avoid using them? OSX clearly comes with \"cp\" and \"xargs\" \nregardless, what are the flags that don't work with their cruddy versions?\n\n[ Rant mode on: ..and who the hell is the idiot at Apple who includes the\n  old crappy BSD stuff? They already use gcc, so it's totally pointless to\n  have a NIH thing, when the GNU utilities are just _better_. Maybe \n  somebody can ask Apple to get with the program and not live in the dark \n  ages any more. ]\n\n\t\t\tLinus\n"},{"id":"5958","messageId":"42D2C6BD.4050107@yahoo.com","threadId":"1199","inReplyTo":"7vk6jxupxs.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 3/6] git-gnu-progs-Makefile: git Makefile update","fromName":"Bryan Larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-11T19:21:33Z","receivedAt":"2005-07-11T19:21:33Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"Junio C Hamano wrote:\n> Bryan Larsen <bryanlarsen@yahoo.com> writes:\n>>+\tfor file in $(SCRIPTS); do \\\n>>+\t\tsed -e \"s/DATE\\=date/DATE=$${DATE}/\" -e \"s/CP\\=cp/CP=$${CP}/\" -e \"s/XARGS\\=xargs/XARGS=$${XARGS}/\" -e \"s/STAT\\=stat/STAT=$${STAT}/\" $$file > $$file.new; \\\n>>+\t\tcat $$file.new > $$file; rm $$file.new; \\\n>>+\tdone\n> \n> \n> I am not yet convinced \"one variable per GNU program\" is the\n> right way to do \n\nMy first thought was to have some type of \"prefix\" argument that could \neither be \"g\" or \"\".  But xargs is called \"gnuxargs\" instead of \n\"gxargs\".  I'm not sure where that braindamage comes from, but I have to \ndeal with it.\n\nTo me, one variable per program makes sense: we do it in Makefiles all \nthe time $(CC), $(LD), et cetera.\n\n > (I do agree it is a problem and I appreciate\n> your trying to solving it; an obvious alternative cop-out would\n> be to fix this in the user's environment, but there might be a\n> saner solution). \n\nIf we can move the solution into the Portfile somehow, it probably \nwouldn't bother me.\n\n> Assuming that this is the way to go, wouldn't\n> it be saner if this sed munging is done in only one place, say\n> git-sh-setup-script, and have everybody include that?  If we\n> want to have some scripts usable not at the top-level GIT\n> directory, then git-sh-setup-script may not be a good place; in\n> which case introduce git-sh-compat-script and have everybody\n> include _that_ instead?\n> \n\nThat's the way it's done in cogito:  it's in cg-Xlib and nowhere else. \nThis isn't obvious from the Makefile: perhaps I should have made it so.\n\nI was very tempted to put it in git-sh-setup-script, but realized that \nwas inappropriate.  Introducing a gid-sh-compat-script seems more sane.\n\nBryan\n"},{"id":"5961","messageId":"42D2CBA2.8060705@yahoo.com","threadId":"1199","inReplyTo":"Pine.LNX.4.58.0507111206240.17536@g5.osdl.org","subject":"Re: [PATCH 3/6] git-gnu-progs-Makefile: git Makefile update","fromName":"Bryan Larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-11T19:42:26Z","receivedAt":"2005-07-11T19:42:26Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"Linus Torvalds wrote:\n> \n> On Mon, 11 Jul 2005, Junio C Hamano wrote:\n> \n>>I am not yet convinced \"one variable per GNU program\" is the\n>>right way to do (I do agree it is a problem and I appreciate\n>>your trying to solving it; an obvious alternative cop-out would\n>>be to fix this in the user's environment, but there might be a\n>>saner solution)\n> \n> \n> Yes. As you say, if we do this (and I think it's so ugly that I'm not\n> convinced we want to), it should be done in git-sh-setup-script _once_\n> instead of editing every single script.\n\nAgreed: I was much happier with my cogito implementation where I just \nput it in cg-Xlib.  Is git-sh-setup-script appropriate?  At first glance \nit had a specific purpose and was not included in a large number of files.\n\n> \n> Most everything includes git-sh-setup-script anyway by now.\n> \n> However, what are the features that break the default apple tools anyway? \n> Maybe we should avoid using them? OSX clearly comes with \"cp\" and \"xargs\" \n> regardless, what are the flags that don't work with their cruddy versions?\n\nxargs -r, cp -l, cp -u, cp -a.  Git uses the first 2, cogito uses all 4.\n\nLast night, I couldn't think of alternatives to these, but I obviously \ndidn't try very hard.  xargs -r can probably happen via a temporary file \nand cp -u can probably be simulated using rsync.\n\n> \n> [ Rant mode on: ..and who the hell is the idiot at Apple who includes the\n>   old crappy BSD stuff? They already use gcc, so it's totally pointless to\n>   have a NIH thing, when the GNU utilities are just _better_. Maybe \n>   somebody can ask Apple to get with the program and not live in the dark \n>   ages any more. ]\n> \n\nIt wasn't long ago that the BSD's and Solaris had the same problems.  If \nonly Apple is in the dark ages, shame on them.\n\nBryan\n"},{"id":"5985","messageId":"Pine.LNX.4.58.0507111252380.17536@g5.osdl.org","threadId":"1199","inReplyTo":"42D2CBA2.8060705@yahoo.com","subject":"Re: [PATCH 3/6] git-gnu-progs-Makefile: git Makefile update","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-07-11T20:00:34Z","receivedAt":"2005-07-11T20:00:34Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 11 Jul 2005, Bryan Larsen wrote:\n> \n> > \n> > Most everything includes git-sh-setup-script anyway by now.\n> > \n> > However, what are the features that break the default apple tools anyway? \n> > Maybe we should avoid using them? OSX clearly comes with \"cp\" and \"xargs\" \n> > regardless, what are the flags that don't work with their cruddy versions?\n> \n> xargs -r, cp -l, cp -u, cp -a.  Git uses the first 2, cogito uses all 4.\n\nI think we can replace \"xargs -r\" with just plain \"xargs\". It results in \nan empty \"rm -f\", but hey, that's ok. If some broken \"rm\" complains about \nthat (GNU rm doesn't), you can always do\n\n\tfind .. | xargs rm -f dummy-file.o\n\nwhich makes sure that we have a dummy argument even for an empty list..\n\n> Last night, I couldn't think of alternatives to these, but I obviously \n> didn't try very hard.  xargs -r can probably happen via a temporary file \n> and cp -u can probably be simulated using rsync.\n\nI don't see a good alternative for \"cp -l\".\n\nI also don't see why, if OS-X already _does_ include the GNU tools, they \ncouldn't be under /opt/fsf/bin or something like that, and then you could \njust do\n\n\tPATH=/opt/fsf/bin:$PATH\n\nand be done with it.\n\nGrumble.\n\n\t\tLinus\n"},{"id":"5983","messageId":"7virzhrtfy.fsf@assigned-by-dhcp.cox.net","threadId":"1199","inReplyTo":"42D2CBA2.8060705@yahoo.com","subject":"Re: [PATCH 3/6] git-gnu-progs-Makefile: git Makefile update","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-07-11T20:14:41Z","receivedAt":"2005-07-11T20:14:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bryan Larsen <bryanlarsen@yahoo.com> writes:\n\n> Last night, I couldn't think of alternatives to these, but I obviously\n> didn't try very hard.  xargs -r can probably happen via a temporary\n> file and cp -u can probably be simulated using rsync.\n\nThe only user of \"xargs -r\" in the Linus GIT is git-prune-script\nwhich tries not to run \"rm -f\" with an empty argument list, like\nthis:\n\n    git-fsck-cache --cache --unreachable \"$@\" |\n    sed -ne '/unreachable /{\n        s/unreachable [^ ][^ ]* //\n        s|\\(..\\)|\\1/|p\n    }' | {\n            cd \"$GIT_OBJECT_DIRECTORY\" || exit\n            xargs -r $dryrun rm -f\n    }\n\nNot tested on a BSD, and it is probably as ugly as it can get,\nbut we could:\n\n    {\n        echo 'unreachable nosuch/file';\n        git-fsck-cache --cache --unreachable \"$@\" \n    } |\n    sed -ne '/unreachable /{\n        s/unreachable [^ ][^ ]* //\n        s|\\(..\\)|\\1/|p\n    }' | {\n            cd \"$GIT_OBJECT_DIRECTORY\" || exit\n            xargs $dryrun rm -f\n    }\n\nThe only user of \"cp -l\" in the Linus GIT is git-clone-script\nlocal optimization.  I could revert it to the version that I\noriginally sent to the list, which uses cpio -pld, if your cpio\ngroks that flag.\n\nI do not speak for Pasky, but to me \"cp -u\" sounds just like an\noptimization, so maybe defining CP_U='cp -u' and detect missing\nsupport at config time and falling back on the simple \"cp\" would\nbe an option?\n\nGNU \"cp -a\" states that is the same as \"-dpR\" (never follow\nsymlinks, preserve link, mode, ownership, and timestamps), so\nthat can be rewritten as a shell function in cg-Xlib that is\ncalled say cg_copy_tree, whose implementation runs two tar\nprocesses piped together when \"cp -a\" is not available.  Using a\ntarpipe unconditionally is also fine.\n"},{"id":"5982","messageId":"42D2D4F0.4050203@gmail.com","threadId":"1199","inReplyTo":"7virzhrtfy.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 3/6] git-gnu-progs-Makefile: git Makefile update","fromName":"Bryan Larsen","fromEmail":"bryan.larsen@gmail.com","sentAt":"2005-07-11T20:22:08Z","receivedAt":"2005-07-11T20:22:08Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"> \n> The only user of \"cp -l\" in the Linus GIT is git-clone-script\n> local optimization.  I could revert it to the version that I\n> originally sent to the list, which uses cpio -pld, if your cpio\n> groks that flag.\n\nThose options are in the man page, at least.\n\nBryan\n"},{"id":"5964","messageId":"7vy88dqe4h.fsf@assigned-by-dhcp.cox.net","threadId":"1199","inReplyTo":"7virzhrtfy.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 3/6] git-gnu-progs-Makefile: git Makefile update","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-07-11T20:30:54Z","receivedAt":"2005-07-11T20:30:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> The only user of \"cp -l\" in the Linus GIT is git-clone-script\n> local optimization.  I could revert it to the version that I\n> originally sent to the list, which uses cpio -pld, if your cpio\n> groks that flag.\n\nBryan, does this work for you?\n\n------------\nTwo changes to git-clone-script local optimization.\n\n - When local optimization is used, the variable repo has\n   already been passed through get_repo_base so there is no need\n   to check for .git subdirectory in there.\n\n - Use cpio -l instead of \"cp -l\".\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\ndiff --git a/git-clone-script b/git-clone-script\n--- a/git-clone-script\n+++ b/git-clone-script\n@@ -48,11 +48,8 @@ test -d \"$D\" || usage\n case \"$local,$use_local\" in\n yes,yes)\n \t( cd \"$repo/objects\" ) || {\n-\t\trepo=\"$repo/.git\"\n-\t\t( cd \"$repo/objects\" ) || {\n-\t\t    echo >&2 \"-l flag seen but $repo is not local.\"\n-\t\t    exit 1\n-\t\t}\n+\t\techo >&2 \"-l flag seen but $repo is not local.\"\n+\t\texit 1\n \t}\n \n \t# See if we can hardlink and drop \"l\" if not.\n@@ -68,7 +65,9 @@ yes,yes)\n \t\tl=l\n \tfi &&\n \trm -f \"$D/.git/objects/sample\" &&\n-\tcp -r$l \"$repo/objects\" \"$D/.git/\" || exit 1\n+\tcd \"$repo\" &&\n+\tfind objects -type f -print |\n+\tcpio -puamd$l \"$D/.git/\" || exit 1\n \n \t# Make a duplicate of refs and HEAD pointer\n \tHEAD=\n"},{"id":"5966","messageId":"42D2E47E.8060602@yahoo.com","threadId":"1199","inReplyTo":"7vy88dqe4h.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 3/6] git-gnu-progs-Makefile: git Makefile update","fromName":"Bryan Larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-11T21:28:30Z","receivedAt":"2005-07-11T21:28:30Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"Junio C Hamano wrote:\n> Junio C Hamano <junkio@cox.net> writes:\n> \n> \n>>The only user of \"cp -l\" in the Linus GIT is git-clone-script\n>>local optimization.  I could revert it to the version that I\n>>originally sent to the list, which uses cpio -pld, if your cpio\n>>groks that flag.\n> \n> \n> Bryan, does this work for you?\n> \n\nYes, it appears to work fine.\n\nFor the record, \"${XARGS} -0r\" may be uglier than \"xargs -0r\", but \nreplacing it with several lines of shell magic is a loss.  OTOH shell \nmagic can be wrapped up into nice little functions.  Certainly I'll \nappreciate being able to remove my coreutils and findutils dependency, \nbut I think that assuming the user has gnu tools available somewhere is \na reasonable assumption for tools of this type.\n\nThe tradeoff might be different for git and cogito.  Cogito uses shell \nscripts more heavily and requires bash instead of Bourne.  Certainly \nyou've demonstrated that git can be made portable relatively cleanly.  I \ndoubt cogito will fall as easily.\n\nBut if you prefer to go this route, I'm happy with it.\n\nBryan\n"},{"id":"5970","messageId":"7vmzotovfl.fsf@assigned-by-dhcp.cox.net","threadId":"1199","inReplyTo":"42D2E47E.8060602@yahoo.com","subject":"Re: [PATCH 3/6] git-gnu-progs-Makefile: git Makefile update","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-07-11T21:59:58Z","receivedAt":"2005-07-11T21:59:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bryan Larsen <bryanlarsen@yahoo.com> writes:\n\n> For the record, \"${XARGS} -0r\" may be uglier than \"xargs -0r\", but\n> replacing it with several lines of shell magic is a loss.\n\nOK, OK, the one I suggested for xargs was _U_G_L_Y_.\n\nThe one Linus suggested looks to me the cleanest.  That is, to\ngive an extra parameter upfront to the command run by xargs.  My\nfavorite trick is like this:\n\n  git-fsck-cache --cache --unreachable \"$@\" |\n  sed -ne '/unreachable /{\n      s/unreachable [^ ][^ ]* //\n      s|\\(..\\)|\\1/|p\n  }' | {\n          cd \"$GIT_OBJECT_DIRECTORY\" || exit\n-         xargs -r $dryrun rm -f\n+         xargs $dryrun rm -f \"\"\n  }\n\nDry-run would say: \n\n    rm -f  00/012345...\n    rm -f  01/234567...\n\nwithout visual distraction of having printable phoney names, or\njust (with an invisible trailing space):\n\n    rm -f  \n\nDuring a real run, \"rm -f\" would not complain \"cannot remove `':\nIs a directory\", either.\n"},{"id":"6028","messageId":"pan.2005.07.12.09.03.59.181984@smurf.noris.de","threadId":"1199","inReplyTo":"Pine.LNX.4.58.0507111252380.17536@g5.osdl.org","subject":"Re: [PATCH 3/6] git-gnu-progs-Makefile: git Makefile update","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-07-12T09:03:59Z","receivedAt":"2005-07-12T09:03:59Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi, Linus Torvalds wrote:\n\n> I also don't see why, if OS-X already _does_ include the GNU tools, they \n> couldn't be under /opt/fsf/bin or something like that, and then you could \n> just do\n> \n> \tPATH=/opt/fsf/bin:$PATH\n\nWe could prepend /usr/lib/git to $PATH, and symlink them with their \"real\"\nnames there.\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nGo directly to jail.  Do not pass Go, do not collect $200.\n"}]}