From 45b271e4c919ba217d1c20c492fa6c070401f266 Mon Sep 17 00:00:00 2001 From: Davide Madrisan Date: Sun, 9 Dec 2012 20:44:31 +0100 Subject: [PATCH] libspec.lib: better separation of the autospec and rpm output when reporting a syntax error of a specfile Signed-off-by: Davide Madrisan --- ChangeLog | 7 +++++++ lib/libspec.lib.in | 7 ++++--- po/it/autospec.po | 7 +++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 64a903a..d428ee5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/lib/libspec.lib.in b/lib/libspec.lib.in index f8d9170..b0da1c1 100644 --- a/lib/libspec.lib.in +++ b/lib/libspec.lib.in @@ -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) diff --git a/po/it/autospec.po b/po/it/autospec.po index 5e0b648..326395d 100644 --- a/po/it/autospec.po +++ b/po/it/autospec.po @@ -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!"