Re: Appreciate advice on %if %foo || %bar syntax

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

 



In regard to: Re: Appreciate advice on %if %foo || %bar syntax, Tony...:

%define is_rhel5 %(test -f /etc/redhat-release && cat /etc/redhat-release | egrep -q 'release 5' && echo 1 || echo 0)

Thanks from somebody else :)

Quite another thing is, that a more rational test would be something like:

"test -f /etc/redhat-release && grep 'release 5' /etc/redhat-release &&
echo 1 || echo 0"

Except you probably want the -q option to grep, otherwise your macro might
end up resulting in

	release 51

Getting rid of the useless cat was a good move, but I don't see any reason
to prefer grep over egrep here.

Tim
--
Tim Mooney                              mooney@xxxxxxxxxxxxxxxxxxxxxxxxx
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J6, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux