summaryrefslogtreecommitdiff
path: root/pkgtools/pkgdiff
diff options
context:
space:
mode:
authorabs <abs@pkgsrc.org>2015-02-03 22:50:27 +0000
committerabs <abs@pkgsrc.org>2015-02-03 22:50:27 +0000
commite34a531e325b5f1b31fbd82d5edd9181b9495c35 (patch)
treeb61b43603340b0d7d78971dc9b1ad68172ae9539 /pkgtools/pkgdiff
parent9a18860c5294d6394a5b9647cf005d79f3610cb1 (diff)
downloadpkgsrc-e34a531e325b5f1b31fbd82d5edd9181b9495c35.tar.gz
Updated pkgtools/pkgdiff to 1.6
1.6: Correctly handle filenames with whitespace in pkgdiff and mkpatches
Diffstat (limited to 'pkgtools/pkgdiff')
-rw-r--r--pkgtools/pkgdiff/Makefile6
-rwxr-xr-xpkgtools/pkgdiff/files/mkpatches.pl8
-rwxr-xr-xpkgtools/pkgdiff/files/pkgdiff18
3 files changed, 15 insertions, 17 deletions
diff --git a/pkgtools/pkgdiff/Makefile b/pkgtools/pkgdiff/Makefile
index 64ce278ff0c..1eb2b575356 100644
--- a/pkgtools/pkgdiff/Makefile
+++ b/pkgtools/pkgdiff/Makefile
@@ -1,8 +1,6 @@
-# $NetBSD: Makefile,v 1.85 2014/10/09 14:06:50 wiz Exp $
-#
+# $NetBSD: Makefile,v 1.86 2015/02/03 22:50:27 abs Exp $
-PKGNAME= pkgdiff-1.5
-PKGREVISION= 1
+PKGNAME= pkgdiff-1.6
CATEGORIES= pkgtools devel
MAINTAINER= wiz@NetBSD.org
diff --git a/pkgtools/pkgdiff/files/mkpatches.pl b/pkgtools/pkgdiff/files/mkpatches.pl
index 645575748e8..65609eb42f2 100755
--- a/pkgtools/pkgdiff/files/mkpatches.pl
+++ b/pkgtools/pkgdiff/files/mkpatches.pl
@@ -1,6 +1,6 @@
#!@PERL5@
#
-# $NetBSD: mkpatches.pl,v 1.18 2014/03/12 20:28:30 asau Exp $
+# $NetBSD: mkpatches.pl,v 1.19 2015/02/03 22:50:27 abs Exp $
#
# mkpatches: creates a set of patches patch-aa, patch-ab, ...
# in work/.newpatches by looking for *.orig files in and below
@@ -175,7 +175,7 @@ foreach (sort <HANDLE>) {
if ($opt_v) {
print "$patchfile -> $complete\n";
}
- $diff=`@PREFIX@/bin/pkgdiff $old $new 2>&1`;
+ $diff=`@PREFIX@/bin/pkgdiff "$old" "$new" 2>&1`;
if ($?) {
print "$old: $diff";
}
@@ -207,7 +207,7 @@ sub analyze_old_patches
if (! -s $checkname) {
$checkname = $filename;
}
- $patch = `sed '/^\+\+\+/ q' $checkname`;
+ $patch = `sed '/^\+\+\+/ q' "$checkname"`;
if (!($patch =~ m/^\+\+\+ ([^\t\n]*)(\n$|\t)/m)) {
warn "cannot extract filename from patch $checkname";
next;
@@ -247,7 +247,7 @@ sub patch_name # filename
}
$name =~ s,_,__,g;
- $name =~ s,/,_,g;
+ $name =~ s,[/\s],_,g;
$name = "patch-$name";
return $name;
diff --git a/pkgtools/pkgdiff/files/pkgdiff b/pkgtools/pkgdiff/files/pkgdiff
index 846fa749a75..226ef725b13 100755
--- a/pkgtools/pkgdiff/files/pkgdiff
+++ b/pkgtools/pkgdiff/files/pkgdiff
@@ -1,6 +1,6 @@
#!@SH@
#
-# $NetBSD: pkgdiff,v 1.22 2012/09/16 18:09:53 dholland Exp $
+# $NetBSD: pkgdiff,v 1.23 2015/02/03 22:50:27 abs Exp $
#
# Usage: pkgdiff newfile
# pkgdiff oldfile newfile
@@ -81,18 +81,18 @@ else
old="$1"
new="$2"
fi
-basename_new="`basename $new`"
+basename_new="`basename "$new"`"
dodiff() {
case x"$basename_new" in
xconfigure)
- @DIFF@ -I '\(echo .*as_me:[0-9][0-9]*:\|echo .*configure:[0-9][0-9]*:\|line [0-9][0-9]* "configure\)' -I '\(Avoid regenerating within pkgsrc\|exit 0\)' $*
+ @DIFF@ -I '\(echo .*as_me:[0-9][0-9]*:\|echo .*configure:[0-9][0-9]*:\|line [0-9][0-9]* "configure\)' -I '\(Avoid regenerating within pkgsrc\|exit 0\)' "$@"
;;
xMakefile*)
- @DIFF@ -I '\(localedir.*=.*localedir\|localedir.*=.*share/locale\)' $*
+ @DIFF@ -I '\(localedir.*=.*localedir\|localedir.*=.*share/locale\)' "$@"
;;
*)
- @DIFF@ $*
+ @DIFF@ "$@"
esac
}
@@ -103,7 +103,7 @@ dogrep() {
case x"$PKGDIFF_FMT" in x)
lines=3
PKGDIFF_FMT="-p"
-while [ `dodiff "$PKGDIFF_FMT" -U $lines "$old" "$new" | dogrep -c` != 0 ]
+while [ `dodiff $PKGDIFF_FMT -U $lines "$old" "$new" | dogrep -c` != 0 ]
do
lines=`expr $lines - 1`
if [ $lines = 0x -a x"$PKGDIFF_FMT" = x-p ]; then
@@ -115,7 +115,7 @@ do
if [ $lines = 0 ]; then
echo "Cannot strip away RCS IDs, please handle manually!" >&2
echo "These are the matching lines:" >&2
- dodiff "$PKGDIFF_FMT" -U $lines "$old" "$new" | dogrep |\
+ dodiff $PKGDIFF_FMT -U $lines "$old" "$new" | dogrep |\
sed -e 's/^/ /' >&2
echo "Setting PKGDIFF_FMT might help." >&2
echo "Otherwise you may need to run diff by hand." >&2
@@ -126,7 +126,7 @@ PKGDIFF_FMT="${PKGDIFF_FMT} -U $lines"
;;
esac # PKGDIFF_FMT unset or null
-if dodiff -q "$PKGDIFF_FMT" "$old" "$new" > /dev/null
+if dodiff -q $PKGDIFF_FMT "$old" "$new" > /dev/null
then
:
else
@@ -134,5 +134,5 @@ else
echo ''
# Strip out the date on the +++ line to reduce needless
# differences in regenerated patches
- dodiff "$PKGDIFF_FMT" "$old" "$new" | sed -e 's:^\(+++ [^ ]*\) .*:\1:'
+ dodiff $PKGDIFF_FMT "$old" "$new" | sed -e 's:^\(+++ [^ ]*\) .*:\1:'
fi