git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] cogito: compatibility with OS X
@ 2005-07-18  2:50 Bryan Larsen
  2005-07-18  2:50 ` [PATCH 1/6] cogito: remove use of xargs -r, a non-portable GNU extension Bryan Larsen
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Bryan Larsen @ 2005-07-18  2:50 UTC (permalink / raw)
  To: bryan.larsen; +Cc: Bryan Larsen, pasky, git

This is a resend of my previous set of patches.

I have updated these patches with Junio's suggestion.

I have also added some documentation, a simple README.osx.

Once you have applied these patches, could you choose one of these 4
options, Junio?

1) send me the result of "make Portfile" on next release
2) attach the result of "make Portfile" to
http://bugzilla.opendarwin.org/show_bug.cgi?id=3949 on next release
3) upload Portfile's along with the .tar.gz's.
4) tell me you're doing none of the above's, and I'll do the process
manually.

2 of these 5 patches are unchanged from the previous post.  I have
attached them anyways to maintain the series.  Please let me know if
this is poor etiquette.

thanks,
Bryan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/6] cogito: remove use of xargs -r, a non-portable GNU extension
  2005-07-18  2:50 [PATCH 0/6] cogito: compatibility with OS X Bryan Larsen
@ 2005-07-18  2:50 ` Bryan Larsen
  2005-07-18  2:50 ` [PATCH 2/6] cogito: remove use of cp -a, " Bryan Larsen
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Bryan Larsen @ 2005-07-18  2:50 UTC (permalink / raw)
  To: bryan.larsen; +Cc: Bryan Larsen, pasky, git

Remove usage of xargs -r, a non-portable gnu extension.  

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
---

 cg-add  |    6 +++---
 cg-init |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/cg-add b/cg-add
--- a/cg-add
+++ b/cg-add
@@ -25,8 +25,6 @@ USAGE="cg-add [-N] FILE..."
 
 . ${COGITO_LIB}cg-Xlib
 
-[ "$1" ] || usage
-
 infoonly=
 while optparse; do
 	if optparse -N; then
@@ -36,6 +34,8 @@ while optparse; do
 	fi
 done
 
+[ "$ARGS" ] || usage
+
 TMPFILE=$(mktemp -t gitadd.XXXXXX) || exit 1
 find "${ARGS[@]}" -type f -print0 > $TMPFILE || {
 	die "not all files exist, nothing added"
@@ -43,6 +43,6 @@ find "${ARGS[@]}" -type f -print0 > $TMP
 }
 
 cat $TMPFILE | tr '\0' '\n' | sed 's/^/Adding file /'
-cat $TMPFILE | xargs -0r git-update-cache --add ${infoonly} --
+cat $TMPFILE | xargs -0 git-update-cache --add ${infoonly} --
 
 rm $TMPFILE
diff --git a/cg-init b/cg-init
--- a/cg-init
+++ b/cg-init
@@ -55,7 +55,7 @@ if [ "$uri" ]; then
 	echo "Cloned (origin $uri available as branch \"origin\")"
 else
 	git-read-tree # Seed the dircache
-	find * \( -type f -o -type l \) -print0 | xargs -0r cg-add ${infoonly}
+	[ `ls` ] && find * \( -type f -o -type l \) -print0 | xargs -0 cg-add ${infoonly}
 	cg-commit -C -m"Initial commit" -E ${infoonly}
 fi
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/6] cogito: remove use of cp -a, a non-portable GNU extension
  2005-07-18  2:50 [PATCH 0/6] cogito: compatibility with OS X Bryan Larsen
  2005-07-18  2:50 ` [PATCH 1/6] cogito: remove use of xargs -r, a non-portable GNU extension Bryan Larsen
@ 2005-07-18  2:50 ` Bryan Larsen
  2005-07-18  2:51 ` [PATCH 3/6] cogito: try harder to find gnu stat Bryan Larsen
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Bryan Larsen @ 2005-07-18  2:50 UTC (permalink / raw)
  To: bryan.larsen; +Cc: Bryan Larsen, pasky, git

Remove usage of cp -a, a non-portable gnu extension.

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
---

 cg-pull |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cg-pull b/cg-pull
--- a/cg-pull
+++ b/cg-pull
@@ -217,7 +217,7 @@ fetch_local () {
 	[ "$1" = "-i" ] && shift
 	[ "$1" = "-s" ] && shift
 
-	cp_flags_l="-va"
+	cp_flags_l="-vdpR"
 	if [ "$1" = "-u" ]; then
 		cp_flags_l="$cp_flags_l -u$can_hardlink"
 		suggest_hardlink=

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 3/6] cogito: try harder to find gnu stat
  2005-07-18  2:50 [PATCH 0/6] cogito: compatibility with OS X Bryan Larsen
  2005-07-18  2:50 ` [PATCH 1/6] cogito: remove use of xargs -r, a non-portable GNU extension Bryan Larsen
  2005-07-18  2:50 ` [PATCH 2/6] cogito: remove use of cp -a, " Bryan Larsen
@ 2005-07-18  2:51 ` Bryan Larsen
  2005-07-18  2:51 ` [PATCH 4/6] cogito: try harder to find gnu date Bryan Larsen
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Bryan Larsen @ 2005-07-18  2:51 UTC (permalink / raw)
  To: bryan.larsen; +Cc: Bryan Larsen, pasky, git

Look harder for gnu stat.

Cogito has code to use awk if gnu stat is missing.  Look harder 
for gnu stat under alternate names such as gstat and gnustat, avoiding
the use of awk if possible.

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
---

 cg-Xlib |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/cg-Xlib b/cg-Xlib
--- a/cg-Xlib
+++ b/cg-Xlib
@@ -229,11 +229,16 @@ fi
 
 
 # Compatibility hacks:
-# Fortunately none as of now.
-
 
 export BROKEN_MKTEMP=1
 del=$($(which mktemp) -t 2>/dev/null) && { rm $del; export BROKEN_MKTEMP=; }
-has_stat=$(which stat 2>/dev/null)
-[ "$has_stat" ] && $has_stat -c %s / 2>/dev/null >&2 || has_stat=
+
+has_stat=
+for stat in "$(which gnustat)" "$(which gstat)" "$(which stat)" ; do
+    if ( [ $stat ] && $stat -c %s / 2> /dev/null >&2 ) ; then
+	has_stat=$stat
+	break
+    fi
+done
+
 has_gnudate=$(date -Rud "1970-01-01 UTC" 2>/dev/null)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 4/6] cogito: try harder to find gnu date
  2005-07-18  2:50 [PATCH 0/6] cogito: compatibility with OS X Bryan Larsen
                   ` (2 preceding siblings ...)
  2005-07-18  2:51 ` [PATCH 3/6] cogito: try harder to find gnu stat Bryan Larsen
@ 2005-07-18  2:51 ` Bryan Larsen
  2005-07-18  2:51 ` [PATCH 5/6] cogito: remove findutils dependency from Portfile Bryan Larsen
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Bryan Larsen @ 2005-07-18  2:51 UTC (permalink / raw)
  To: bryan.larsen; +Cc: Bryan Larsen, pasky, git

Look harder for gnu date, use if available.

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
---

 cg-Xlib |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/cg-Xlib b/cg-Xlib
--- a/cg-Xlib
+++ b/cg-Xlib
@@ -70,7 +70,7 @@ showdate () {
 	secs=$(($secs + $tzhours * 3600 + $tzmins * 60))
 	[ "$format" ] || format="+%a, %d %b %Y %H:%M:%S $2"
 	if [ "$has_gnudate" ]; then
-		LANG=C date -ud "1970-01-01 UTC + $secs sec" "$format"
+		LANG=C ${has_gnudate} -ud "1970-01-01 UTC + $secs sec" "$format"
 	else
 		LANG=C date -u -r $secs "$format"
 	fi
@@ -241,4 +241,12 @@ for stat in "$(which gnustat)" "$(which 
     fi
 done
 
-has_gnudate=$(date -Rud "1970-01-01 UTC" 2>/dev/null)
+has_gnudate=
+for date in "$(which gnudate)" "$(which gdate)" "$(which date)" ; do
+    if ( [ $date ] && $date -Rud  "1970-01-01 UTC" 2> /dev/null >&2 ) ; then
+	has_gnudate=$date
+	break
+    fi
+done
+
+

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 5/6] cogito: remove findutils dependency from Portfile
  2005-07-18  2:50 [PATCH 0/6] cogito: compatibility with OS X Bryan Larsen
                   ` (3 preceding siblings ...)
  2005-07-18  2:51 ` [PATCH 4/6] cogito: try harder to find gnu date Bryan Larsen
@ 2005-07-18  2:51 ` Bryan Larsen
  2005-07-18  2:51 ` [PATCH 6/6] cogito: update documentation Bryan Larsen
  2005-07-20  9:19 ` [PATCH 0/6] cogito: compatibility with OS X Petr Baudis
  6 siblings, 0 replies; 8+ messages in thread
From: Bryan Larsen @ 2005-07-18  2:51 UTC (permalink / raw)
  To: bryan.larsen; +Cc: Bryan Larsen, pasky, git

Gnu findutils (xargs) is no longer required; remove the dependency.  
Gnu coreutils is still required, but only if awk is not installed.

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
---

 Portfile.in |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Portfile.in b/Portfile.in
--- a/Portfile.in
+++ b/Portfile.in
@@ -14,8 +14,8 @@ long_description  The git core, develope
 homepage          http://kernel.org/pub/software/scm/cogito/
 master_sites      http://kernel.org/pub/software/scm/cogito/
 configure	  {}
-depends_lib       bin:gcp:coreutils
-depends_lib       bin:gnuxargs:findutils
+depends_lib       bin:gstat:coreutils
+depends_lib	  lib:libz.dylib:zlib
 build.type        gnu
 destroot.type     gnu
 destroot.destdir  prefix=${prefix} DESTDIR=${destroot}

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 6/6] cogito: update documentation
  2005-07-18  2:50 [PATCH 0/6] cogito: compatibility with OS X Bryan Larsen
                   ` (4 preceding siblings ...)
  2005-07-18  2:51 ` [PATCH 5/6] cogito: remove findutils dependency from Portfile Bryan Larsen
@ 2005-07-18  2:51 ` Bryan Larsen
  2005-07-20  9:19 ` [PATCH 0/6] cogito: compatibility with OS X Petr Baudis
  6 siblings, 0 replies; 8+ messages in thread
From: Bryan Larsen @ 2005-07-18  2:51 UTC (permalink / raw)
  To: bryan.larsen; +Cc: Bryan Larsen, pasky, git

Update the documentation to add a README.osx and update requirements.

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
---

 README     |    2 ++
 README.osx |   31 +++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/README b/README
--- a/README
+++ b/README
@@ -45,6 +45,8 @@ The following tools are optional but str
 
 	libcrypto (OpenSSL)
 	rsync
+	gnu coreutils (the gnu versions of stat, date and cp are
+	           preferred over the BSD variants)
 
 
         Starting a Fresh GIT Repository
diff --git a/README.osx b/README.osx
new file mode 100644
--- /dev/null
+++ b/README.osx
@@ -0,0 +1,31 @@
+This version of Cogito should work on OS X and other BSD variants.
+
+To install on OS X:
+
+1) Install darwinports (http://darwinports.opendarwin.org/) 2) type
+"make Portfile" 3) type "sudo port install"
+
+You may have to deal with md5 mismatches.  Either adjust the md5sum in
+your new Portfile or place the new tarball in
+/opt/local/var/db/dports/distfiles/cogito.
+
+Caveats:
+
+cg-pull on a local repository requires cp -u, a non-portable gnu
+extension.  This means that cg-pull, cg-clone and cg-update from a
+local repository are broken.
+
+Workaround #1: Use rsync for local clones.  I.e.  "cg-clone
+rsync://localhost/dir" instead of "cg-clone dir".  This loses the disk
+space savings of normally gained by cg-clone.
+
+Workaround #2: Use gnu cp.  "cd /opt/local/bin; sudo ln -s gcp cp".
+
+Recommendations:
+
+The gnu versions of "stat" and "date" are preferred over their BSD
+variants.
+
+"patch", "diff", "merge", "curl" and "rysnc" are required.  OS X.4
+includes recent versions of these tools.  If you are not running X.4,
+you may wish to check this.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/6] cogito: compatibility with OS X
  2005-07-18  2:50 [PATCH 0/6] cogito: compatibility with OS X Bryan Larsen
                   ` (5 preceding siblings ...)
  2005-07-18  2:51 ` [PATCH 6/6] cogito: update documentation Bryan Larsen
@ 2005-07-20  9:19 ` Petr Baudis
  6 siblings, 0 replies; 8+ messages in thread
From: Petr Baudis @ 2005-07-20  9:19 UTC (permalink / raw)
  To: Bryan Larsen; +Cc: bryan.larsen, git

Dear diary, on Mon, Jul 18, 2005 at 04:50:31AM CEST, I got a letter
where Bryan Larsen <bryanlarsen@yahoo.com> told me that...
> 3) upload Portfile's along with the .tar.gz's.

That's what we do with cogito.spec as well and it's fine. Just send me
an appropriate patch for the dist target.

> 2 of these 5 patches are unchanged from the previous post.  I have
> attached them anyways to maintain the series.  Please let me know if
> this is poor etiquette.

I think it's fine. :-)

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone.  -- Alan Cox

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-07-20  9:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-18  2:50 [PATCH 0/6] cogito: compatibility with OS X Bryan Larsen
2005-07-18  2:50 ` [PATCH 1/6] cogito: remove use of xargs -r, a non-portable GNU extension Bryan Larsen
2005-07-18  2:50 ` [PATCH 2/6] cogito: remove use of cp -a, " Bryan Larsen
2005-07-18  2:51 ` [PATCH 3/6] cogito: try harder to find gnu stat Bryan Larsen
2005-07-18  2:51 ` [PATCH 4/6] cogito: try harder to find gnu date Bryan Larsen
2005-07-18  2:51 ` [PATCH 5/6] cogito: remove findutils dependency from Portfile Bryan Larsen
2005-07-18  2:51 ` [PATCH 6/6] cogito: update documentation Bryan Larsen
2005-07-20  9:19 ` [PATCH 0/6] cogito: compatibility with OS X Petr Baudis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).