buildrepo: support for -k option for keep-going
This option will make buildrepo continue build even if some package fails. It is an 'build what you can' option.
This commit is contained in:
parent
212ba26389
commit
c7d94591a5
12
buildrepo.in
12
buildrepo.in
|
@ -26,6 +26,7 @@ usage() {
|
||||||
echo " -d Set destination repository base dir to REPODIR instead of $repodir"
|
echo " -d Set destination repository base dir to REPODIR instead of $repodir"
|
||||||
echo " -h Show this help and exit"
|
echo " -h Show this help and exit"
|
||||||
echo " -l Send build to logfile, prefixed by LOGPREFIX"
|
echo " -l Send build to logfile, prefixed by LOGPREFIX"
|
||||||
|
echo " -k Keep going, even if packages fails"
|
||||||
echo " -p Purge obsolete packages from REPODIR after build"
|
echo " -p Purge obsolete packages from REPODIR after build"
|
||||||
echo " -r Dependencies are found in DEPREPO"
|
echo " -r Dependencies are found in DEPREPO"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -85,7 +86,7 @@ list_needbuild() {
|
||||||
cd "$aportsdir/$repo" || return 0
|
cd "$aportsdir/$repo" || return 0
|
||||||
|
|
||||||
# first we try copy everything possible and find out which we need
|
# first we try copy everything possible and find out which we need
|
||||||
# to rebuild. By doing this we might save us for rebuilding
|
# to rebuild. By doing this we might save us for rebuilding
|
||||||
# needed when running 'abuild -R'
|
# needed when running 'abuild -R'
|
||||||
for apkbuild in */APKBUILD; do
|
for apkbuild in */APKBUILD; do
|
||||||
[ -f "$aportsdir/$repo/$apkbuild" ] || continue
|
[ -f "$aportsdir/$repo/$apkbuild" ] || continue
|
||||||
|
@ -131,11 +132,15 @@ do_build() {
|
||||||
local needbuild="$(list_needbuild $repo)"
|
local needbuild="$(list_needbuild $repo)"
|
||||||
|
|
||||||
export REPODEST="$repodir"
|
export REPODEST="$repodir"
|
||||||
|
export ABUILD_BLACKLIST
|
||||||
# build the postponed packages if any
|
# build the postponed packages if any
|
||||||
if [ -n "$needbuild" ]; then
|
if [ -n "$needbuild" ]; then
|
||||||
for i in $needbuild; do
|
for i in $needbuild; do
|
||||||
cd "$aportsdir/$repo"/${i%/*} || return 1
|
cd "$aportsdir/$repo"/${i%/*} || return 1
|
||||||
abuild -k -R || return 1
|
if ! abuild -k -R; then
|
||||||
|
[ -n "$keep_going" ] || return 1
|
||||||
|
ABUILD_BLACKLIST="$ABUILD_BLACKLIST $i"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -174,11 +179,12 @@ do_build() {
|
||||||
rm -f tmp.*
|
rm -f tmp.*
|
||||||
}
|
}
|
||||||
|
|
||||||
while getopts "a:d:hl:pr:" opt; do
|
while getopts "a:d:hkl:pr:" opt; do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
a) aportsdir=$OPTARG;;
|
a) aportsdir=$OPTARG;;
|
||||||
d) repodir=$OPTARG;;
|
d) repodir=$OPTARG;;
|
||||||
h) usage >&2;;
|
h) usage >&2;;
|
||||||
|
k) keep_going=1;;
|
||||||
l) logprefix=$OPTARG;;
|
l) logprefix=$OPTARG;;
|
||||||
p) dopurge=1;;
|
p) dopurge=1;;
|
||||||
r) deprepo="$deprepo $OPTARG";;
|
r) deprepo="$deprepo $OPTARG";;
|
||||||
|
|
Loading…
Reference in New Issue