pck-update: stop execution with an error code when specfile.newrelease() reports an error
Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
This commit is contained in:
parent
876db3bedd
commit
0c9278c7e8
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
|||||||
|
Changes in version 1.10.1
|
||||||
|
--- Maj -- 2012 Davide Madrisan <davide.madrisan(a)gmail.com>
|
||||||
|
|
||||||
|
+ bugfix
|
||||||
|
* pck-update - Davide Madrisan:
|
||||||
|
Stop pck-update execution with an error code when 'specfile.newrelease()'
|
||||||
|
reports an error.
|
||||||
|
(Bug reported by Silvan Calarco.)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
Changes in version 1.10.0
|
Changes in version 1.10.0
|
||||||
Tue Maj 01 2012 Davide Madrisan <davide.madrisan(a)gmail.com>
|
Tue Maj 01 2012 Davide Madrisan <davide.madrisan(a)gmail.com>
|
||||||
|
|
||||||
|
@ -565,15 +565,19 @@ function specfile.newrelease() {
|
|||||||
|
|
||||||
( . $infofile
|
( . $infofile
|
||||||
|
|
||||||
# NOTE: we only accept release strings in the format '<version><distroid>'
|
# NOTE: allowed format is: '<version><distroid>'
|
||||||
[[ "$SPEC_RELEASE" =~ ^[0-9]+(\.[0-9]+){0,}[^0-9\.]+.*$ ]] ||
|
[[ "$SPEC_RELEASE" =~ ^[0-9]+(\.[0-9]+){0,}[^0-9\.]+.*$ ]] ||
|
||||||
{ notify.debug "\
|
notify.error \
|
||||||
$FUNCNAME: SPEC_RELEASE ($SPEC_RELEASE): unsupported format";
|
$"release number: unsupported format"": \"$SPEC_RELEASE\""
|
||||||
exit 1; }
|
|
||||||
|
|
||||||
if [ "$pck_newver" = $SPEC_VERSION ]; then
|
if [ "$pck_newver" = $SPEC_VERSION ]; then
|
||||||
if [ "$pck_newrel" ]; then
|
if [ "$pck_newrel" ]; then
|
||||||
[[ "$pck_newrel" =~ ^[0-9]+.*${DISTRO_rpm}$ ]] || exit 1
|
[[ "$pck_newrel" =~ ^[0-9]+.*${DISTRO_rpm}$ ]] ||
|
||||||
|
notify.error \
|
||||||
|
$"release number: unsupported format"": \"$pck_newrel\""
|
||||||
|
[ "$pck_newrel" '>' "$SPEC_RELEASE" ] ||
|
||||||
|
notify.error $"\
|
||||||
|
new release number \"$pck_newrel\" <= current release \"$SPEC_RELEASE\""
|
||||||
echo "$pck_newrel"
|
echo "$pck_newrel"
|
||||||
else
|
else
|
||||||
local sr_relnum="${SPEC_RELEASE%%[^0-9\.]*}"
|
local sr_relnum="${SPEC_RELEASE%%[^0-9\.]*}"
|
||||||
@ -583,11 +587,12 @@ $FUNCNAME: SPEC_RELEASE ($SPEC_RELEASE): unsupported format";
|
|||||||
|
|
||||||
[[ "$SPEC_RELEASE" =~ ^[0-9]+(\.[0-9]+){1,}[^\.]*$ ]] &&
|
[[ "$SPEC_RELEASE" =~ ^[0-9]+(\.[0-9]+){1,}[^\.]*$ ]] &&
|
||||||
{ echo "${sr_relnum%\.*}.$(( ${sr_relnum/*\./} + 1 ))${DISTRO_rpm}"
|
{ echo "${sr_relnum%\.*}.$(( ${sr_relnum/*\./} + 1 ))${DISTRO_rpm}"
|
||||||
break; }
|
return 0; }
|
||||||
|
|
||||||
# '<[0-9]+><distroid>'
|
# '<[0-9]+><distroid>'
|
||||||
[[ "$SPEC_RELEASE" =~ ^[0-9]+[^0-9]+$ ]] &&
|
[[ "$SPEC_RELEASE" =~ ^[0-9]+[^0-9]+$ ]] &&
|
||||||
{ echo "$(( $sr_relnum + 1 ))${DISTRO_rpm}"; break; }
|
{ echo "$(( $sr_relnum + 1 ))${DISTRO_rpm}"
|
||||||
|
return 0; }
|
||||||
|
|
||||||
# this line should be never reached
|
# this line should be never reached
|
||||||
notify.error $"(bug)"" -- $FUNCNAME: "\
|
notify.error $"(bug)"" -- $FUNCNAME: "\
|
||||||
@ -595,12 +600,7 @@ $"release number: unsupported format"": \"$SPEC_RELEASE\""
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "1${DISTRO_rpm}"
|
echo "1${DISTRO_rpm}"
|
||||||
fi ) || \
|
fi ) || { echo "$SPEC_RELEASE"; return 1; }
|
||||||
{ echo "$SPEC_RELEASE"
|
|
||||||
[ "$pck_newrel" ] && notify.error \
|
|
||||||
$"release number: unsupported format"": \"$pck_newrel\"" ||
|
|
||||||
notify.error \
|
|
||||||
$"release number: unsupported format"": \"$SPEC_RELEASE\""; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# function specfile.checksintax()
|
# function specfile.checksintax()
|
||||||
@ -1479,8 +1479,11 @@ s|\(.*[ \t]*${define_list_name[$i]}[ \t]*\).*|\1${define_list_value[$i]}|}" \
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local specfile_newrelease="\
|
# NOTE: local specfile_newrelease="$(...)" does not work!
|
||||||
|
local specfile_newrelease
|
||||||
|
specfile_newrelease="\
|
||||||
$(specfile.newrelease "$pck_newver" "$pck_newrel")"
|
$(specfile.newrelease "$pck_newver" "$pck_newrel")"
|
||||||
|
[ $? -eq 0 ] || exit 1
|
||||||
|
|
||||||
if [ "$spec_format" = 1 ]; then
|
if [ "$spec_format" = 1 ]; then
|
||||||
notify.debug $"specfile autoformattig enabled"
|
notify.debug $"specfile autoformattig enabled"
|
||||||
|
@ -226,7 +226,10 @@ msgid "missing mandatory arg"
|
|||||||
msgstr "parametro mancante"
|
msgstr "parametro mancante"
|
||||||
|
|
||||||
msgid "release number: unsupported format"
|
msgid "release number: unsupported format"
|
||||||
msgstr "release: formato non supportato"
|
msgstr "numero di release: formato non supportato"
|
||||||
|
|
||||||
|
msgid "new release \\`$pck_newrel' must be greater than current one \\`$SPEC_RELEASE'"
|
||||||
|
msgstr "la nuova release \\`$pck_newrel' deve essere maggiore di quella corrente \\`$SPEC_RELEASE'"
|
||||||
|
|
||||||
msgid "checking"
|
msgid "checking"
|
||||||
msgstr "sto controllando"
|
msgstr "sto controllando"
|
||||||
|
Loading…
Reference in New Issue
Block a user