Bug 113934 - SRPMS: test for MMN version it too fragile
SRPMS: test for MMN version it too fragile
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: httpd (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Joe Orton
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-01-20 07:55 EST by Sysoltsev Slawa
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-03-23 04:48:55 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch that would fix described problem (601 bytes, patch)
2004-01-20 07:59 EST, Sysoltsev Slawa
no flags Details | Diff

  None (edit)
Description Sysoltsev Slawa 2004-01-20 07:55:49 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6)
Gecko/20040113

Description of problem:
I tried to build httpd package by Intel compiler and got a problem:



20020903' '!=' x20020903
#: Error: Upstream MMN is now 20020903, packaged MMN is 20020903.
#: Update the mmn macro and rebuild.
#exit 1

The problem is that to get MMN version C preprocessor is used: 
echo MODULE_MAGIC_NUMBER_MAJOR | cpp -include `pwd`/include/ap_mmn.h |
grep -v '#'
without grep �v this would give with gcc:
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "/users/compiler/tc_5/WORK_DIR/BUILD/httpd-2.0.46/include/ap_mmn.h" 1
# 2 "<command line>" 2
# 1 "<stdin>"
20020903

The reason this test doesn�t work with Intel compiler is in different
control of empty lines in preprocessor output: gcc uses #line
directive to jump over few empty lines of output, Intel compiler
simply leaves these empty lines, so the output of `echo
MODULE_MAGIC_NUMBER_MAJOR | cpp -include `pwd`/include/ap_mmn.h` has
got many empty lines. To get MMN version in this case these empty
lines must be cut along with gcc�s #line directives, so to get MMN
version you should use:
`echo MODULE_MAGIC_NUMBER_MAJOR | cpp -include `pwd`/include/ap_mmn.h
| grep -v '#' | grep -v �^[[:space:]]*$�`

This little enhancement would make test for MMN a bit more robust.


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. make the wrapper called cpp, that would add -x c - to the command
line and call Intel compiler for C preprocessing
2. make sure your hand-made wrapper is in PATH before system cpp
3. try to build httpd from source rpm
    

Actual Results:  error emitted by check in spec file:
#: Error: Upstream MMN is now 20020903, packaged MMN is 20020903.
#: Update the mmn macro and rebuild.


Expected Results:  succesfully built package

Additional info:
Comment 1 Sysoltsev Slawa 2004-01-20 07:59:28 EST
Created attachment 97120 [details]
Patch that would fix described problem
Comment 2 Joe Orton 2004-01-20 08:06:32 EST
Replacing the greps with:
   sed -n '/^2/p'
is the simplest solution, can you try that with icc?
Comment 3 Sysoltsev Slawa 2004-01-20 08:10:39 EST
super! works well.
Comment 4 Joe Orton 2004-01-20 10:12:01 EST
Fixed in 2.0.48-9 for Raw Hide; leaving open for inclusion in future
RHEL3 update.
Comment 5 Mark J. Cox (Product Security) 2004-03-23 04:48:55 EST
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2004-084.html

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