X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fkernel_patches%2Fscripts%2Frpatch;h=5a8da38daf0aa7be28d3f14514c057aafd6a5c33;hb=96ec6856f91f7f9031cfce4273c714d72cfe59ae;hp=42e15333babdf69a1f974a1d4e01ee31276cd11f;hpb=0bcac33c5aec463e9f471fba6f7d0adc26e6df9f;p=fs%2Flustre-release.git diff --git a/lustre/kernel_patches/scripts/rpatch b/lustre/kernel_patches/scripts/rpatch index 42e1533..5a8da38 100755 --- a/lustre/kernel_patches/scripts/rpatch +++ b/lustre/kernel_patches/scripts/rpatch @@ -6,15 +6,34 @@ exit 1 } +# do_remove() +# { +# if patch -R -p1 -s -i $P/patches/"$1".patch +# then +# true +# else +# echo SOMETHING WENT WRONG +# exit 1 +# fi +# } + do_remove() { - if patch -R -p1 -s -i $P/patches/"$1".patch - then - true - else - echo SOMETHING WENT WRONG - exit 1 - fi + FILES=$(cat $P/pc/$1.pc) + for file in $FILES ; do + base_dir=`pwd` + if [ -L "$file"~"orig" ]; then + if [ `readlink "$file"~"orig"` = "$base_dir/""$file"~"$1" ]; then + rm -rf "$file"~"orig" + fi + fi + if [ -f "$file"~"$1" ]; then + mv -f "$file"~"$1" "$file" + else + rm -f "$file" + fi + done + true } kill_old_ones() @@ -40,18 +59,20 @@ fi PATCH_NAME=$(stripit $1) warn_top_current - if is_applied "$PATCH_NAME" then - if can_remove "$PATCH_NAME" - then +# if can_remove "$PATCH_NAME" +# then + if [ ! -f $P/pc/$PATCH_NAME.pc ]; then + exit 1 + fi do_remove "$PATCH_NAME" kill_old_ones "$PATCH_NAME" remove_from_db "$PATCH_NAME" - else - echo "$PATCH_NAME" does not remove cleanly - exit 1 - fi +# else +# echo "$PATCH_NAME" does not remove cleanly +# exit 1 +# fi else echo "$PATCH_NAME" is not applied exit 1