Bug 1293 - Bug in genhdlist with non-RPM files
Summary: Bug in genhdlist with non-RPM files
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: basesystem
Version: 5.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: David Lawrence
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-02-23 11:37 UTC by mok
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 1999-02-23 15:38:21 UTC
Embargoed:


Attachments (Terms of Use)

Description mok 1999-02-23 11:37:29 UTC
There is a bug in the genhdlist program, that makes it fail
if it meets a non-RPM file, thereby generating an empty
hdlist file. This is a problem because many ftp mirrors seem
to keep ls-lR files in every directory. Here is a patch to
fix it:

*** genhdlist.c.orig    Fri Nov 27 12:08:13 1998
--- genhdlist.c Fri Nov 27 12:08:20 1998
***************
*** 12,23 ****
--- 12,26 ----

  #define FILENAME_TAG 1000000

+ /* Not used apparently...
+
  int tags[] =  { RPMTAG_NAME, RPMTAG_VERSION,
RPMTAG_RELEASE,
RPMTAG_SERIAL,
                RPMTAG_FILENAMES, RPMTAG_FILESIZES,
RPMTAG_GROUP,
                RPMTAG_REQUIREFLAGS, RPMTAG_REQUIRENAME,
RPMTAG_REQUIREVERSION,
                RPMTAG_DESCRIPTION, RPMTAG_SUMMARY,
RPMTAG_PROVIDES,
                RPMTAG_SIZE, RPMTAG_OBSOLETES };
  int numTags = sizeof(tags) / sizeof(int);
+ */

  int main(int argc, char ** argv) {
      char buf[300];
***************
*** 26,34 ****
--- 29,39 ----
      struct dirent * ent;
      int fd, rc, isSource;
      Header h;
+     /* not used
      int count, type;
      int i;
      void * ptr;
+     */

      if (argc != 2) {
        fprintf(stderr, "usage: genhdlist <dir>\n");
***************
*** 74,79 ****
--- 79,85 ----

            rc = rpmReadPackageHeader(fd, &h, &isSource,
NULL, NULL);

+           if (!rc) {
            headerRemoveEntry(h, RPMTAG_POSTIN);
            headerRemoveEntry(h, RPMTAG_POSTUN);
            headerRemoveEntry(h, RPMTAG_PREIN);
***************
*** 110,115 ****
--- 116,122 ----
            headerWrite(outfd, h, HEADER_MAGIC_YES);
            headerFree(h);
            close(fd);
+           }
        }

        errno = 0;

Comment 1 Bill Nottingham 1999-02-23 15:38:59 UTC
this has been fixed, as of some point after RHL 5.2 was released.


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