diff --git a/lib/libspec.lib.in b/lib/libspec.lib.in index d85f0fe..f8d9170 100644 --- a/lib/libspec.lib.in +++ b/lib/libspec.lib.in @@ -644,19 +644,22 @@ $FUNCNAME: running: rpm -q $rpm_options --specfile --specedit $specfile ..." rpm -q $rpm_options --specfile --specedit $specfile \ > $specfile_preprocessed 2> $tmpspreprerr" - [[ -s "$tmpspreprerr" || - $(cat $specfile_preprocessed | wc -l) -lt \ - $(cat $specfile | wc -l) ]] && - { notify.warning $"specfile has errors:" + if [ -s "$tmpspreprerr" ]; then + notify.warning $"the specfile has some syntax errors:" while read line; do notify.warning " $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:" while read line; do notify.warning " $line" done < <(tail -n 3 $specfile_preprocessed) notify.warning ">>" - notify.warning " "$"the error should be here!"; } + notify.warning " "$"the error should be here!" + fi rm -f $tmpspreprerr } diff --git a/po/it/autospec.po b/po/it/autospec.po index b5625d5..5e0b648 100644 --- a/po/it/autospec.po +++ b/po/it/autospec.po @@ -550,8 +550,8 @@ msgstr "specfile con fine linea CR" msgid "specfile with an unsupported format" msgstr "specfile in formato non supportato" -msgid "specfile has errors:" -msgstr "lo specfile contiene degli errori:" +msgid "the specfile has some syntax errors:" +msgstr "lo specfile ha degli errori di sintassi:" msgid "the error should be here!" msgstr "l'errore dovrebbe essere qui!"