From owner-freebsd-current Wed Oct 23 11:59: 5 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4E17D37B401 for ; Wed, 23 Oct 2002 11:59:02 -0700 (PDT) Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 05CDF43E4A for ; Wed, 23 Oct 2002 11:58:58 -0700 (PDT) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.6/8.11.2) id g9NIwOw18219; Wed, 23 Oct 2002 21:58:24 +0300 (EEST) (envelope-from ru) Date: Wed, 23 Oct 2002 21:58:24 +0300 From: Ruslan Ermilov To: Bruce Evans Cc: Kris Kennaway , current@FreeBSD.org Subject: install -C not preserving ctimes (was: Re: UPDATING entry needed (Re: Building KDE3)) Message-ID: <20021023185824.GB8656@sunbay.com> References: <20021023111852.GB31781@sunbay.com> <20021024041602.T23784-100000@gamplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="adJ1OR3c6QgCpb/j" Content-Disposition: inline In-Reply-To: <20021024041602.T23784-100000@gamplex.bde.org> User-Agent: Mutt/1.3.99i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --adJ1OR3c6QgCpb/j Content-Type: multipart/mixed; boundary="CdrF4e02JqNVZeln" Content-Disposition: inline --CdrF4e02JqNVZeln Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 24, 2002 at 04:21:09AM +1000, Bruce Evans wrote: > On Wed, 23 Oct 2002, Ruslan Ermilov wrote: >=20 > > On Tue, Oct 22, 2002 at 10:34:25PM -0700, Kris Kennaway wrote: > > > I normally do something like: > > > > > > find /usr/include -ctime +1 -type f -delete > > > > > > To clean out stale includes after a buildworld. Perhaps something > > > like this should be added to the end of the directions. > > > > > Headers are normally installed with ``install -C'', and those > > that did not change recently will not be touched at all. The > > command above will effectively remove these. >=20 > Only if someone "fix"es ``install -C'' to not change ctimes. -C only > causes mtimes to be preserved. ``install -C'' often needs to touch > metadata and it does this unconditionally to simplify things; this has > the somewhat intentional side effect of changing the ctime. >=20 The attached seems to be fixing it, please review. Cheers, --=20 Ruslan Ermilov Sysadmin and DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age --CdrF4e02JqNVZeln Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Content-Transfer-Encoding: quoted-printable Index: xinstall.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/xinstall/xinstall.c,v retrieving revision 1.57 diff -u -p -r1.57 xinstall.c --- xinstall.c 4 Sep 2002 23:29:09 -0000 1.57 +++ xinstall.c 23 Oct 2002 18:48:14 -0000 @@ -451,7 +451,7 @@ install(const char *from_name, const cha */ if ((gid !=3D (gid_t)-1 && gid !=3D to_sb.st_gid) || (uid !=3D (uid_t)-1 && uid !=3D to_sb.st_uid) || - (mode !=3D to_sb.st_mode)) { + (mode !=3D (to_sb.st_mode & ALLPERMS))) { /* Try to turn off the immutable bits. */ if (to_sb.st_flags & NOCHANGEBITS) (void)fchflags(to_fd, to_sb.st_flags & ~NOCHANGEBITS); @@ -466,7 +466,7 @@ install(const char *from_name, const cha err(EX_OSERR,"%s: chown/chgrp", to_name); } =20 - if (mode !=3D to_sb.st_mode) + if (mode !=3D (to_sb.st_mode & ALLPERMS)) if (fchmod(to_fd, mode)) { serrno =3D errno; (void)unlink(to_name); @@ -481,7 +481,9 @@ install(const char *from_name, const cha * trying to turn off UF_NODUMP. If we're trying to set real flags, * then warn if the the fs doesn't support it, otherwise fail. */ - if (!devnull && fchflags(to_fd, + if (!devnull && (flags & SETFLAGS || + (from_sb.st_flags & ~UF_NODUMP) !=3D to_sb.st_flags) && + fchflags(to_fd, flags & SETFLAGS ? fset : from_sb.st_flags & ~UF_NODUMP)) { if (flags & SETFLAGS) { if (errno =3D=3D EOPNOTSUPP) --CdrF4e02JqNVZeln-- --adJ1OR3c6QgCpb/j Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iD8DBQE9tvFQUkv4P6juNwoRAptFAJ9evFm/Zt5ZBKtl5pBkiwLswG2h0wCeL3nk KhEA4GzCdREL5R8hYcP/QBM= =s4Mn -----END PGP SIGNATURE----- --adJ1OR3c6QgCpb/j-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message