Whamcloud - gitweb
removing the link of orignal file
authorwangdi <wangdi>
Sun, 18 May 2003 12:15:19 +0000 (12:15 +0000)
committerwangdi <wangdi>
Sun, 18 May 2003 12:15:19 +0000 (12:15 +0000)
lustre/kernel_patches/scripts/rpatch

index d6d9950..636ff5f 100755 (executable)
@@ -21,7 +21,13 @@ do_remove()
 {
        FILES=$(cat $P/pc/$1.pc)
        for file in $FILES ; do
-            if [ -f "$file"~"$1" ]; then
+           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"