From 7c0759972587a00e3f3098b9f0c9dfc3f6685d80 Mon Sep 17 00:00:00 2001 From: bsd Date: Fri, 26 Jan 2001 20:45:05 +0000 Subject: [PATCH] Hmmm ... cvs co -D does not work. Change the revision timestamp to a full date/time value. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@56 81a1dc3b-b13d-400b-aceb-764788c761c2 --- main.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/main.c b/main.c index cec0d818..1f8b31da 100644 --- a/main.c +++ b/main.c @@ -204,7 +204,7 @@ int parse_cvsid ( char * cvsid, char * name, char * rev, char * datetime ) } -int print_module_versions ( FILE * outf ) +int print_module_versions ( FILE * outf, char * timestamp ) { char name[64], rev[16], datetime[64]; int y, m, d, h, min, s; @@ -221,7 +221,7 @@ int print_module_versions ( FILE * outf ) if (rc != 6) { fprintf(stderr, "%s: module version scan error, rc=%d\n", progname, rc); } - else { + else if (timestamp) { now = time(NULL); gmtime_r(&now, &t); t.tm_sec = s; @@ -231,8 +231,11 @@ int print_module_versions ( FILE * outf ) t.tm_mon = m-1; t.tm_year = y-1900; now = timegm(&t); - if (now > maxtime) + if (now > maxtime) { maxtime = now; + strcpy(timestamp, datetime); + strcat(timestamp, " GMT"); + } } if (outf) fprintf(outf, " %-10s %-5s %s\n", name, rev, datetime); @@ -251,7 +254,7 @@ int print_module_versions ( FILE * outf ) if (outf) fprintf(outf, "\n"); - return maxtime; + return 0; } @@ -275,7 +278,7 @@ int main ( int argc, char * argv [] ) int readorwrite; /* true if a chip read/write op was selected */ int ppidata; /* cached value of the ppi data register */ int vsize=-1; /* number of bytes to verify */ - int rev; + char timestamp[64]; /* options / operating mode variables */ int memtype; /* AVR_FLASH or AVR_EEPROM */ @@ -318,15 +321,15 @@ int main ( int argc, char * argv [] ) progbuf[i] = ' '; progbuf[i] = 0; - rev = print_module_versions(NULL); + print_module_versions(NULL, timestamp); /* * Print out an identifying string so folks can tell what version * they are running */ fprintf(stderr, "\n%s: Copyright 2000 Brian Dean, bsd@bsdhome.com\n" - "%sVersion %s Revision Timestamp %d\n\n", - progname, progbuf, version, rev); + "%sVersion %s Revision Timestamp %s\n\n", + progname, progbuf, version, timestamp); /* * check for no arguments @@ -452,7 +455,7 @@ int main ( int argc, char * argv [] ) break; case 'V': - print_module_versions(stderr); + print_module_versions(stderr, NULL); break; case '?': /* help */