From owner-freebsd-bugs@FreeBSD.ORG Thu Oct 30 11:20:08 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 03C1B16A4CF for ; Thu, 30 Oct 2003 11:20:08 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D750E43FB1 for ; Thu, 30 Oct 2003 11:20:06 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h9UJK6FY019135 for ; Thu, 30 Oct 2003 11:20:06 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h9UJK6v4019132; Thu, 30 Oct 2003 11:20:06 -0800 (PST) (envelope-from gnats) Date: Thu, 30 Oct 2003 11:20:06 -0800 (PST) Message-Id: <200310301920.h9UJK6v4019132@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Dan Nelson Subject: Re: bin/53063: [PATCH] Let mtree -U update mtime X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Dan Nelson List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2003 19:20:08 -0000 The following reply was made to PR bin/53063; it has been noted by GNATS. From: Dan Nelson To: FreeBSD-gnats-submit@FreeBSD.org Cc: Subject: Re: bin/53063: [PATCH] Let mtree -U update mtime Date: Thu, 30 Oct 2003 13:18:33 -0600 Updated patch. The original had an extra fix for a failing readlink call, but I cannot remember what would cause the call to fail. Something to do with reading links over NFS mounts, maybe. Index: compare.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/mtree/compare.c,v retrieving revision 1.29 diff -u -r1.29 compare.c --- compare.c 30 Oct 2003 12:03:25 -0000 1.29 +++ compare.c 30 Oct 2003 19:03:49 -0000 @@ -184,8 +184,21 @@ LABEL; (void)printf("%smodification time expected %.24s ", tab, ctime(&s->st_mtimespec.tv_sec)); - (void)printf("found %.24s\n", + (void)printf("found %.24s", ctime(&p->fts_statp->st_mtimespec.tv_sec)); + if (uflag) { + struct timeval tv[2]; + tv[0].tv_sec = s->st_mtimespec.tv_sec; + tv[0].tv_usec = s->st_mtimespec.tv_nsec / 1000; + tv[1] = tv[0]; + if (utimes(p->fts_accpath, tv)) + (void)printf(" not modified: %s\n", + strerror(errno)); + else + (void)printf(" modified\n"); + } + else + (void)printf("\n"); tab = "\t"; } if (s->flags & F_CKSUM) { Index: mtree.8 =================================================================== RCS file: /home/ncvs/src/usr.sbin/mtree/mtree.8,v retrieving revision 1.40 diff -u -r1.40 mtree.8 --- mtree.8 14 Sep 2003 13:41:58 -0000 1.40 +++ mtree.8 30 Oct 2003 18:46:48 -0000 @@ -76,8 +76,9 @@ Don't follow symbolic links in the file hierarchy, instead consider the symbolic link itself in any comparisons. This is the default. .It Fl U -Modify the owner, group and permissions of existing files to match -the specification and create any missing directories or symbolic links. +Modify the owner, group, permissions, and modification time of existing +files to match the specification and create any missing directories or +symbolic links. User, group and permissions must all be specified for missing directories to be created. Corrected mismatches are not considered errors.