Bug 135097 - error: Macro % has illegal name (%define)
error: Macro % has illegal name (%define)
Status: CLOSED WORKSFORME
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: rpm (Show other bugs)
3.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-08 12:38 EDT by Marius Onica
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-08 16:26:43 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)

  None (edit)
Description Marius Onica 2004-10-08 12:38:30 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.3)
Gecko/20041001

Description of problem:
After installing an up to day updated Linux Enterprise Linux AS with
rpm version 4.2.3-10 I receive this:

error: Macro % has illegal name (%define). Apart from that message
everything seems normal. If you make an upgrade to an older rpm
package (aka if you have an older install and upgrade to date) this
bug doesn't appear, only if we made a fresh install.

From gdb:
286         (void) poptReadConfigFile(optCon, LIBRPMALIAS_FILENAME);
(gdb)
287         (void) poptReadDefaultConfig(optCon, 1);
(gdb)
288         poptSetExecPath(optCon, RPMCONFIGDIR, 1);
(gdb)
290         while ((arg = poptGetNextOpt(optCon)) > 0) {
(gdb)
300         if (arg < -1) {
(gdb)
307         rpmcliConfigured();
(gdb)
error: Macro % has illegal name (%define)
330       if (bigMode == MODE_UNKNOWN || (bigMode & MODES_DB)) {
(gdb)
331         if (da->init) {
(gdb)
337         if (da->rebuild) {


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


How reproducible:
Always

Steps to Reproduce:
1.launch rpm with or without arguments
2.
3.
    

Additional info:
Comment 1 Jeff Johnson 2004-10-08 16:26:43 EDT
There's a typo in some macro initialization file,
perhaps redhat-rpm-config, perhaps some other package,
perhaps in local customization.

Try "strace -o /tmp/xxx rpm --showrc", then look
at the open's in /tmp/xxx, looking for the open
just before the error message, to identify which
file has a problem.
Comment 2 Marius Onica 2004-10-11 06:10:13 EDT
Thanks for help. After some digging I found that the file
/etc/rpm/macros.solve has wrong content, namely:

#The path to the dependency universe database. The default value
#is the rpmdb-redhat location. The macro is usually defined in
#/etc/rpm/macros.solve, installed with the rpmdb-redhat package.
/usr/lib/rpmdb/i386-redhat-linux/redhat  
usr/lib/rpmdb/i386-redhat-linux/redhat

#The path to the dependency universe packages. This should
#be a path to the packages contained in the solve database.
/mnt/redhat/test/latest-i386/RedHat/RPMS/
/mnt/redhat/test/latest-i386/RedHat/RPMS/

#The output binary package file name template used when suggesting
#binary packages that solve a dependency. The macro is usually defined
#in /etc/rpm/macros.solve, installed with the rpmdb-redhat package.
#
# XXX   Note: escaped %% for use in headerSprintf()
%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm      
/mnt/redhat/test/latest-i386/RedHat/RPMS/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
.

After modifying the following in rpmdb-redhat.spec.in :
%_solve_dbpath     -> %%_solve_dbpath
%_solve_pkgsdir    -> %%_solve_pkgsdir
%_solve_name_fmt   -> %%_solve_name_fmt
%{?_solve_pkgsdir} -> %%{?_solve_pkgsdir}
 everything is ok.

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