changelog stamp broken w/ big endian 64 bit time_t (Stephane Erania).
authorjbj <devnull@localhost>
Tue, 6 Jul 1999 17:32:49 +0000 (17:32 +0000)
committerjbj <devnull@localhost>
Tue, 6 Jul 1999 17:32:49 +0000 (17:32 +0000)
CVS patchset: 3129
CVS date: 1999/07/06 17:32:49

CHANGES
build/parseChangelog.c
lib/header.c
lib/query.c
po/rpm.pot

diff --git a/CHANGES b/CHANGES
index 54a2bae..3e513c5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -22,6 +22,7 @@
        - avoid numeric overflow in version comparison (Thayne Harbaugh<tharbaug@liberate.com>).
        - move url.c and ftp.c to rpmlib right next to query.
        - 12 more dead strtoks.
+       - changelog stamp broken w/ big endian 64 bit time_t (Stephane Erania).
 
 3.0 -> 3.0.1
        - fix: %verifyscript resurrected (Shing-Gene Yung).
index f712461..324f3f0 100644 (file)
@@ -2,18 +2,19 @@
 
 #include "rpmbuild.h"
 
-static void addChangelogEntry(Header h, int time, char *name, char *text)
+static void addChangelogEntry(Header h, time_t time, char *name, char *text)
 {
+    int_32 mytime = time;      /* XXX convert to header representation */
     if (headerIsEntry(h, RPMTAG_CHANGELOGTIME)) {
        headerAppendEntry(h, RPMTAG_CHANGELOGTIME, RPM_INT32_TYPE,
-                         &time, 1);
+                         &mytime, 1);
        headerAppendEntry(h, RPMTAG_CHANGELOGNAME, RPM_STRING_ARRAY_TYPE,
                          &name, 1);
        headerAppendEntry(h, RPMTAG_CHANGELOGTEXT, RPM_STRING_ARRAY_TYPE,
                         &text, 1);
     } else {
        headerAddEntry(h, RPMTAG_CHANGELOGTIME, RPM_INT32_TYPE,
-                      &time, 1);
+                      &mytime, 1);
        headerAddEntry(h, RPMTAG_CHANGELOGNAME, RPM_STRING_ARRAY_TYPE,
                       &name, 1);
        headerAddEntry(h, RPMTAG_CHANGELOGTEXT, RPM_STRING_ARRAY_TYPE,
@@ -88,7 +89,8 @@ static int addChangelog(Header h, StringBuf sb)
 {
     char *s;
     int i;
-    int time, lastTime = 0;
+    time_t time;
+    time_t lastTime = 0;
     char *date, *name, *text, *next;
 
     s = getStringBuf(sb);
@@ -120,7 +122,7 @@ static int addChangelog(Header h, StringBuf sb)
            SKIPNONSPACE(s);
        }
        SKIPSPACE(date);
-       if (dateToTimet(date, (time_t *)&time)) {
+       if (dateToTimet(date, &time)) {
            rpmError(RPMERR_BADSPEC, _("bad date in %%changelog: %s"), date);
            return RPMERR_BADSPEC;
        }
index 6023b67..2d06caf 100644 (file)
@@ -2000,7 +2000,6 @@ static char * realDateFormat(int_32 type, const void * data,
                             char * formatPrefix, int padding, int element,
                             char * strftimeFormat) {
     char * val;
-    time_t dateint;
     struct tm * tstruct;
     char buf[50];
 
@@ -2012,8 +2011,9 @@ static char * realDateFormat(int_32 type, const void * data,
        strcat(formatPrefix, "s");
 
        /* this is important if sizeof(int_32) ! sizeof(time_t) */
-       dateint = *((int_32 *) data);
-       tstruct = localtime(&dateint);
+       {   time_t dateint = *((int_32 *) data);
+           tstruct = localtime(&dateint);
+       }
        (void)strftime(buf, sizeof(buf) - 1, strftimeFormat, tstruct);
        sprintf(val, formatPrefix, buf);
     }
index b10011d..2c6ebd9 100644 (file)
@@ -362,8 +362,6 @@ static void printFileInfo(char * name, unsigned int size, unsigned short mode,
     char sizefield[15];
     char ownerfield[9], groupfield[9];
     char timefield[100] = "";
-    time_t themtime;
-    time_t currenttime;
     static int thisYear = 0;
     static int thisMonth = 0;
     struct tm * tstruct;
@@ -373,7 +371,7 @@ static void printFileInfo(char * name, unsigned int size, unsigned short mode,
     perms = permsString(mode);
 
     if (!thisYear) {
-       currenttime = time(NULL);
+       time_t currenttime = time(NULL);
        tstruct = localtime(&currenttime);
        thisYear = tstruct->tm_year;
        thisMonth = tstruct->tm_mon;
@@ -408,8 +406,9 @@ static void printFileInfo(char * name, unsigned int size, unsigned short mode,
     }
 
     /* this is important if sizeof(int_32) ! sizeof(time_t) */
-    themtime = mtime;
-    tstruct = localtime(&themtime);
+    {  time_t themtime = mtime;
+       tstruct = localtime(&themtime);
+    }
 
     if (tstruct->tm_year == thisYear || 
       ((tstruct->tm_year + 1) == thisYear && tstruct->tm_mon > thisMonth)) 
index 9b2694f..3e6f7b4 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-07-03 18:48-0400\n"
+"POT-Creation-Date: 1999-07-06 13:15-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -1785,27 +1785,27 @@ msgstr ""
 msgid "line %d: second %s"
 msgstr ""
 
-#: ../build/parseChangelog.c:101
+#: ../build/parseChangelog.c:103
 msgid "%%changelog entries must start with *"
 msgstr ""
 
-#: ../build/parseChangelog.c:109
+#: ../build/parseChangelog.c:111
 msgid "incomplete %%changelog entry"
 msgstr ""
 
-#: ../build/parseChangelog.c:124
+#: ../build/parseChangelog.c:126
 msgid "bad date in %%changelog: %s"
 msgstr ""
 
-#: ../build/parseChangelog.c:129
+#: ../build/parseChangelog.c:131
 msgid "%%changelog not in decending chronological order"
 msgstr ""
 
-#: ../build/parseChangelog.c:137 ../build/parseChangelog.c:148
+#: ../build/parseChangelog.c:139 ../build/parseChangelog.c:150
 msgid "missing name in %%changelog"
 msgstr ""
 
-#: ../build/parseChangelog.c:155
+#: ../build/parseChangelog.c:157
 msgid "no description in %%changelog"
 msgstr ""