iop: feeds_update: add option for hard failure

Add -F option for hard failure on unsuccessful clone/fetch of feed.
This commit is contained in:
Erik Karlsson 2023-11-09 19:24:11 +01:00 committed by Andreas Gnau
parent 336c5047c6
commit 792e3ad20d

View file

@ -4,7 +4,18 @@ function feeds_update {
heads=1
developer=0
override=1
while getopts "inh" opt; do
force=1
function update_failure {
if [ $force == 1 ]; then
echo "WARNING: Failed to update feed(s). Forced update, proceeding anyway." >&2
else
echo "ERROR: Failed to update feed(s). Omit -F to proceed anyway." >&2
exit 1
fi
}
while getopts "inFh" opt; do
case $opt in
i)
heads=0
@ -12,12 +23,16 @@ function feeds_update {
n)
override=0
;;
F)
force=0
;;
h|\?)
echo "Usage: ./iop feeds_update [-i] [-n] [-h]"
echo "Usage: ./iop feeds_update [-i] [-n] [-F] [-h]"
echo
echo "OPTIONS:"
echo " -i - Only update index. Do not change HEAD in feeds."
echo " -n - Do not replace core packages with iopsys versions."
echo " -F - Do not force update if there are inaccessible feeds."
echo " -h - Display this help message and exit."
exit 1
;;
@ -30,9 +45,9 @@ function feeds_update {
if [ $heads == 1 ]; then
if [ $developer == 1 ]; then
./scripts/feeds update -g
./scripts/feeds update -g || update_failure
else
./scripts/feeds update
./scripts/feeds update || update_failure
fi
fi
./scripts/feeds update -ai || exit 1