From patchwork Sat Jun 8 01:43:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danomi Manchego X-Patchwork-Id: 249912 X-Patchwork-Delegate: jacmet@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 10DE52C00A7 for ; Sat, 8 Jun 2013 11:43:58 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E7BB710C304; Sat, 8 Jun 2013 01:43:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oQ4xQljKSS4k; Sat, 8 Jun 2013 01:43:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id C596B10C316; Sat, 8 Jun 2013 01:43:51 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 166058F7A2 for ; Sat, 8 Jun 2013 01:43:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CF2FF8F5AC for ; Sat, 8 Jun 2013 01:43:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kwGeG6hbZa+R for ; Sat, 8 Jun 2013 01:43:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from qmta08.westchester.pa.mail.comcast.net (qmta08.westchester.pa.mail.comcast.net [76.96.62.80]) by whitealder.osuosl.org (Postfix) with ESMTP id DFED18BC8D for ; Sat, 8 Jun 2013 01:43:49 +0000 (UTC) Received: from omta20.westchester.pa.mail.comcast.net ([76.96.62.71]) by qmta08.westchester.pa.mail.comcast.net with comcast id lcX31l0041YDfWL58djpkT; Sat, 08 Jun 2013 01:43:49 +0000 Received: from localhost.localdomain ([68.37.48.40]) by omta20.westchester.pa.mail.comcast.net with comcast id ldjk1l0070s1VyU3gdjpXZ; Sat, 08 Jun 2013 01:43:49 +0000 From: Danomi Manchego To: buildroot@busybox.net Date: Fri, 7 Jun 2013 21:43:42 -0400 Message-Id: <1370655822-2668-1-git-send-email-danomimanchego123@gmail.com> X-Mailer: git-send-email 1.7.9.5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1370655829; bh=ppRG3Rd8fOWEI9NMnBgdd2wwQ/UivbLAA0mqnHarSV8=; h=Received:Received:From:To:Subject:Date:Message-Id; b=IPI73hKPz8vylhmMVnw0MSb9RZGs9YoysrEHn2XXJ/hncjKQ1il03NTf/QqDgraDd EM6ENpc4/vZrDcQqExwHCyNHxx5sSV/yOfyXu6lX2Z0e9px8eClzYT3ZpuqPi3exHv HUwVpCdN6X1mWh05FlZgp5kH+MzTULvVchnq9ZM9yk5P2jNEvRZOOE3TaWE+CLmjDX SM5Y3LJrpZE3L9huabUN7+7QecyuANmV1wx4+UbANm9h3QAnANaKXOGxCnFEKAgh0w t0IdztZSx03z8X+NxyxlYZG4dKJxPCLqEP9aX8vjFaldCOeK6OU5UEWWAv8LkHaEOx +8enpwvqJ8lFQ== Subject: [Buildroot] [PATCH] Makefile: change rsync used in overlays to always transfer files X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net If two files with the same relative paths exist in multiple overlay skeletons, and they have the same modification time and size, then rsync might not copy the later file on top of the earlier file. This patch fixes this by adding the -I option to the rsync commands used in the overlay skeleton file installations. ("man rsync" indicates that this option turns off the file-size/mod-date "quick check" behavior, causing all files to be updated - more like the cp commands that we had originally.) Signed-off-by: Danomi Manchego --- Test scenario: add overlay dirs to configuration, such as: BR2_ROOTFS_OVERLAY="$(TOPDIR)/AAA $(TOPDIR)/BBB" Now make a file in both dirs, one at a time, and make: $ mkdir -p AAA/etc BBB/etc $ echo AAA > AAA/etc/test.txt $ echo BBB > BBB/etc/test.txt $ make The file in target is the file from the last overlay skeleton, as expected: $ cat output/target/etc/test.txt BBB Now use touch to make the dates on both files the same, delete the file in TARGET_DIR, and make again. The result is that the file from the first skeleton gets into target, contrary to the expected result: $ touch AAA/etc/test.txt BBB/etc/test.txt $ rm output/target/etc/test.txt $ make $ cat output/target/etc/test.txt AAA Adding the -I to the rsync fixes this. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d7437a7..969c0c9 100644 --- a/Makefile +++ b/Makefile @@ -431,7 +431,7 @@ endif $(BUILD_DIR)/.root: mkdir -p $(TARGET_DIR) - rsync -a \ + rsync -a -I \ --exclude .empty --exclude .svn --exclude .git \ --exclude .hg --exclude=CVS --exclude '*~' \ $(TARGET_SKELETON)/ $(TARGET_DIR)/ @@ -507,7 +507,7 @@ endif @$(foreach d, $(call qstrip,$(BR2_ROOTFS_OVERLAY)), \ $(call MESSAGE,"Copying overlay $(d)"); \ - rsync -a \ + rsync -a -I \ --exclude .empty --exclude .svn --exclude .git \ --exclude .hg --exclude=CVS --exclude '*~' \ $(d)/ $(TARGET_DIR)$(sep))