Dyno Fu
Dyno Fu

Reputation: 9044

how to define a rpm spec macro with empty body?

the problem is quite easy to exhibit:

rpm --eval "%define xyz"
error: Macro %xyz has empty body

i want to get the patch_level and echo_dist may return sles11 or sles11sp1, for sle1s11 i just want the patch_level to be an empty string, but that leads to the empty body error.

rpm --eval "%{expand: %%define patch_level %(echo_dist | sed -e "s/sles11//")}

i am not fully understand the rpm spec file, any suggestion to the problem?

Upvotes: 13

Views: 11954

Answers (2)

user318904
user318904

Reputation: 3066

This might be what you are looking for:

%define xyz %{nil}

Upvotes: 28

m1tk4
m1tk4

Reputation: 3467

Try

%define xyz %100

supposed to expand to the 100's parameter to the macro which will be empty.

Upvotes: 2

Related Questions