From c9157cc13b3ab34b1749b428046f9f01ee3f0255 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Thu, 8 Dec 2016 21:31:34 +0800 Subject: [PATCH] Fix bug in clone dummy --- scripts/magic_mask.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/magic_mask.sh b/scripts/magic_mask.sh index b201afcb5..532d72b39 100644 --- a/scripts/magic_mask.sh +++ b/scripts/magic_mask.sh @@ -119,7 +119,11 @@ travel() { clone_dummy() { for ITEM in $MIRRDIR$1/* ; do REAL=${ITEM#$MIRRDIR} - if [ ! -e $MOUNTINFO$REAL ]; then + if [ -d $MOUNTINFO$REAL ]; then + # Need to clone deeper + mkdir -p $DUMMDIR$REAL + (clone_dummy $REAL) + else if [ -L $ITEM ]; then # Copy original symlink cp -afc $ITEM $DUMMDIR$REAL @@ -129,13 +133,9 @@ clone_dummy() { else mktouch $DUMMDIR$REAL fi - # Mount the mirror - mktouch $MOUNTINFO/mirror$REAL + # Mount the mirror if not module item + [ ! -e $MOUNTINFO$REAL ] && mktouch $MOUNTINFO/mirror$REAL fi - elif [ -d $MOUNTINFO$REAL ]; then - # Need to clone deeper - mkdir -p $DUMMDIR$REAL - (clone_dummy $REAL) fi done }