pck-update: new options --update-autobuildreq which replace a block AUTOBUILDREQ-BEGIN ... AUTOBUILDREQ-END by an updated one

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
This commit is contained in:
Davide Madrisan 2012-05-27 19:55:01 +02:00
parent 036d9628f2
commit 458987e4ba
3 changed files with 32 additions and 4 deletions

View File

@ -15,6 +15,11 @@ Changes in version 1.12.2
* templates/kde4 * templates/kde4
Add a requirement for kdelibs-devel in the -devel package preamble. Add a requirement for kdelibs-devel in the -devel package preamble.
+ improvement
* pck-update - Davide Madrisan:
Action 6: new option '--update-autobuildreq' which replace a block
'AUTOBUILDREQ-BEGIN' ... 'AUTOBUILDREQ-END' by an updated one.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Changes in version 1.12.1 Changes in version 1.12.1

View File

@ -55,6 +55,8 @@ let "norpms = 0"
let "list_check = 0" let "list_check = 0"
# do not use rpm variables for unix tools # do not use rpm variables for unix tools
let "format_unix_tools = 0" let "format_unix_tools = 0"
# do not replace the automatically discovered build requirements
let "replace_autobuildreq = 0"
unset ignore_test_list unset ignore_test_list
@ -139,6 +141,8 @@ function usage() {
--norpm "$"action"" 5: "$"Only build the srpm package"" --norpm "$"action"" 5: "$"Only build the srpm package""
"$"action"" 10: "$"Do not upload the rpm packages"" "$"action"" 10: "$"Do not upload the rpm packages""
--list-check "$"action"" 5: "$"Do a \`list check'"" --list-check "$"action"" 5: "$"Do a \`list check'""
-b, --update-autobuildreq""
"$"action"" 6: "$"Replace the block AUTOBUILDREQ""
-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')""
@ -185,11 +189,11 @@ for arg in $@; do
done done
exec_options=`LC_ALL=C getopt \ exec_options=`LC_ALL=C getopt \
-o ua:d:l:S:A:cfLRDqrhV \ -o ua:d:l:S:A:bcfLRDqrhV \
--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:,nosrpm,norpm,list-check,\ changelog:,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:,clear,format,log,rebuild,root:,\
debug,quiet,colorize,help,version,\ debug,quiet,colorize,help,version,\
@ -239,6 +243,8 @@ while :; do
let "norpms = 1" ;; let "norpms = 1" ;;
--list-check) --list-check)
let "list_check = 1" ;; let "list_check = 1" ;;
-b|--update-autobuildreq)
let "replace_autobuildreq = 1" ;;
--force-update) --force-update)
let "force_update = 1" ;; let "force_update = 1" ;;
--force-build) --force-build)
@ -2231,13 +2237,24 @@ $(echo $solibpath | sed "s|-[0-9.]*\.so|.so|")"
[ "$p" = "$buildreq" ] && echo "$p" [ "$p" = "$buildreq" ] && echo "$p"
done)" ] && echo "BuildRequires: $buildreq" done)" ] && echo "BuildRequires: $buildreq"
fi fi
done ) >> $frequires done ) | sort -u >> $frequires
[ "$replace_autobuildreq" = 1 ] &&
notify.note "
${NOTE}"$"replacing the AUTOBUILDREQ block by:""${NORM}"
notify.note " notify.note "
## AUTOBUILDREQ-BEGIN" ## AUTOBUILDREQ-BEGIN"
sort -u $frequires cat $frequires
notify.note "## AUTOBUILDREQ-END notify.note "## AUTOBUILDREQ-END
" "
if [ "$replace_autobuildreq" = 1 ]; then
sed -i "/^## AUTOBUILDREQ/d" $frequires
sed -i -ne "/## AUTOBUILDREQ-BEGIN/{p;r $frequires" \
-e ':a;n;/## AUTOBUILDREQ-END/{p;b};ba};p' \
$SRPM_SPECFILE_WITH_PATH
fi
rm -f $frequires rm -f $frequires
;; ;;
7) notify.note "[${NOTE}step $step${NORM}] -- ${NOTE}"$"\ 7) notify.note "[${NOTE}step $step${NORM}] -- ${NOTE}"$"\

View File

@ -150,6 +150,9 @@ msgstr "Non effettua l'upload dei pacchetti rpm"
msgid "Do a \\`list check'" msgid "Do a \\`list check'"
msgstr "Cerca i file non pacchettizzati" msgstr "Cerca i file non pacchettizzati"
msgid "Replace the block AUTOBUILDREQ"
msgstr "Aggiorna il blocco AUTOBUILDREQ"
msgid "Remove all the temporary files except (s)rpm packages" msgid "Remove all the temporary files except (s)rpm packages"
msgstr "Rimuove tutti i file temporanei" msgstr "Rimuove tutti i file temporanei"
@ -536,3 +539,6 @@ msgstr "controllo dello specfile alla ricerca di comuni errori"
msgid "checking packages for common mistakes" msgid "checking packages for common mistakes"
msgstr "controllo dei pacchetti alla ricerca di comuni errori" msgstr "controllo dei pacchetti alla ricerca di comuni errori"
msgid "replacing the AUTOBUILDREQ block by:"
msgstr "sostituzione del blocco AUTOBUILDREQ con:"