From 11b4ca1d9ff88e255e51b61220cbefd556e25cfd Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Thu, 5 Jul 2007 06:48:40 +0000 Subject: [PATCH] Clifford Wolf: Imported current xdiff and bked versions from cliffords tools package [2007070110491425494] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@8618 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- misc/archive/bked.sh | 14 ++++++++++++-- misc/archive/xdiff.sh | 10 ++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/misc/archive/bked.sh b/misc/archive/bked.sh index 08c7b1f90..2ff3edd4d 100644 --- a/misc/archive/bked.sh +++ b/misc/archive/bked.sh @@ -22,5 +22,15 @@ # # --- ROCK-COPYRIGHT-NOTE-END --- -for x ; do [ -f $x.orig ] || cp -v $x $x.orig ; done -$EDITOR "$@" +for x; do + if [ "${x#-}" != "$x" ]; then + continue + fi + if [ ! -f $x.orig ]; then + touch $x + cp -v $x $x.orig + fi +done + +${EDITOR:-vi} "$@" + diff --git a/misc/archive/xdiff.sh b/misc/archive/xdiff.sh index fb26a302f..da738514c 100644 --- a/misc/archive/xdiff.sh +++ b/misc/archive/xdiff.sh @@ -22,8 +22,10 @@ # # --- ROCK-COPYRIGHT-NOTE-END --- -list="`find $* -name '*.orig'`" - -for x in $list -do diff -ud $x `echo $x | sed 's,\.orig$,,'` +for x in $( { find "$@" -name '*.orig' -type f; find "$@" -maxdepth 0 -type f; } | sed 's,\.orig$,,' | sort -u; ) +do + if [ -f "$x" -a -f "$x.orig" ]; then + diff -ud "$x.orig" "$x" + fi done +