From owner-svn-src-head@FreeBSD.ORG Mon Sep 22 15:16:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B1AAB0D for ; Mon, 22 Sep 2014 15:16:19 +0000 (UTC) Received: from mail-qc0-f171.google.com (mail-qc0-f171.google.com [209.85.216.171]) (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 45296858 for ; Mon, 22 Sep 2014 15:16:19 +0000 (UTC) Received: by mail-qc0-f171.google.com with SMTP id w7so207439qcr.30 for ; Mon, 22 Sep 2014 08:16:18 -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=eEHrftXL24TObM8Bi8yA0i+rNN7b8hK9ffkwtvGLv01J3Rf3qHD3nY9jgeb2KHeg5L 9/fhbwbiVPXvc4AKFaYyAO6CIHqY1kVrIuUJjL7Eb1/zut+C+L35gGGE+YKT3uxmu5qE kYZFjnYPEC7xgnX5+nh1whISD34J933uKg/b16Y/oNk1HrsLVcdctZxU0IX3zotsuVRK v0j89C3+C3BCamdZrlu3KGO8K/b8ZIErBvOFko5+Gfw2d3SkIlgxKSX66asaMLRAyg6L +k5OkJqwmBmC5oaJuVDwh+ie1hdx9xBiOS1/N7gJDlzf+0iiz0mYjpjGnyfRA7r/6vNr vq/g== X-Gm-Message-State: ALoCoQkrrPW9WMMJFIX1BzBehHicnSb5jYOL1xqsS+jUqPDdCFmmkMkV0dSF873xThee8kXer3Tp 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 15:16:19 -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.