fedora-rpmdevtools fedora-diffarchive, 1.2, 1.3 fedora-rpmdevtools.spec, 1.87, 1.88

Ville Skytta (scop) fedora-extras-commits at redhat.com
Wed Feb 8 18:58:01 UTC 2006


Author: scop

Update of /cvs/fedora/fedora-rpmdevtools
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14745

Modified Files:
	fedora-diffarchive fedora-rpmdevtools.spec 
Log Message:
* Wed Feb  8 2006 Ville Skyttä <ville.skytta at iki.fi>
- Add "diff file lists only" option to diffarchive.



Index: fedora-diffarchive
===================================================================
RCS file: /cvs/fedora/fedora-rpmdevtools/fedora-diffarchive,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- fedora-diffarchive	15 Mar 2005 12:42:05 -0000	1.2
+++ fedora-diffarchive	8 Feb 2006 18:57:53 -0000	1.3
@@ -13,6 +13,7 @@
 unset CDPATH
 tmpdir=
 diffopts=
+list=
 
 trap cleanup EXIT
 cleanup()
@@ -24,7 +25,8 @@
 usage()
 {
     cat <<EOF
-Usage: `basename $0` [diff-options] from-archive to-archive
+Usage: `basename $0` [-l,--list] [diff-options] from-archive to-archive
+  -l, --list    Diff lists of files in archives, not files themselves.
   diff-options  Options passed to diff(1), in addition to -r (default: -Nu).
                 The first argument not starting with a '-' ends diff-options.
 EOF
@@ -32,8 +34,9 @@
 
 while true ; do
     case "$1" in
-        -*) diffopts="$diffopts $1" ;;
-        *)  break ;;
+        -l|--list) [ -n "$list" ] && diffopts="$diffopts $1" || list=true ;;
+        -*)        diffopts="$diffopts $1" ;;
+        *)         break ;;
     esac
     shift
 done
@@ -42,6 +45,8 @@
     exit 1
 fi
 
+diffopts="-r ${diffopts:--Nu}"
+
 tmpdir=`mktemp -d /tmp/diffarchive.XXXXXX`
 
 mkdir "$tmpdir/old" "$tmpdir/new"
@@ -78,4 +83,10 @@
 fi
 
 # Here we go.
-diff -r ${diffopts:--Nu} "$old" "$new"
+if [ -n "$list" ] ; then
+    find "$old" | sort | cut -d/ -f 2- -s > "$old.files"
+    find "$new" | sort | cut -d/ -f 2- -s > "$new.files"
+    diff $diffopts "$old.files" "$new.files"
+else
+    diff $diffopts "$old" "$new"
+fi


Index: fedora-rpmdevtools.spec
===================================================================
RCS file: /cvs/fedora/fedora-rpmdevtools/fedora-rpmdevtools.spec,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -r1.87 -r1.88
--- fedora-rpmdevtools.spec	5 Feb 2006 14:05:34 -0000	1.87
+++ fedora-rpmdevtools.spec	8 Feb 2006 18:57:53 -0000	1.88
@@ -129,6 +129,9 @@
 
 
 %changelog
+* Wed Feb  8 2006 Ville Skyttä <ville.skytta at iki.fi>
+- Add "diff file lists only" option to diffarchive.
+
 * Sun Feb  5 2006 Ville Skyttä <ville.skytta at iki.fi>
 - Add Ruby spec template (#180066, Oliver Andrich) and make newrpmspec
   use it for ruby-*.




More information about the scm-commits mailing list