From 472ec7f457cbd02126fe03f6201088926d4dcd8f Mon Sep 17 00:00:00 2001 From: wiz Date: Sat, 1 Jul 2000 02:38:55 +0000 Subject: pkgdiff now only generates output at all if the files differ. mkpatches doesn't generate empty patches, and warns if name and name.orig don't differ. Bump version to 0.91. --- pkgtools/pkgdiff/Makefile | 4 ++-- pkgtools/pkgdiff/files/mkpatches.pl | 9 +++++++-- pkgtools/pkgdiff/files/pkgdiff | 18 +++++++++++++----- 3 files changed, 22 insertions(+), 9 deletions(-) (limited to 'pkgtools') diff --git a/pkgtools/pkgdiff/Makefile b/pkgtools/pkgdiff/Makefile index 6ec3b378c2c..1fb2077973e 100644 --- a/pkgtools/pkgdiff/Makefile +++ b/pkgtools/pkgdiff/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.1.1.1 2000/06/28 01:42:42 wiz Exp $ +# $NetBSD: Makefile,v 1.2 2000/07/01 02:38:55 wiz Exp $ # -DISTNAME= pkgdiff-0.90 +DISTNAME= pkgdiff-0.91 CATEGORIES= pkgtools devel MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/pkgdiff/files/mkpatches.pl b/pkgtools/pkgdiff/files/mkpatches.pl index ac5118c2d06..7c8e2a90629 100755 --- a/pkgtools/pkgdiff/files/mkpatches.pl +++ b/pkgtools/pkgdiff/files/mkpatches.pl @@ -1,6 +1,6 @@ #!@PREFIX@/bin/perl # -# $NetBSD: mkpatches.pl,v 1.1.1.1 2000/06/28 01:42:42 wiz Exp $ +# $NetBSD: mkpatches.pl,v 1.2 2000/07/01 02:38:56 wiz Exp $ # # mkpatches: creates a set of patches patch-aa, patch-ab, ... # in work/.newpatches by looking for *.orig files in and below @@ -87,7 +87,12 @@ while() { if ( -f $complete ) { $patchfile = ("aa".."zz")[$l]; $patchfile =~ s/^/patch-/; - system("pkgdiff $path $complete > $patchdir/$patchfile"); + $diff=`pkgdiff $path $complete`; + if ( "$diff" eq "" ) { + print ("$complete and $path don't differ\n"); + } else { + system("pkgdiff $path $complete > $patchdir/$patchfile"); + } } else { print ("$complete doesn't exist, though $path does"); } diff --git a/pkgtools/pkgdiff/files/pkgdiff b/pkgtools/pkgdiff/files/pkgdiff index 22f08f9b420..27c1ab98ff7 100755 --- a/pkgtools/pkgdiff/files/pkgdiff +++ b/pkgtools/pkgdiff/files/pkgdiff @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: pkgdiff,v 1.1.1.1 2000/06/28 01:42:42 wiz Exp $ +# $NetBSD: pkgdiff,v 1.2 2000/07/01 02:38:56 wiz Exp $ # # Id: pkgdiff,v 1.4 2000/05/14 01:04:54 feyrer Exp feyrer # @@ -13,11 +13,14 @@ # All Rights Reserved. Absolutely no warranty. # -echo '$'NetBSD'$' -echo '' +if [ $# -le 1 ] +then + echo $0: need at least two arguments >&2 + exit 1; +fi lines=3 -while [ `diff -u -$lines $@ | egrep -c '\\$(NetBSD|Author|Date|Header|Id|Locker|Log|Name|RCSfile|Revision|Source|State)'` != 0 ] +while [ `diff -u -$lines "$@" | egrep -c '\\$(NetBSD|Author|Date|Header|Id|Locker|Log|Name|RCSfile|Revision|Source|State)'` != 0 ] do lines=`expr $lines - 1` if [ $lines = 0 ]; then @@ -26,4 +29,9 @@ do fi done -diff -u -$lines $@ +if ! diff -qu -$lines "$@" > /dev/null +then + echo '$'NetBSD'$' + echo '' + diff -u -$lines "$@" +fi -- cgit v1.2.3