From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 16:04:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DFA0EF4 for ; Mon, 22 Sep 2014 16:04:21 +0000 (UTC) Received: from mail-qa0-f47.google.com (mail-qa0-f47.google.com [209.85.216.47]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0619DD2 for ; Mon, 22 Sep 2014 16:04:20 +0000 (UTC) Received: by mail-qa0-f47.google.com with SMTP id i13so322275qae.6 for ; Mon, 22 Sep 2014 09:04:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=61c778LbHIlRD+9K/PgNZqwbJviN625IIlEo0JtisQc=; b=epxp+AcGgCXYkicXZS0ddIxYNd4oDFyuy57fFc9+QGcT7cpuzJPBSwxs8rUtXWvUBf af+yXvuwd5InKuzXpvu7+wPEDFIqMzIWx2+PSFr3O4q9tr03AYpDppNfhbDeZooX+NSS xq6eqHoPMKkjGjqbdV3vxt3GydFR1akqBJDKoPnAMjCO143ec5ECkEbpfpLLtlJInCKy HRY3Rn6GnzF0OzBwkGgMHYWZ2HSn/5UOu1/Xyzl8aDEV9Qtsj8ewWXVas5o7YhWN+B6t ATMFRJpvwhVr0T5qgPQE2IMNTYMTwyNNz4Oba9SbzLryWHkFJP4mxR7kxeejefIp/YBv 6zDQ== X-Gm-Message-State: ALoCoQkN3mTCBgI1t37rh4ayHarhf+AK0dLfDP7Ctr5ZL6C6oowtz2+sZFtPLtRwQOB9eGaPtcsU MIME-Version: 1.0 X-Received: by 10.140.23.17 with SMTP id 17mr23495361qgo.30.1411398574391; Mon, 22 Sep 2014 08:09:34 -0700 (PDT) Received: by 10.140.16.183 with HTTP; Mon, 22 Sep 2014 08:09:34 -0700 (PDT) In-Reply-To: <20140920172111.Q4941@besplex.bde.org> References: <201409181441.s8IEfvR1075223@svn.freebsd.org> <541D2356.8040403@freebsd.org> <20140920172111.Q4941@besplex.bde.org> Date: Mon, 22 Sep 2014 09:09:34 -0600 Message-ID: Subject: Re: svn commit: r271771 - in head: bin/csh etc/mail lib/libc usr.bin/grep usr.sbin/mtree From: Will Andrews To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "src-committers@FreeBSD.org" , Julian Elischer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 16:04:21 -0000 On Sat, Sep 20, 2014 at 1:38 AM, Bruce Evans wrote: > The log message is confused. Source files are not being overwritten. > They are being copied to object directories using cp. Then if they > are read-only in the source directory, they are read-only in the object > directory, even if they are copied without -p so as to clobber their > timestamps (their mode is still preserved). Then if the source file's > mtime is changed, either by actually changing the file or just by > clobbering its mtime, the copy in the object directory becomes out of > date. Then the cp to make it up to date fails because it is read-only. Yes, this is the more correct way of explaining the issue. Thanks. > Many makefiles avoid this problem by using cat instead of cp to copy > the files. I prefer using cp -p. The above fixes the problem for > a makefile that uses cp (without -p) by adding -f. This causes the file > to be unlinked before a new copy is made. If the object directory is > in the source tree (most likely since it is the source directory) and > the source files are read-only, then this would often fail because the > source directory is also read-only, but then it can't reasonably be > an object directory. The problem with 'cp -p' is that it doesn't work either. Try it (twice) with a read-only file -- I get EPERM when I try the second time. cp -p also doesn't work with NFS targets if the file happens to have flags. In the case of .CURDIR == .OBJDIR, the file would satisfy the dependency and thus not be overwritten with itself. In any case, this is about read-only *files* anyway, not read-only directories, since as you point out, the latter are unusable as object directories. --Will.