Subject: pkg/13988: pkgsrc/pkgtools/pkgdiff zoularis portability fixes (continued)
To: None <gnats-bugs@gnats.netbsd.org>
From: Stoned Elipot <Stoned.Elipot@script.jussieu.fr>
List: netbsd-bugs
Date: 09/17/2001 14:31:20
>Number:         13988
>Category:       pkg
>Synopsis:       pkgsrc/pkgtools/pkgdiff zoularis portability fixes (continued)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 17 05:32:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Stoned Elipot
>Release:        pkgsrc-current
>Organization:
SCRIPT, Paris VII University, France
>Environment:
System: SunOS deep-space-9 5.8 Generic_108528-07 sun4u sparc SUNW,Ultra-60
>Description:
pkgdiff command use `diff -u' which is a no-go with Solaris's diff.
Note: I should have included this in PR pkg/13877 and somehow I jammed
my diffs, sorry.
>How-To-Repeat:
Try to use pkgdiff on Solaris/Zoularis
>Fix:
Bring in dependency on ../../devel/diffutils on Solaris and substitue @DIFF@
in files/pkgdiff.

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkgdiff/Makefile,v
retrieving revision 1.16
diff -u -r1.16 Makefile
--- Makefile	2001/09/14 22:40:57	1.16
+++ Makefile	2001/09/17 11:17:21
@@ -24,10 +24,13 @@
 .include "../../mk/bsd.prefs.mk"
 
 .if ${OPSYS} == "SunOS"
+DEPENDS+=	diffutils-*:../../devel/diffutils
 BUILD_DEPENDS+=	groff-*:../../textproc/groff
 NROFF=		gnroff
+DIFF?=		gdiff
 .else
 NROFF=		nroff
+DIFF?=		diff
 .endif
 
 do-build:
@@ -37,7 +40,9 @@
 		< ${FILESDIR}/${FILE}.pl 		\
 		> ${WRKSRC}/${FILE}
 .endfor
-	${CP} ${FILESDIR}/pkgdiff ${WRKSRC}
+	${SED} -e 's|@DIFF@|${DIFF}|g'			\
+		< ${FILESDIR}/pkgdiff			\
+		> ${WRKSRC}/pkgdiff
 	${CP} ${FILESDIR}/pkgvi ${WRKSRC}
 .for FILE in mkpatches patchdiff pkgdiff pkgvi
 	${SED} -e 's|@PREFIX@|${PREFIX}|g'		\
Index: files/pkgdiff
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkgdiff/files/pkgdiff,v
retrieving revision 1.4
diff -u -r1.4 pkgdiff
--- pkgdiff	2000/08/26 04:40:28	1.4
+++ pkgdiff	2001/09/17 11:17:21
@@ -28,7 +28,7 @@
 fi
 
 lines=3
-while [ `diff -u -$lines "$old" "$new" | egrep -c '\\$(NetBSD|Author|Date|Header|Id|Locker|Log|Name|RCSfile|Revision|Source|State)'`  !=  0 ]
+while [ `@DIFF@ -u -$lines "$old" "$new" | egrep -c '\\$(NetBSD|Author|Date|Header|Id|Locker|Log|Name|RCSfile|Revision|Source|State)'`  !=  0 ]
 do
 	lines=`expr $lines - 1`
 	if [ $lines = 0 ]; then
@@ -37,11 +37,12 @@
 	fi
 done
 
-if ! diff -qu -$lines "$old" "$new" > /dev/null
-then
+if  @DIFF@ -qu -$lines "$old" "$new" > /dev/null ; then
+	:
+else
     echo '$'NetBSD'$'
     echo ''
     # Strip out the date on the +++ line to reduce needless
     # differences in regenerated patches
-    diff -u -$lines "$old" "$new" | sed -e 's:^\(+++ [^	]*\)	.*:\1:'
+    @DIFF@ -u -$lines "$old" "$new" | sed -e 's:^\(+++ [^	]*\)	.*:\1:'
 fi
>Release-Note:
>Audit-Trail:
>Unformatted: