Bug 112741 - add =~ and !~ operators for specfiles
Summary: add =~ and !~ operators for specfiles
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: rpm   
(Show other bugs)
Version: 1.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact: Mike McLean
Depends On:
TreeView+ depends on / blocked
Reported: 2003-12-30 14:37 UTC by Frank Cusack
Modified: 2007-04-18 17:00 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-04-19 19:00:18 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Add a like operator for the specfile parser. (2.79 KB, patch)
2003-12-30 14:38 UTC, Frank Cusack
no flags Details | Diff

Description Frank Cusack 2003-12-30 14:37:07 UTC
By default, GNU config.guess seems to add the release to the os name
for solaris, eg sparc-sun-solaris2.9.  Why it does this, hey I don't
know.  But I guess it can be a useful way to distinguish features
between versions without having to look at further information.

In a specfile, I'd like to match against any version.  I figure
an easy way to do this is with a like operator.

%if %{_target_os} =~ "solaris2.*"

Maybe this operator could be more generally useful as well.
Anyway, it was pretty easy to work up the code, patch is coming.
See what you think.

Comment 1 Frank Cusack 2003-12-30 14:38:10 UTC
Created attachment 96732 [details]
Add a like operator for the specfile parser.

Sorry, I don't know Doxygen.

Comment 2 Jeff Johnson 2003-12-30 15:17:38 UTC
Build tests based on arch are fatally flawed by design, it's the
wrong name space for packaging (think: spec files are not
like cross-compiling *.c).

Adding loosey-goosey regex matches isn't the right thing to
do because it just postpones the day of doom needlessly

The %if syntax (which is line oriented) has never fit in
well with macro expansion (which is stream oriented).
The entire %if expression parser needs scrap somewhen,
possibly soon.

Otherwise, the patch looks fine.

NEEDINFO so's I don't have to stare at the bug report.

Comment 3 Leonard den Ottolander 2004-04-13 14:16:41 UTC
If the patch is ok, but you are not going to use it because it "isn't
the right thing to do", why not close this WONTFIX?

Note You need to log in before you can comment on or make changes to this bug.