weave: add support for DRY_RUN

This commit is contained in:
Hui Yiqun 2016-12-27 09:30:10 +08:00
parent be96613c3a
commit a71f255e6b

View File

@ -38,7 +38,6 @@ function git_clone_or_pull {
function git_repack() {
echo "Start writing bitmap index"
while read repo; do
echo $repo
cd $repo
size=$(du -sm .|cut -f1)
if [[ "$size" -gt "100" ]]; then
@ -52,9 +51,13 @@ git_clone_or_pull $MANIFEST_URL $MANIFEST_DIR
for repo in $($MANIFEST_XML_REPOLIST $MANIFEST_DIR/default.xml weave); do
contains $repo ${IGNORED_REPO[@]} && continue
if [[ -z ${DRY_RUN:-} ]]; then
echo $TUNASYNC_UPSTREAM_URL/$repo
git_clone_or_pull $TUNASYNC_UPSTREAM_URL/$repo $TUNASYNC_WORKING_DIR/$repo yes
done
if [[ "$USE_BITMAP_INDEX" == "1" ]]; then
git_repack
fi
else
echo $TUNASYNC_UPSTREAM_URL/$repo
fi
done