libspec.lib: better separation of the autospec and rpm output when reporting a syntax error of a specfile

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
This commit is contained in:
Davide Madrisan 2012-12-09 20:44:31 +01:00
parent 3c4d5b7880
commit 45b271e4c9
3 changed files with 16 additions and 5 deletions

View File

@ -16,6 +16,13 @@ Changes in version 1.16.2
* lib/libmsgmng.lib - Davide Madrisan:
Translate "ERROR", "WARNING", and "DEBUG".
* lib/libspec.lib - Davide Madrisan:
Better error reporting in case of syntax errors in the specfiles.
+ update
* po/it/autospec.po - Davide Madrisan:
Update the tranlation file.
-------------------------------------------------------------------------------
Changes in version 1.16.1

View File

@ -645,15 +645,16 @@ rpm -q $rpm_options --specfile --specedit $specfile \
> $specfile_preprocessed 2> $tmpspreprerr"
if [ -s "$tmpspreprerr" ]; then
notify.warning $"the specfile has some syntax errors:"
notify.warning $"\
the specfile has some syntax errors"" ("$"rpm output""):"
while read line; do
notify.warning " $line"
echo " $line"
done < $tmpspreprerr
elif [ -z "$(grep "^%changelog" $specfile_preprocessed 2>/dev/null)" ]; then
# try to catch some other syntax errors even if rpm exit with
# a zero return code and no messages are sent to stderr
# FIXME: we assume "%changelog" is the last part of the specfile
notify.warning $"the specfile has some syntax errors:"
notify.warning $"the specfile has some syntax errors"":"
while read line; do
notify.warning " $line"
done < <(tail -n 3 $specfile_preprocessed)

View File

@ -550,8 +550,11 @@ msgstr "specfile con fine linea CR"
msgid "specfile with an unsupported format"
msgstr "specfile in formato non supportato"
msgid "the specfile has some syntax errors:"
msgstr "lo specfile ha degli errori di sintassi:"
msgid "the specfile has some syntax errors"
msgstr "lo specfile ha degli errori di sintassi"
msgid "rpm output"
msgstr "output rpm"
msgid "the error should be here!"
msgstr "l'errore dovrebbe essere qui!"