libspec: 'rpm -q --specfile --specedit <specfile>' does not always exit with an error code when the specfiles have syntax errors. Try to catch these problems.

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
This commit is contained in:
Davide Madrisan 2012-12-08 23:59:53 +01:00
parent 58edaf3373
commit ee9a2c72b2
2 changed files with 10 additions and 1 deletions

View File

@ -6,6 +6,13 @@ Changes in version 1.16.2
New function 'specfile.check_syntax()' based on the code previously
located in the module pck-update (function 'infofile.create()').
+ improvement
* lib/libspec.lib - Davide Madrisan:
'rpm -q --specfile --specedit <specfile>' does not always exit with an
error code when the specfiles have syntax errors.
Try to catch these problems too.
(This problem has been pointed out by Silvan Calarco).
-------------------------------------------------------------------------------
Changes in version 1.16.1

View File

@ -644,7 +644,9 @@ $FUNCNAME: running: rpm -q $rpm_options --specfile --specedit $specfile ..."
rpm -q $rpm_options --specfile --specedit $specfile \
> $specfile_preprocessed 2> $tmpspreprerr"
[ -s "$tmpspreprerr" ] &&
[[ -s "$tmpspreprerr" ||
$(cat $specfile_preprocessed | wc -l) -lt \
$(cat $specfile | wc -l) ]] &&
{ notify.warning $"specfile has errors:"
while read line; do
notify.warning " $line"