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:
parent
45cae9b0d3
commit
4ee26d9257
1 changed files with 8 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue