From: Jan Rękorajski Date: Tue, 29 Oct 2013 00:36:41 +0000 (+0100) Subject: do not remove macros.build from macrofiles for parsing spec X-Git-Tag: AC-branch X-Git-Url: https://git.pld-linux.org/?p=packages%2Frpm-build-tools.git;a=commitdiff_plain;h=202b825e4bf39de168b9939434900024e14841d9 do not remove macros.build from macrofiles for parsing spec If macros from macros.build are used before %prep then removing them from list will cause severe, mysterious breakage. Like 'parse error in expression' during macro evaulation. --- diff --git a/builder.sh b/builder.sh index 35b7f0f..47336ad 100755 --- a/builder.sh +++ b/builder.sh @@ -581,10 +581,7 @@ set_spec_target() { # runs rpm with minimal macroset minirpm() { - # we reset macros not to contain macros.build as all the %() macros are - # executed here, while none of them are actually needed. - # at the time of this writing macros.build + macros contained 70 "%(...)" macros. - safe_macrofiles=$(rpm $TARGET_SWITCH --showrc | awk -F: '/^macrofiles/ { gsub(/^macrofiles[ \t]+:/, "", $0); gsub(/:.*macros.build:/, ":", $0); print $0 } ') + safe_macrofiles=$(rpm $TARGET_SWITCH --showrc | awk -F: '/^macrofiles/ { gsub(/^macrofiles[ \t]+:/, "", $0); print $0 } ') # TODO: move these to /usr/lib/rpm/macros cat > $BUILDER_MACROS <<'EOF'