pck-update: support for --noprep (-p) option passed to rpm to skip prepare step

This commit is contained in:
Silvan Calarco 2025-01-04 14:16:58 +01:00
parent f00a282407
commit 4d3731ea6b

View File

@ -34,6 +34,7 @@ me=(${0##*/} "@version@" "@date@")
# output verbosity # output verbosity
let "verbose = 1" let "verbose = 1"
# #
let "noprep = 0"
let "cleanup = 0" let "cleanup = 0"
let "spec_format = 0" let "spec_format = 0"
let "rebuild = 0" let "rebuild = 0"
@ -97,7 +98,7 @@ function usage() {
[--packager-email \"email@domain\" ] [--nosrpm|--norpm] \\ [--packager-email \"email@domain\" ] [--nosrpm|--norpm] \\
[--force-update] [--force-build] [--force-install] \\ [--force-update] [--force-build] [--force-install] \\
[--force-download] [--ignore-test t1[,t2,...]] \\ [--force-download] [--ignore-test t1[,t2,...]] \\
[-c] [-f] [-L] [-R] [-C <conf_file>] [-p] [-c] [-f] [-L] [-R] [-C <conf_file>]
"$"where the above options mean"": "$"where the above options mean"":
-u, --update "$"Update the package <pck> to version <ver> and release <rel>"" -u, --update "$"Update the package <pck> to version <ver> and release <rel>""
@ -147,6 +148,7 @@ function usage() {
--list-check "$"action"" 5: "$"Do a \`list check'"" --list-check "$"action"" 5: "$"Do a \`list check'""
-b, --update-autobuildreq"" -b, --update-autobuildreq""
"$"action"" 6: "$"Replace the block AUTOBUILDREQ"" "$"action"" 6: "$"Replace the block AUTOBUILDREQ""
-p, --noprep "$"Skip rpmbuild %prep macro when retrying building from an existing builddir""
-c, --clear "$"Remove all the temporary files except (s)rpm packages"" -c, --clear "$"Remove all the temporary files except (s)rpm packages""
-f, --format "$"Enable specfile autoformatting"" -f, --format "$"Enable specfile autoformatting""
-L, --log "$"Unable logging to file (logging dir: \`\$logging_dir')"" -L, --log "$"Unable logging to file (logging dir: \`\$logging_dir')""
@ -196,14 +198,14 @@ for arg in $@; do
done done
exec_options=`LC_ALL=C getopt \ exec_options=`LC_ALL=C getopt \
-o ua:d:l:S:A:bcfLRC:DqhV \ -o ua:d:l:S:A:pbcfLRC:DqhV \
--long \ --long \
update,action:,define:,login:,specfile:,arch:,\ update,action:,define:,login:,specfile:,arch:,\
server-download:,server-upload:,server:,\ server-download:,server-upload:,server:,\
changelog:,packager-fullname:,packager-email:,distro-rpm:,\ changelog:,packager-fullname:,packager-email:,distro-rpm:,\
nosrpm,norpm,list-check,update-autobuildreq,\ nosrpm,norpm,list-check,update-autobuildreq,\
force-update,force-build,force-install,force-download,force,\ force-update,force-build,force-install,force-download,force,\
ignore-test:,clear,format,log,rebuild,root:,\ ignore-test:,noprep,clear,format,log,rebuild,root:,\
frontend_opts:,colors:,config:,\ frontend_opts:,colors:,config:,\
debug,quiet,help,version \ debug,quiet,help,version \
-n "$me" -- "$@"` -n "$me" -- "$@"`
@ -281,6 +283,8 @@ while :; do
let "force_upload = 1" ;; let "force_upload = 1" ;;
--ignore-test) --ignore-test)
ignore_test_list=$2; shift ;; ignore_test_list=$2; shift ;;
-p|--noprep)
noprep=1 ;;
-c|--clear) -c|--clear)
cleanup=1 ;; cleanup=1 ;;
-f|--format) -f|--format)
@ -2122,6 +2126,8 @@ ${proxy:+--proxy $proxy} ${proxy_user:+--proxy-user $proxy_user} \
[ "$BUILD_ARCH" != "$target_cpu" ] && [ "$BUILD_ARCH" != "$target_cpu" ] &&
USER_RPMDEFINE_OPTS="--target $target_cpu $USER_RPMDEFINE_OPTS" USER_RPMDEFINE_OPTS="--target $target_cpu $USER_RPMDEFINE_OPTS"
[ "$noprep" = "1" ] && rpmbuild_opts="$rpmbuild_opts --noprep"
[ "$cleanup" = "1" ] && rpmbuild_opts="$rpmbuild_opts --clean" [ "$cleanup" = "1" ] && rpmbuild_opts="$rpmbuild_opts --clean"
# note: exit with error when build requirements are missing # note: exit with error when build requirements are missing