CVS commit: src/usr.bin/cvslatest
Module Name:src Committed By: wiz Date: Sat Dec 16 14:32:33 UTC 2023 Modified Files: src/usr.bin/cvslatest: cvslatest.1 Log Message: cvslatest(1): remove RETURN VALUES Pages in section one should use EXIT STATUS instead (which this one already provides). Closes PR 57778 by Kouichi Hashikawa To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/usr.bin/cvslatest/cvslatest.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/cvslatest
Module Name:src Committed By: wiz Date: Sat Dec 16 14:32:33 UTC 2023 Modified Files: src/usr.bin/cvslatest: cvslatest.1 Log Message: cvslatest(1): remove RETURN VALUES Pages in section one should use EXIT STATUS instead (which this one already provides). Closes PR 57778 by Kouichi Hashikawa To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/usr.bin/cvslatest/cvslatest.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/cvslatest/cvslatest.1 diff -u src/usr.bin/cvslatest/cvslatest.1:1.1 src/usr.bin/cvslatest/cvslatest.1:1.2 --- src/usr.bin/cvslatest/cvslatest.1:1.1 Sun Jan 24 17:08:16 2016 +++ src/usr.bin/cvslatest/cvslatest.1 Sat Dec 16 14:32:33 2023 @@ -1,4 +1,4 @@ -.\" $NetBSD: cvslatest.1,v 1.1 2016/01/24 17:08:16 christos Exp $ +.\" $NetBSD: cvslatest.1,v 1.2 2023/12/16 14:32:33 wiz Exp $ .\" Copyright (C) 2015 Thomas Klausner .\" .\" Redistribution and use in source and binary forms, with or without @@ -23,7 +23,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 7, 2016 +.Dd December 16, 2023 .Dt CVSLATEST 1 .Os .Sh NAME @@ -70,7 +70,5 @@ information directory. .Sh SEE ALSO .Xr cvs 1 , .Xr date 1 -.Sh RETURN VALUES -.Ex -std .Sh AUTHORS .An Christos Zoulas Aq Mt chris...@netbsd.org
CVS commit: src/usr.bin/cvslatest
Module Name:src Committed By: christos Date: Tue Mar 7 21:24:19 UTC 2023 Modified Files: src/usr.bin/cvslatest: cvslatest.c Log Message: simplify previous To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/usr.bin/cvslatest/cvslatest.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/cvslatest/cvslatest.c diff -u src/usr.bin/cvslatest/cvslatest.c:1.10 src/usr.bin/cvslatest/cvslatest.c:1.11 --- src/usr.bin/cvslatest/cvslatest.c:1.10 Wed Feb 15 12:00:24 2023 +++ src/usr.bin/cvslatest/cvslatest.c Tue Mar 7 16:24:19 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: cvslatest.c,v 1.10 2023/02/15 17:00:24 martin Exp $ */ +/* $NetBSD: cvslatest.c,v 1.11 2023/03/07 21:24:19 christos Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #endif #include -__RCSID("$NetBSD: cvslatest.c,v 1.10 2023/02/15 17:00:24 martin Exp $"); +__RCSID("$NetBSD: cvslatest.c,v 1.11 2023/03/07 21:24:19 christos Exp $"); /* * Find the latest timestamp in a set of CVS trees, by examining the @@ -92,6 +92,13 @@ getrepo(const FTSENT *e, char *repo, siz } static void +notimestamp(const char *fn, const char *ename, int uncommitted) +{ + warnx("Can't get timestamp from %s file `%s' in `%s'", + uncommitted ? "uncommitted" : "locally modified", fn, ename); +} + +static void getlatest(const FTSENT *e, const char *repo, struct latest *lat) { static const char fmt[] = "%a %b %d %H:%M:%S %Y"; @@ -117,28 +124,14 @@ getlatest(const FTSENT *e, const char *r goto mal; if ((dt = strtok(NULL, "/")) == NULL) goto mal; - if (strcmp(dt, "dummy timestamp") == 0) { - warnx("Can't get timestamp from uncommitted file %s in `%s'", - fn, ename); - if (!ignore) -exit(EXIT_FAILURE); - continue; - } - /* - * This may not be visible in real world, but the cvs code - * has paths that would create this string (mabe server - * side only?) - */ - if (strcmp(dt, "dummy timestamp from new-entry") == 0) { - warnx("Can't get timestamp from uncommitted file %s in `%s'", - fn, ename); + if (strncmp(dt, "dummy timestamp", 14) == 0) { + notimestamp(fn, ename, 1); if (!ignore) exit(EXIT_FAILURE); continue; } if (strcmp(dt, "Result of merge") == 0) { - warnx("Can't get cvs timestamp for localy modified file %s in `%s', using modification time.", - fn, ename); + notimestamp(fn, ename, 0); if (fstat(fileno(fp), ) == 0) { t = sb.st_mtime; goto compare;
CVS commit: src/usr.bin/cvslatest
Module Name:src Committed By: christos Date: Tue Mar 7 21:24:19 UTC 2023 Modified Files: src/usr.bin/cvslatest: cvslatest.c Log Message: simplify previous To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/usr.bin/cvslatest/cvslatest.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/cvslatest
Module Name:src Committed By: martin Date: Wed Feb 15 17:00:24 UTC 2023 Modified Files: src/usr.bin/cvslatest: cvslatest.c Log Message: While this is not intended to be used on unclean checkouts, improve diagnostics if it happens. Add another variant of a "new entry" dummy timestamp found in the cvs code (but not seen in checkouts in the wild). To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/usr.bin/cvslatest/cvslatest.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/cvslatest
Module Name:src Committed By: martin Date: Wed Feb 15 17:00:24 UTC 2023 Modified Files: src/usr.bin/cvslatest: cvslatest.c Log Message: While this is not intended to be used on unclean checkouts, improve diagnostics if it happens. Add another variant of a "new entry" dummy timestamp found in the cvs code (but not seen in checkouts in the wild). To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/usr.bin/cvslatest/cvslatest.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/cvslatest/cvslatest.c diff -u src/usr.bin/cvslatest/cvslatest.c:1.9 src/usr.bin/cvslatest/cvslatest.c:1.10 --- src/usr.bin/cvslatest/cvslatest.c:1.9 Tue Nov 3 22:21:43 2020 +++ src/usr.bin/cvslatest/cvslatest.c Wed Feb 15 17:00:24 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: cvslatest.c,v 1.9 2020/11/03 22:21:43 christos Exp $ */ +/* $NetBSD: cvslatest.c,v 1.10 2023/02/15 17:00:24 martin Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #endif #include -__RCSID("$NetBSD: cvslatest.c,v 1.9 2020/11/03 22:21:43 christos Exp $"); +__RCSID("$NetBSD: cvslatest.c,v 1.10 2023/02/15 17:00:24 martin Exp $"); /* * Find the latest timestamp in a set of CVS trees, by examining the @@ -47,6 +47,7 @@ __RCSID("$NetBSD: cvslatest.c,v 1.9 2020 #include #include +#include #include #include @@ -99,6 +100,7 @@ getlatest(const FTSENT *e, const char *r char *fn, *dt, *p; time_t t; struct tm tm; + struct stat sb; FILE *fp; snprintf(name, sizeof(name), "%s/Entries", e->fts_accpath); @@ -116,8 +118,31 @@ getlatest(const FTSENT *e, const char *r if ((dt = strtok(NULL, "/")) == NULL) goto mal; if (strcmp(dt, "dummy timestamp") == 0) { - warnx("Can't get timestamp from uncommitted file `%s'", - ename); + warnx("Can't get timestamp from uncommitted file %s in `%s'", + fn, ename); + if (!ignore) +exit(EXIT_FAILURE); + continue; + } + /* + * This may not be visible in real world, but the cvs code + * has paths that would create this string (mabe server + * side only?) + */ + if (strcmp(dt, "dummy timestamp from new-entry") == 0) { + warnx("Can't get timestamp from uncommitted file %s in `%s'", + fn, ename); + if (!ignore) +exit(EXIT_FAILURE); + continue; + } + if (strcmp(dt, "Result of merge") == 0) { + warnx("Can't get cvs timestamp for localy modified file %s in `%s', using modification time.", + fn, ename); + if (fstat(fileno(fp), ) == 0) { +t = sb.st_mtime; +goto compare; + } if (!ignore) exit(EXIT_FAILURE); continue; @@ -132,6 +157,7 @@ getlatest(const FTSENT *e, const char *r if ((t = mktime()) == (time_t)-1) errx(EXIT_FAILURE, "Time conversion `%s' in `%s'", dt, ename); +compare: if (lat->time == 0 || lat->time < t) { lat->time = t; snprintf(lat->path, sizeof(lat->path),