>Submitter-Id: net >Originator: Taku Hisaki >Organization: JEOL System Technology Co.,Ltd. >Confidential: yes >Synopsis: There is a little Y2K related incompatibility with some version of >HP-UX's RCS. >Severity: serious >Priority: medium >Category: portability >Class: change-request >Release: cvs-1.11 >Environment: System: HP-UX almach B.10.20 A 9000/780 2005237377 2-user-licences With RCS Revision: 78.1 >Description: On some old version of HP-UX, there is Y2K probrem related RCS as follows. - - - - - - - - - - - PHCO_16020: HP RCS generated archives (,v files) containing revisions created in the year 2000 and beyond will not be correctly parsed by the public domain GNU RCS and vice versa. The format of the time stamps in the rcs generated archives (,v files) has been changed such that all dates beyond year 1999 are represented using 4 digits and dates prior to year 2000 are represented using 2 digits. After the installation of this patch, HP rcs will be compatible with GNU rcs. All dates beyond year 1999 will be displayed using 4 digits and all dates prior to year 2000 will be displayed using 2 digits format. - - - - - - - - - - - Here, "PHCO_16020" is HP-UX's patch name. Year 2000 is written as '00' in RCS files created by the RCS. Therefore, if we create CVS files by copying RCS files that is checked-in in year 2000 at least once using the RCS, comparing checked-in-date by '-D' option will make a mistake. (e.g. 'cvs rtag -D <date> <tag> <files>') >How-To-Repeat: >Fix: We maked a patch as follows. #Please note that we are beginner for CVS. ========================================== Patch start diff -cr ./src/log.c ../cvs-1.11.fixed/src/log.c *** ./src/log.c Thu Jun 22 07:28:37 2000 --- ../cvs-1.11.fixed/src/log.c Fri Jan 12 11:18:23 2001 *************** *** 1357,1363 **** cvs_output ("\ndate: ", 0); (void) sscanf (ver->date, SDATEFORM, &year, &mon, &mday, &hour, &min, &sec); ! if (year < 1900) year += 1900; sprintf (buf, "%04d/%02d/%02d %02d:%02d:%02d", year, mon, mday, hour, min, sec); --- 1357,1367 ---- cvs_output ("\ndate: ", 0); (void) sscanf (ver->date, SDATEFORM, &year, &mon, &mday, &hour, &min, &sec); ! if (year < 0) ! year = -year; ! if (year < 69) ! year += 2000; ! else if (year < 1900) year += 1900; sprintf (buf, "%04d/%02d/%02d %02d:%02d:%02d", year, mon, mday, hour, min, sec); diff -cr ./src/main.c ../cvs-1.11.fixed/src/main.c *** ./src/main.c Thu Sep 7 08:35:04 2000 --- ../cvs-1.11.fixed/src/main.c Fri Jan 12 11:18:23 2001 *************** *** 1138,1144 **** error (0, 0, "internal error: bad date %s", source); /* Always send a four digit year. */ ! if (year < 100) year += 1900; sprintf (dest, "%d %s %d %02d:%02d:%02d -0000", day, --- 1138,1148 ---- error (0, 0, "internal error: bad date %s", source); /* Always send a four digit year. */ ! if (year < 0) ! year = -year; ! if (year < 69) ! year += 2000; ! else if (year < 1900) year += 1900; sprintf (dest, "%d %s %d %02d:%02d:%02d -0000", day, diff -cr ./src/rcs.c ../cvs-1.11.fixed/src/rcs.c *** ./src/rcs.c Tue Aug 22 06:16:38 2000 --- ../cvs-1.11.fixed/src/rcs.c Sat Jan 13 18:01:23 2001 *************** *** 3000,3008 **** RCS_datecmp (date1, date2) char *date1, *date2; { ! int length_diff = strlen (date1) - strlen (date2); ! return (length_diff ? length_diff : strcmp (date1, date2)); } /* Look up revision REV in RCS and return the date specified for the --- 3000,3033 ---- RCS_datecmp (date1, date2) char *date1, *date2; { ! char d1[MAXDATELEN], d2[MAXDATELEN]; ! int y; ! y = atoi( date1 ); ! if ( y < 69 ) { ! strcpy( d1, "20" ); ! } ! else if ( y < 100 ) { ! strcpy( d1, "19" ); ! } ! else { ! strcpy( d1, "" ); ! } ! strcat( d1, date1 ); ! ! y = atoi( date2 ); ! if ( y < 69 ) { ! strcpy( d2, "20" ); ! } ! else if ( y < 100 ) { ! strcpy( d2, "19" ); ! } ! else { ! strcpy( d2, "" ); ! } ! strcat( d2, date2 ); ! ! return strcmp( d1, d2 ); } /* Look up revision REV in RCS and return the date specified for the *************** *** 3390,3396 **** (void) sscanf (rcs_date, SDATEFORM, &year, &mon, &mday, &hour, &min, &sec); ! if (year < 1900) year += 1900; sprintf (buf, "%04d/%02d/%02d %02d:%02d:%02d", year, mon, mday, hour, min, sec); --- 3415,3425 ---- (void) sscanf (rcs_date, SDATEFORM, &year, &mon, &mday, &hour, &min, &sec); ! if (year < 0) ! year = -year; ! if (year < 69) ! year += 2000; ! else if (year < 1900) year += 1900; sprintf (buf, "%04d/%02d/%02d %02d:%02d:%02d", year, mon, mday, hour, min, sec); ========================================== End of patch #HP-UX users are also recommended for attempting patch 'PHCO_18912' or later if not yet. _______________________________________________ Bug-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-cvs