autodist: added --rebuild-srpms

This commit is contained in:
Silvan Calarco 2017-06-19 14:47:30 +02:00
parent a6d6fd03e4
commit 681b2e5ec7

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# #
# Autodist -- batch build tool for RPM based distributions # Autodist -- batch build tool for RPM based distributions
# Copyright (C) 2006-2014 by Silvan Calarco <silvan.calarco@mambasoft.it> # Copyright (C) 2006-2016 by Silvan Calarco <silvan.calarco@mambasoft.it>
# #
# Released under the terms of the GNU GPL release 3 license # Released under the terms of the GNU GPL release 3 license
# #
@ -12,7 +12,7 @@ exec 3>`readlink /proc/self/fd/0`
function usage() { function usage() {
echo "\ echo "\
${me[0]} ${me[1]} ${me[0]} ${me[1]}
"$"Copyright (C) 2006-2014 Silvan Calarco <silvan.calarco@mambasoft.it>"" "$"Copyright (C) 2006-2016 Silvan Calarco <silvan.calarco@mambasoft.it>""
"$"Released under the terms of the GNU GPL v3 license" "$"Released under the terms of the GNU GPL v3 license"
echo " echo "
"$"Batch build tool for bulding a whole distribution and much more."" "$"Batch build tool for bulding a whole distribution and much more.""
@ -48,6 +48,7 @@ ${me[0]} ${me[1]}
2: abort on error"" 2: abort on error""
--arch "$"Build packages for specified target architecture"" --arch "$"Build packages for specified target architecture""
--user user "$"Pass calling user name for Webbuild social messages"" --user user "$"Pass calling user name for Webbuild social messages""
--rebuild-srpms "$"Rebuild SRPMs when sending""
job "$"Job specification in the form pkg#version, job#version, job/pkg#version, examples: job "$"Job specification in the form pkg#version, job#version, job/pkg#version, examples:
glibc#2.11.1 glibc#2.11.1
@ -194,6 +195,9 @@ for ((i=1; i<=$#; i++)); do
} }
WEBBUILD_USER_CMDLINE="${!i}" WEBBUILD_USER_CMDLINE="${!i}"
;; ;;
--rebuild-srpms)
REBUILD_SRPMS=1
;;
-*) if [ "${!i}" = "--" ]; then -*) if [ "${!i}" = "--" ]; then
AUTOSPEC_ARGS_MODE=1 AUTOSPEC_ARGS_MODE=1
SCRIPT_ARGS_MODE= SCRIPT_ARGS_MODE=
@ -685,6 +689,8 @@ function launch_pkgs_loop() {
fi fi
fi fi
command_opts="-a5:6" ;; command_opts="-a5:6" ;;
buildsrpm)
command_opts="-a5:6 --norpm" ;;
buildinstall) buildinstall)
# skip package in job if up to date # skip package in job if up to date
if [ "$PKGLINE" -a "$BUILDSLINE" ]; then if [ "$PKGLINE" -a "$BUILDSLINE" ]; then
@ -1358,7 +1364,12 @@ for JOB_NUM in `seq 1 ${#JOBNAME[*]}`; do
} }
# avoid calling autospec with --nosrpm --norpm (not working as expected and not useful) # avoid calling autospec with --nosrpm --norpm (not working as expected and not useful)
if [ "${AUTOSPEC_ARGS/--nosrpm}" = "$AUTOSPEC_ARGS" ]; then if [ "${AUTOSPEC_ARGS/--nosrpm}" = "$AUTOSPEC_ARGS" ]; then
echo "== sending source rpms" if [ $REBUILD_SRPMS ]; then
echo "== rebuilding and sending source rpms"
launch_pkgs_loop buildsrpm "$AUTOSPEC_ARGS --norpm"
else
echo "== sending source rpms"
fi
launch_pkgs_loop send "$AUTOSPEC_ARGS --norpm $SEND_SERVER_CMD" launch_pkgs_loop send "$AUTOSPEC_ARGS --norpm $SEND_SERVER_CMD"
if [ $? -gt 0 ]; then if [ $? -gt 0 ]; then
case $SEVERITY in case $SEVERITY in