[Intel-gfx] [PATCH] dim: Fix the broken rerere changes

Daniel Vetter daniel.vetter at ffwll.ch
Tue Aug 8 09:02:25 UTC 2017


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 at linux.intel.com>
Acked-by: Jani Nikula <jani.nikula at linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
---
 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



More information about the Intel-gfx mailing list