Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Nov 2006 20:43:45 +0900 (JST)
From:      NIIMI Satoshi <sa2c@sa2c.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/105813: devel/mercurial: hgmerge does not work
Message-ID:  <20061124114345.E333240E4@berkeley.l.sa2c.net>
Resent-Message-ID: <200611241150.kAOBo5DS043773@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         105813
>Category:       ports
>Synopsis:       devel/mercurial: hgmerge does not work
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 24 11:50:04 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     NIIMI Satoshi
>Release:        FreeBSD 6.1-RELEASE-p10 i386
>Organization:
>Environment:
System: FreeBSD berkeley.l.sa2c.net 6.1-RELEASE-p10 FreeBSD 6.1-RELEASE-p10 #17: Sun Oct 1 13:00:54 JST 2006 root@berkeley.l.sa2c.net:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:

Unlike bash and ksh, FreeBSD's /bin/sh behaves:

| % sh -c 'type /nonexistent; echo $?'
| /nonexistent: No such file or directory
| 0

Because of above, testing "/Developer/.../FileMerge" and
"/usr/bin/test" always succeeds and they are used unconditionally.

	
>How-To-Repeat:
Run "hg merge" with clean ~/.hgrc and HGMERGE environment variable.
	
>Fix:

	

--- mercurial.diff begins here ---
--- devel/mercurial/Makefile	Thu Nov 23 16:44:43 2006 +0000
+++ devel/mercurial/Makefile	Fri Nov 24 05:55:36 2006 +0900
@@ -7,6 +7,7 @@
 
 PORTNAME=	mercurial
 PORTVERSION=	0.9.1
+PORTREVISION=	1
 CATEGORIES=	devel python
 MASTER_SITES=	http://www.selenic.com/mercurial/release/
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ devel/mercurial/files/patch-hgmerge	Fri Nov 24 05:48:06 2006 +0900
@@ -0,0 +1,63 @@
+--- hgmerge	Tue Nov 21 23:08:29 2006 -0200
++++ hgmerge	Fri Nov 24 05:27:38 2006 +0900
+@@ -20,6 +20,18 @@ if [ -z "$EDITOR" ]; then
+ if [ -z "$EDITOR" ]; then
+     EDITOR="vi"
+ fi
++
++isexecutable ()
++{
++    case "$1" in
++        */*)
++            [ -x "$1" ] && return 0 || return 1
++            ;;
++        *)
++            type "$1" >/dev/null 2>&1 && return 0 || return 1
++            ;;
++    esac
++}
+ 
+ # find decent versions of our utilities, insisting on the GNU versions where we
+ # need to
+@@ -28,13 +40,13 @@ DIFF="gdiff"
+ DIFF="gdiff"
+ PATCH="gpatch"
+ 
+-type "$MERGE" >/dev/null 2>&1 || MERGE=
+-type "$DIFF3" >/dev/null 2>&1 || DIFF3="diff3"
++isexecutable "$MERGE" || MERGE=
++isexecutable "$DIFF3" || DIFF3="diff3"
+ $DIFF3 --version >/dev/null 2>&1 || DIFF3=
+-type "$DIFF"  >/dev/null 2>&1 || DIFF="diff"
+-type "$DIFF"  >/dev/null 2>&1 || DIFF=
+-type "$PATCH" >/dev/null 2>&1 || PATCH="patch"
+-type "$PATCH" >/dev/null 2>&1 || PATCH=
++isexecutable "$DIFF"  || DIFF="diff"
++isexecutable "$DIFF"  || DIFF=
++isexecutable "$PATCH" || PATCH="patch"
++isexecutable "$PATCH" || PATCH=
+ 
+ # find optional visual utilities
+ FILEMERGE="/Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge"
+@@ -42,15 +54,15 @@ TKDIFF="tkdiff"
+ TKDIFF="tkdiff"
+ MELD="meld"
+ 
+-type "$FILEMERGE" >/dev/null 2>&1 || FILEMERGE=
+-type "$KDIFF3"    >/dev/null 2>&1 || KDIFF3=
+-type "$TKDIFF"    >/dev/null 2>&1 || TKDIFF=
+-type "$MELD"      >/dev/null 2>&1 || MELD=
++isexecutable "$FILEMERGE" || FILEMERGE=
++isexecutable "$KDIFF3"    || KDIFF3=
++isexecutable "$TKDIFF"    || TKDIFF=
++isexecutable "$MELD"      || MELD=
+ 
+ # Hack for Solaris
+ TEST="/usr/bin/test"
+-type "$TEST" >/dev/null 2>&1 || TEST="/bin/test"
+-type "$TEST" >/dev/null 2>&1 || TEST="test"
++isexecutable "$TEST" || TEST="/bin/test"
++isexecutable "$TEST" || TEST="test"
+ 
+ # random part of names
+ RAND="$RANDOM$RANDOM"
--- mercurial.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061124114345.E333240E4>