1
0
Fork 0
forked from infra/ansible

pkgs: optimize make-git-checkout-seed.sh

The code in if-branch and else-branch is identical. I moved it after the if-else-fi.
This commit is contained in:
Miroslav Suchý 2026-03-19 11:21:29 +01:00 committed by Kevin Fenzi
commit 4ee26d9257

View file

@ -59,24 +59,18 @@ for repo in $ORIGIN_DIR/*.git; do
# in case we modify the history because e.g. legal request
git reset --hard origin/HEAD &>/dev/null
git pull --all &>/dev/null
popd &>/dev/null
if [ -e $working_tree/dead.package ]; then
rm -f $working_tree/$bname.spec
rm -f $SPEC_DIR/$bname.spec
elif [ -e $working_tree/$bname.spec ]; then
cp -p $working_tree/$bname.spec $SPEC_DIR/
fi
else
pushd $SEED_DIR &>/dev/null
git clone $repo &>/dev/null
popd &>/dev/null
if [ -e $working_tree/dead.package ]; then
rm -f $working_tree/$bname.spec
rm -f $SPEC_DIR/$bname.spec
elif [ -e $working_tree/$bname.spec ]; then
cp -p $working_tree/$bname.spec $SPEC_DIR/
fi
fi
popd &>/dev/null
if [ -e $working_tree/dead.package ]; then
rm -f $working_tree/$bname.spec
rm -f $SPEC_DIR/$bname.spec
elif [ -e $working_tree/$bname.spec ]; then
cp -p $working_tree/$bname.spec $SPEC_DIR/
fi
# Now we go through each of the defined extra branches, and if the branch exists and
# contains a specfile, we move it to the $EXTRA_BRANCHES_PREFIX$branchname directory