Fix bug in clone dummy

This commit is contained in:
topjohnwu 2016-12-08 21:31:34 +08:00
parent 2b1270381d
commit c9157cc13b

View File

@ -119,7 +119,11 @@ travel() {
clone_dummy() { clone_dummy() {
for ITEM in $MIRRDIR$1/* ; do for ITEM in $MIRRDIR$1/* ; do
REAL=${ITEM#$MIRRDIR} 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 if [ -L $ITEM ]; then
# Copy original symlink # Copy original symlink
cp -afc $ITEM $DUMMDIR$REAL cp -afc $ITEM $DUMMDIR$REAL
@ -129,13 +133,9 @@ clone_dummy() {
else else
mktouch $DUMMDIR$REAL mktouch $DUMMDIR$REAL
fi fi
# Mount the mirror # Mount the mirror if not module item
mktouch $MOUNTINFO/mirror$REAL [ ! -e $MOUNTINFO$REAL ] && mktouch $MOUNTINFO/mirror$REAL
fi fi
elif [ -d $MOUNTINFO$REAL ]; then
# Need to clone deeper
mkdir -p $DUMMDIR$REAL
(clone_dummy $REAL)
fi fi
done done
} }