{"thread":{"id":"1269","subject":"[PATCH 1/6] cogito: remove use of xargs -r, a non-portable GNU extension","startedAt":"2005-07-18T02:50:30Z","lastAt":"2005-07-20T09:19:34Z","messageCount":8,"participants":["Bryan Larsen","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"6228","messageId":"20050718025024.11198.10556.sendpatchset@bryan-larsens-ibook-g4.local","threadId":"1269","inReplyTo":null,"subject":"[PATCH 0/6] cogito: compatibility with OS X","fromName":"Bryan Larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-18T02:50:30Z","receivedAt":"2005-07-18T02:50:30Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"This is a resend of my previous set of patches.\n\nI have updated these patches with Junio's suggestion.\n\nI have also added some documentation, a simple README.osx.\n\nOnce you have applied these patches, could you choose one of these 4\noptions, Junio?\n\n1) send me the result of \"make Portfile\" on next release\n2) attach the result of \"make Portfile\" to\nhttp://bugzilla.opendarwin.org/show_bug.cgi?id=3949 on next release\n3) upload Portfile's along with the .tar.gz's.\n4) tell me you're doing none of the above's, and I'll do the process\nmanually.\n\n2 of these 5 patches are unchanged from the previous post.  I have\nattached them anyways to maintain the series.  Please let me know if\nthis is poor etiquette.\n\nthanks,\nBryan\n"},{"id":"6227","messageId":"20050718025036.11198.93735.sendpatchset@bryan-larsens-ibook-g4.local","threadId":"1269","inReplyTo":"20050718025024.11198.10556.sendpatchset@bryan-larsens-ibook-g4.local","subject":"[PATCH 1/6] cogito: remove use of xargs -r, a non-portable GNU extension","fromName":"Bryan Larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-18T02:50:42Z","receivedAt":"2005-07-18T02:50:42Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"Remove usage of xargs -r, a non-portable gnu extension.  \n\nSigned-off-by: Bryan Larsen <bryan.larsen@gmail.com>\n---\n\n cg-add  |    6 +++---\n cg-init |    2 +-\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/cg-add b/cg-add\n--- a/cg-add\n+++ b/cg-add\n@@ -25,8 +25,6 @@ USAGE=\"cg-add [-N] FILE...\"\n \n . ${COGITO_LIB}cg-Xlib\n \n-[ \"$1\" ] || usage\n-\n infoonly=\n while optparse; do\n \tif optparse -N; then\n@@ -36,6 +34,8 @@ while optparse; do\n \tfi\n done\n \n+[ \"$ARGS\" ] || usage\n+\n TMPFILE=$(mktemp -t gitadd.XXXXXX) || exit 1\n find \"${ARGS[@]}\" -type f -print0 > $TMPFILE || {\n \tdie \"not all files exist, nothing added\"\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 -0 git-update-cache --add ${infoonly} --\n \n rm $TMPFILE\ndiff --git a/cg-init b/cg-init\n--- a/cg-init\n+++ b/cg-init\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+\t[ `ls` ] && find * \\( -type f -o -type l \\) -print0 | xargs -0 cg-add ${infoonly}\n \tcg-commit -C -m\"Initial commit\" -E ${infoonly}\n fi\n \n"},{"id":"6229","messageId":"20050718025046.11198.10078.sendpatchset@bryan-larsens-ibook-g4.local","threadId":"1269","inReplyTo":"20050718025024.11198.10556.sendpatchset@bryan-larsens-ibook-g4.local","subject":"[PATCH 2/6] cogito: remove use of cp -a, a non-portable GNU extension","fromName":"Bryan Larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-18T02:50:51Z","receivedAt":"2005-07-18T02:50:51Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"Remove usage of cp -a, a non-portable gnu extension.\n\nSigned-off-by: Bryan Larsen <bryan.larsen@gmail.com>\n---\n\n cg-pull |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/cg-pull b/cg-pull\n--- a/cg-pull\n+++ b/cg-pull\n@@ -217,7 +217,7 @@ fetch_local () {\n \t[ \"$1\" = \"-i\" ] && shift\n \t[ \"$1\" = \"-s\" ] && shift\n \n-\tcp_flags_l=\"-va\"\n+\tcp_flags_l=\"-vdpR\"\n \tif [ \"$1\" = \"-u\" ]; then\n \t\tcp_flags_l=\"$cp_flags_l -u$can_hardlink\"\n \t\tsuggest_hardlink=\n"},{"id":"6230","messageId":"20050718025057.11198.96144.sendpatchset@bryan-larsens-ibook-g4.local","threadId":"1269","inReplyTo":"20050718025024.11198.10556.sendpatchset@bryan-larsens-ibook-g4.local","subject":"[PATCH 3/6] cogito: try harder to find gnu stat","fromName":"Bryan Larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-18T02:51:02Z","receivedAt":"2005-07-18T02:51:02Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"Look harder for gnu stat.\n\nCogito has code to use awk if gnu stat is missing.  Look harder \nfor gnu stat under alternate names such as gstat and gnustat, avoiding\nthe use of awk if possible.\n\nSigned-off-by: Bryan Larsen <bryan.larsen@gmail.com>\n---\n\n cg-Xlib |   13 +++++++++----\n 1 files changed, 9 insertions(+), 4 deletions(-)\n\ndiff --git a/cg-Xlib b/cg-Xlib\n--- a/cg-Xlib\n+++ b/cg-Xlib\n@@ -229,11 +229,16 @@ fi\n \n \n # Compatibility hacks:\n-# Fortunately none as of now.\n-\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_stat\" ] && $has_stat -c %s / 2>/dev/null >&2 || has_stat=\n+\n+has_stat=\n+for stat in \"$(which gnustat)\" \"$(which gstat)\" \"$(which stat)\" ; do\n+    if ( [ $stat ] && $stat -c %s / 2> /dev/null >&2 ) ; then\n+\thas_stat=$stat\n+\tbreak\n+    fi\n+done\n+\n has_gnudate=$(date -Rud \"1970-01-01 UTC\" 2>/dev/null)\n"},{"id":"6231","messageId":"20050718025107.11198.93279.sendpatchset@bryan-larsens-ibook-g4.local","threadId":"1269","inReplyTo":"20050718025024.11198.10556.sendpatchset@bryan-larsens-ibook-g4.local","subject":"[PATCH 4/6] cogito: try harder to find gnu date","fromName":"Bryan Larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-18T02:51:14Z","receivedAt":"2005-07-18T02:51:14Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"Look harder for gnu date, use if available.\n\nSigned-off-by: Bryan Larsen <bryan.larsen@gmail.com>\n---\n\n cg-Xlib |   12 ++++++++++--\n 1 files changed, 10 insertions(+), 2 deletions(-)\n\ndiff --git a/cg-Xlib b/cg-Xlib\n--- a/cg-Xlib\n+++ b/cg-Xlib\n@@ -70,7 +70,7 @@ 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 ${has_gnudate} -ud \"1970-01-01 UTC + $secs sec\" \"$format\"\n \telse\n \t\tLANG=C date -u -r $secs \"$format\"\n \tfi\n@@ -241,4 +241,12 @@ for stat in \"$(which gnustat)\" \"$(which \n     fi\n done\n \n-has_gnudate=$(date -Rud \"1970-01-01 UTC\" 2>/dev/null)\n+has_gnudate=\n+for date in \"$(which gnudate)\" \"$(which gdate)\" \"$(which date)\" ; do\n+    if ( [ $date ] && $date -Rud  \"1970-01-01 UTC\" 2> /dev/null >&2 ) ; then\n+\thas_gnudate=$date\n+\tbreak\n+    fi\n+done\n+\n+\n"},{"id":"6233","messageId":"20050718025119.11198.75892.sendpatchset@bryan-larsens-ibook-g4.local","threadId":"1269","inReplyTo":"20050718025024.11198.10556.sendpatchset@bryan-larsens-ibook-g4.local","subject":"[PATCH 5/6] cogito: remove findutils dependency from Portfile","fromName":"Bryan Larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-18T02:51:25Z","receivedAt":"2005-07-18T02:51:25Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"Gnu findutils (xargs) is no longer required; remove the dependency.  \nGnu coreutils is still required, but only if awk is not installed.\n\nSigned-off-by: Bryan Larsen <bryan.larsen@gmail.com>\n---\n\n Portfile.in |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Portfile.in b/Portfile.in\n--- a/Portfile.in\n+++ b/Portfile.in\n@@ -14,8 +14,8 @@ long_description  The git core, develope\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+depends_lib       bin:gstat:coreutils\n+depends_lib\t  lib:libz.dylib:zlib\n build.type        gnu\n destroot.type     gnu\n destroot.destdir  prefix=${prefix} DESTDIR=${destroot}\n"},{"id":"6232","messageId":"20050718025130.11198.34570.sendpatchset@bryan-larsens-ibook-g4.local","threadId":"1269","inReplyTo":"20050718025024.11198.10556.sendpatchset@bryan-larsens-ibook-g4.local","subject":"[PATCH 6/6] cogito: update documentation","fromName":"Bryan Larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-18T02:51:36Z","receivedAt":"2005-07-18T02:51:36Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"Update the documentation to add a README.osx and update requirements.\n\nSigned-off-by: Bryan Larsen <bryan.larsen@gmail.com>\n---\n\n README     |    2 ++\n README.osx |   31 +++++++++++++++++++++++++++++++\n 2 files changed, 33 insertions(+), 0 deletions(-)\n\ndiff --git a/README b/README\n--- a/README\n+++ b/README\n@@ -45,6 +45,8 @@ The following tools are optional but str\n \n \tlibcrypto (OpenSSL)\n \trsync\n+\tgnu coreutils (the gnu versions of stat, date and cp are\n+\t           preferred over the BSD variants)\n \n \n         Starting a Fresh GIT Repository\ndiff --git a/README.osx b/README.osx\nnew file mode 100644\n--- /dev/null\n+++ b/README.osx\n@@ -0,0 +1,31 @@\n+This version of Cogito should work on OS X and other BSD variants.\n+\n+To install on OS X:\n+\n+1) Install darwinports (http://darwinports.opendarwin.org/) 2) type\n+\"make Portfile\" 3) type \"sudo port install\"\n+\n+You may have to deal with md5 mismatches.  Either adjust the md5sum in\n+your new Portfile or place the new tarball in\n+/opt/local/var/db/dports/distfiles/cogito.\n+\n+Caveats:\n+\n+cg-pull on a local repository requires cp -u, a non-portable gnu\n+extension.  This means that cg-pull, cg-clone and cg-update from a\n+local repository are broken.\n+\n+Workaround #1: Use rsync for local clones.  I.e.  \"cg-clone\n+rsync://localhost/dir\" instead of \"cg-clone dir\".  This loses the disk\n+space savings of normally gained by cg-clone.\n+\n+Workaround #2: Use gnu cp.  \"cd /opt/local/bin; sudo ln -s gcp cp\".\n+\n+Recommendations:\n+\n+The gnu versions of \"stat\" and \"date\" are preferred over their BSD\n+variants.\n+\n+\"patch\", \"diff\", \"merge\", \"curl\" and \"rysnc\" are required.  OS X.4\n+includes recent versions of these tools.  If you are not running X.4,\n+you may wish to check this.\n"},{"id":"6276","messageId":"20050720091933.GG27102@pasky.ji.cz","threadId":"1269","inReplyTo":"20050718025024.11198.10556.sendpatchset@bryan-larsens-ibook-g4.local","subject":"Re: [PATCH 0/6] cogito: compatibility with OS X","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-07-20T09:19:34Z","receivedAt":"2005-07-20T09:19:34Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Mon, Jul 18, 2005 at 04:50:31AM CEST, I got a letter\nwhere Bryan Larsen <bryanlarsen@yahoo.com> told me that...\n> 3) upload Portfile's along with the .tar.gz's.\n\nThat's what we do with cogito.spec as well and it's fine. Just send me\nan appropriate patch for the dist target.\n\n> 2 of these 5 patches are unchanged from the previous post.  I have\n> attached them anyways to maintain the series.  Please let me know if\n> this is poor etiquette.\n\nI think it's fine. :-)\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nIf you want the holes in your knowledge showing up try teaching\nsomeone.  -- Alan Cox\n"}]}