]> git.pld-linux.org Git - packages/rpm-build-macros.git/commitdiff
- easy patch -p1 maker
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 1 Mar 2007 23:03:15 +0000 (23:03 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm-build.sh -> 1.25

rpm-build.sh

index 2855644c1875334f7721474750ba0731677638ab..036c3c9275e80e08146d3a2769f91736f80db0d2 100644 (file)
@@ -144,6 +144,19 @@ cvslog() {
 }
 
 # does diff between FILE and FILE~
+# the diff can be applied with patch -p1
 d() {
-       dif $1{~,}
+       local file="$1"
+       local dir=${file%/*}
+       if [[ "$file" = /* ]]; then
+               # full path -- no idea where to strip
+               dir=.
+               diff=$file
+       else
+               # relative path -- keep one path component from current dir
+               dir=..
+               diff=${PWD##*/}/${file}
+       fi
+
+       (builtin cd "$dir"; dif $diff{~,})
 }
This page took 0.106306 seconds and 4 git commands to generate.