Re: [PATCH] spec: Guess rhel/fedora macros from dist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 16, 2011 at 09:31:13 -0600, Eric Blake wrote:
> This works for one-shot evaluation:
> 
> # if neither fedora nor rhel was defined, try to guess them from %{dist}
> %if !0%{?rhel} && !0%{?fedora}
> %define rhel %{lua: v=string.match(rpm.expand("%{?dist}"),
>   "^%.el([0-9]+).*"); if v ~= nil then print(v) end}
> %define fedora %{lua: v=string.match(rpm.expand("%{?dist}"),
>  "^%.fc?([0-9]+).*"); if v ~= nil then print(v) end}
> %endif

Hmm, this is nice in avoiding forks but it unfortunately doesn't seem to work
on RHEL-5:

error: lua script failed: [string "<lua>"]:1: attempt to call field `match' (a nil value)
  1<   (empty)
  0< %if 0
error: line 18: %if 0

Jirka

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]