Fix mount issue when multiple repos share the same data path.
This commit is contained in:
parent
703c353c1b
commit
512b709d31
33
bare.sh
33
bare.sh
|
@ -477,6 +477,18 @@ function check_repomount_needed() {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function check_datamount_needed() {
|
||||||
|
if [[ $CMD == "go" ]]; then
|
||||||
|
NEEDMOUNT=1
|
||||||
|
elif [[ $CMD == "get" ]]; then
|
||||||
|
NEEDMOUNT=1
|
||||||
|
elif [[ $CMD == "diff" ]]; then
|
||||||
|
NEEDMOUNT=1
|
||||||
|
else
|
||||||
|
NEEDMOUNT=0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Handle args
|
# Handle args
|
||||||
ARGS="acd:hs:tTvx:"
|
ARGS="acd:hs:tTvx:"
|
||||||
|
|
||||||
|
@ -748,6 +760,7 @@ for f in $REPO_LIST; do
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
check_datamount_needed "$f" # sets $NEEDMOUNT
|
||||||
if [[ $CMD == "go" ]]; then
|
if [[ $CMD == "go" ]]; then
|
||||||
NEEDMOUNT=1
|
NEEDMOUNT=1
|
||||||
elif [[ $CMD == "get" ]]; then
|
elif [[ $CMD == "get" ]]; then
|
||||||
|
@ -835,15 +848,7 @@ for f in $REPO_LIST; do
|
||||||
else
|
else
|
||||||
USINGDEFAULT=1
|
USINGDEFAULT=1
|
||||||
fi
|
fi
|
||||||
if [[ $CMD == "go" ]]; then
|
check_datamount_needed "$f" # sets $NEEDMOUNT
|
||||||
NEEDMOUNT=1
|
|
||||||
elif [[ $CMD == "get" ]]; then
|
|
||||||
NEEDMOUNT=1
|
|
||||||
elif [[ $CMD == "diff" ]]; then
|
|
||||||
NEEDMOUNT=1
|
|
||||||
else
|
|
||||||
NEEDMOUNT=0
|
|
||||||
fi
|
|
||||||
|
|
||||||
check_repomount_needed "$f" # sets $MOUNTREPO
|
check_repomount_needed "$f" # sets $MOUNTREPO
|
||||||
if [[ $MOUNTREPO -eq 1 ]]; then
|
if [[ $MOUNTREPO -eq 1 ]]; then
|
||||||
|
@ -1383,11 +1388,6 @@ for f in $REPO_LIST; do
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $NEEDMOUNT -eq 1 ]]; then
|
|
||||||
do_umount
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [[ ! $CMD == "check" ]]; then
|
if [[ ! $CMD == "check" ]]; then
|
||||||
# Record result
|
# Record result
|
||||||
updatestats $f $CMD $rv
|
updatestats $f $CMD $rv
|
||||||
|
@ -1405,6 +1405,11 @@ done
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
for f in $REPO_LIST; do
|
for f in $REPO_LIST; do
|
||||||
|
check_datamount_needed "$f" # sets $NEEDMOUNT
|
||||||
|
if [[ $NEEDMOUNT -eq 1 ]]; then
|
||||||
|
do_umount
|
||||||
|
fi
|
||||||
|
|
||||||
check_repomount_needed "$f" # sets $MOUNTREPO
|
check_repomount_needed "$f" # sets $MOUNTREPO
|
||||||
if [[ $MOUNTREPO -eq 1 ]]; then
|
if [[ $MOUNTREPO -eq 1 ]]; then
|
||||||
path=`gettagval "$f" premount`
|
path=`gettagval "$f" premount`
|
||||||
|
|
Loading…
Reference in New Issue