[PATCH] dim: Fix the broken rerere changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I screwed up:
- a '/' at the end makes readlink follow the link before testing it.
- only delete everything when it's not a symlink.

Cc: Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>
Acked-by: Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>
Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx>
---
 dim | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/dim b/dim
index f8be76df4952..619d855b321b 100755
--- a/dim
+++ b/dim
@@ -492,9 +492,9 @@ function check_conflicts # tree
 function rr_cache_dir
 {
 	if [ -d $DIM_PREFIX/drm-tip/.git/ ] ; then
-		echo $DIM_PREFIX/drm-tip/.git/rr-cache/
+		echo $DIM_PREFIX/drm-tip/.git/rr-cache
 	else
-		echo $DIM_PREFIX/$DIM_DRM_INTEL/.git/rr-cache/
+		echo $DIM_PREFIX/$DIM_DRM_INTEL/.git/rr-cache
 	fi
 }
 
@@ -504,10 +504,10 @@ function update_rerere_cache
 
 	cd $DIM_PREFIX/drm-rerere/
 	git pull &> /dev/null
-	if [ -d $(rr_cache_dir) ] ; then
-		rm -Rf $(rr_cache_dir)
-	fi
 	if [ ! -L $(rr_cache_dir) ] ; then
+		if [ -d $(rr_cache_dir) ] ; then
+			rm -Rf $(rr_cache_dir)
+		fi
 		ln -s "$DIM_PREFIX/drm-rerere/rr-cache" $(dirname $(rr_cache_dir))
 	fi
 
-- 
2.13.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux