Bug 112741 - add =~ and !~ operators for specfiles
add =~ and !~ operators for specfiles
Status: CLOSED WONTFIX
Product: Red Hat Raw Hide
Classification: Retired
Component: rpm (Show other bugs)
1.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-12-30 09:37 EST by Frank Cusack
Modified: 2007-04-18 13:00 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-04-19 15:00:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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 09:38 EST, Frank Cusack
no flags Details | Diff

  None (edit)
Description Frank Cusack 2003-12-30 09:37:07 EST
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.*"
...
%endif

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 09:38:10 EST
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 10:17:38 EST
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 10:16:41 EDT
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.