pck-update: infofile.create(): honour %_specdir and %_sourcedir when checking for syntax errors in the specfiles

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
This commit is contained in:
Davide Madrisan 2012-02-05 16:26:50 +01:00
parent 76e829f045
commit 7c7004d1e8
2 changed files with 14 additions and 5 deletions

View File

@ -17,6 +17,11 @@ Changes in version 1.9.2
* pck-update - Davide Madrisan:
Action 6: fix for /lib/ld-linux.so.2 -> ld-2.14.1.so
* pck-update - Davide Madrisan:
Honour `%_specdir' and `%_sourcedir' when checking for syntax errors in the
specfiles by running `rpm -q --specfile --specedit ...'.
(Problem detected by Silvan Calarco).
--------------------------------------------------------------------------------
Changes in version 1.9.1

View File

@ -443,11 +443,15 @@ done)"
[ $? -eq 0 ] || notify.error $"can't create temporary files"
notify.debug "tmpspreprerr = \`${NOTE}$tmpspreprerr${NORM}'"
notify.debug "running: \
rpm -q $USER_RPMDEFINE_OPTS --specfile --specedit $SRPM_SPECFILE_WITH_PATH ..."
local rpmbuild_opts="\
--define=\"%_specdir $spec_dir\" --define=\"%_sourcedir $source_dir\""
notify.debug "running: rpm -q $rpmbuild_opts $USER_RPMDEFINE_OPTS \
--specfile --specedit $SRPM_SPECFILE_WITH_PATH ..."
eval "\
rpm -q $USER_RPMDEFINE_OPTS --specfile --specedit $SRPM_SPECFILE_WITH_PATH \
rpm -q $rpmbuild_opts $USER_RPMDEFINE_OPTS --specfile --specedit\
$SRPM_SPECFILE_WITH_PATH \
2> $tmpspreprerr >> $specfile_preprocessed"
[ -s "$tmpspreprerr" ] &&
{ notify.error $"specfile has errors:""\n$(\