Jeff Johnson's mode/dev fixes
authormarc <devnull@localhost>
Sat, 28 Feb 1998 20:29:11 +0000 (20:29 +0000)
committermarc <devnull@localhost>
Sat, 28 Feb 1998 20:29:11 +0000 (20:29 +0000)
CVS patchset: 2014
CVS date: 1998/02/28 20:29:11

CHANGES
build/files.c

diff --git a/CHANGES b/CHANGES
index dcf3908..e3e5c7e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,7 @@
        - added comments about modifictation to base popt and rpmrc files
        - allow spaces in group names
        - fix bug in memory allocation of special doc stuff
+       - Jeff Johnson's mode/dev fixes
 
 2.4.101 -> 2.4.102:
        - fixed spelling of "instchangelog" in lib-rpmrc.in
index 41ec9fc..ed4050d 100644 (file)
@@ -539,12 +539,30 @@ static void genCpioListAndHeader(struct FileList *fl,
                               &(p->gname), 1);
        headerAddOrAppendEntry(h, RPMTAG_FILEMTIMES, RPM_INT32_TYPE,
                               &(p->mtime), 1);
+    if (sizeof(p->mode) != sizeof(uint_16)) {
+       uint_16 pmode = (uint_16)p->mode;
+       headerAddOrAppendEntry(h, RPMTAG_FILEMODES, RPM_INT16_TYPE,
+                              &(pmode), 1);
+    } else {
        headerAddOrAppendEntry(h, RPMTAG_FILEMODES, RPM_INT16_TYPE,
                               &(p->mode), 1);
+    }
+    if (sizeof(p->rdev) != sizeof(uint_16)) {
+       uint_16 prdev = (uint_16)p->rdev;
+       headerAddOrAppendEntry(h, RPMTAG_FILERDEVS, RPM_INT16_TYPE,
+                              &(prdev), 1);
+    } else {
        headerAddOrAppendEntry(h, RPMTAG_FILERDEVS, RPM_INT16_TYPE,
                               &(p->rdev), 1);
+    }
+    if (sizeof(p->device) != sizeof(uint_32)) {
+       uint_32 pdevice = (uint_32)p->device;
+       headerAddOrAppendEntry(h, RPMTAG_FILEDEVICES, RPM_INT32_TYPE,
+                              &(pdevice), 1);
+    } else {
        headerAddOrAppendEntry(h, RPMTAG_FILEDEVICES, RPM_INT32_TYPE,
                               &(p->device), 1);
+    }
        headerAddOrAppendEntry(h, RPMTAG_FILEINODES, RPM_INT32_TYPE,
                               &(p->inode), 1);
        headerAddOrAppendEntry(h, RPMTAG_FILELANGS, RPM_STRING_ARRAY_TYPE,