Bug 12100 - rpm 3.0.4 is not portable, confused about glob.h
rpm 3.0.4 is not portable, confused about glob.h
Status: CLOSED WORKSFORME
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
6.2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-06-11 19:06 EDT by espie
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-06-14 09:15:31 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 espie 2000-06-11 19:06:27 EDT
When GNU glob is selected on a system where glob.h is present
(OpenBSD 2.7), compilation doesn't work, since misc/glob.h
conflicts with /usr/include/glob.h (defines glob_t).

To reproduce, set USE_GNU_GLOB and HAVE_GLOB_H to 1 in the
configuration file...
Ensure that you have a /usr/include/glob.h that conflicts with
misc/glob.h (say,
typedef struct {
        int gl_pathc;           /* Count of total paths so far. */
        int gl_matchc;          /* Count of paths matching pattern. */
        int gl_offs;            /* Reserved at beginning of gl_pathv. */
        int gl_flags;           /* Copy of flags parameter to glob. */
        char **gl_pathv;        /* List of paths matching pattern. */
                                /* Copy of errfunc parameter to glob. */
        int (*gl_errfunc) __P((const char *, int));

        /*
         * Alternate filesystem access methods for glob; replacement
         * versions of closedir(3), readdir(3), opendir(3), stat(2)
         * and lstat(2).
         */
        void (*gl_closedir) __P((void *));
        struct dirent *(*gl_readdir) __P((void *));
        void *(*gl_opendir) __P((const char *));
        int (*gl_lstat) __P((const char *, struct stat *));
        int (*gl_stat) __P((const char *, struct stat *));
} glob_t;
typedef struct {
        int gl_pathc;           /* Count of total paths so far. */
        int gl_matchc;          /* Count of paths matching pattern. */
        int gl_offs;            /* Reserved at beginning of gl_pathv. */
        int gl_flags;           /* Copy of flags parameter to glob. */
        char **gl_pathv;        /* List of paths matching pattern. */
                                /* Copy of errfunc parameter to glob. */
        int (*gl_errfunc) __P((const char *, int));

        /*
         * Alternate filesystem access methods for glob; replacement
         * versions of closedir(3), readdir(3), opendir(3), stat(2)
         * and lstat(2).
         */
        void (*gl_closedir) __P((void *));
        struct dirent *(*gl_readdir) __P((void *));
        void *(*gl_opendir) __P((const char *));
        int (*gl_lstat) __P((const char *, struct stat *));
        int (*gl_stat) __P((const char *, struct stat *));
} glob_t;

for instance),
build fails with:

/usr/include/glob.h:67: conflicting types for `glob_t'
/home/espie/rpm/work/rpm-3.0.4/misc/glob.h:100: warning: this is the
location of the previous definition
In file included from /home/espie/rpm/work/rpm-3.0.4/lib/rpmio.h:7,
                 from /home/espie/rpm/work/rpm-3.0.4/lib/rpmlib.h:8,
                 from /home/espie/rpm/work/rpm-3.0.4/build/rpmbuild.h:8,
                 from /home/espie/rpm/work/rpm-3.0.4/build/build.c:7:

Compiling is easy: don't reference <glob.h> from rpmio.h.
Installation is probably slightly trickier: if gnu glob needs installing,
it should be put at the same place that rpm headers are, to avoid
conflicting with system headers.This probably involves generating header
files that do the right thing, or installing rpm's config.h along...
Comment 1 Jeff Johnson 2000-06-14 09:15:29 EDT
rpm should use the internal GNU glob, not the native system glob, always.

I suppose it's time for <rpmglob.h> ...
Comment 2 Jeff Johnson 2000-07-31 12:58:21 EDT
AFAIK, rpm-4.0 has checks to force using an internal GNU glob that should "work:
on
all non-GNU platforms. If that's *NOT* the case, please send me a patch to the
configuration check, not a patch to use the system glob, as there is
functionality
in GNU glob that is used by rpm.

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