From: Thomas De Schampheleire <patrickdepinguin@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2 of 4] infra: centralize rsync exclude list for VCS files
Date: Fri, 01 Nov 2013 17:06:47 +0100 [thread overview]
Message-ID: <cfdff3fa0098be5319f7.1383322007@argentina> (raw)
In-Reply-To: <patchbomb.1383322005@argentina>
Buildroot has three places where rsync is used:
1. to copy the target skeleton
2. to copy the rootfs overlay(s)
3. to copy overridden package sources
In all of these cases, we want to exclude version control files by default.
Place 1 and 2 used an identical set of explicit --exclude options, while
place 3 used the option --cvs-exclude. This last option, however, not only
excludes version control files, but also binary files (.o, .so) and any file
or directory named 'core' (a problem for the linux kernel that has several
directories with this name). Moreover, the exact list of excluded files when
using --cvs-exclude depends on the version of rsync.
This patch creates one global variable RSYNC_VCS_EXCLUSIONS that can be used
by the various rsync commands. It excludes the version control files of
svn, git, hg, cvs and bzr.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
---
Makefile | 14 ++++++++------
package/pkg-generic.mk | 2 +-
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -426,11 +426,14 @@ ifeq ($(BR2_ROOTFS_SKELETON_CUSTOM),y)
TARGET_SKELETON=$(BR2_ROOTFS_SKELETON_CUSTOM_PATH)
endif
+RSYNC_VCS_EXCLUSIONS = \
+ --exclude .svn --exclude .git --exclude .hg --exclude .bzr \
+ --exclude CVS
+
$(BUILD_DIR)/.root:
mkdir -p $(TARGET_DIR)
- rsync -a \
- --exclude .empty --exclude .svn --exclude .git \
- --exclude .hg --exclude=CVS --exclude '*~' \
+ rsync -a $(RSYNC_VCS_EXCLUSIONS) \
+ --exclude .empty --exclude '*~' \
$(TARGET_SKELETON)/ $(TARGET_DIR)/
cp support/misc/target-dir-warning.txt $(TARGET_DIR_WARNING_FILE)
@ln -snf lib $(TARGET_DIR)/$(LIB_SYMLINK)
@@ -504,9 +507,8 @@ endif
@$(foreach d, $(call qstrip,$(BR2_ROOTFS_OVERLAY)), \
$(call MESSAGE,"Copying overlay $(d)"); \
- rsync -a \
- --exclude .empty --exclude .svn --exclude .git \
- --exclude .hg --exclude=CVS --exclude '*~' \
+ rsync -a $(RSYNC_VCS_EXCLUSIONS) \
+ --exclude .empty --exclude '*~' \
$(d)/ $(TARGET_DIR)$(sep))
@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -68,7 +68,7 @@ endif
$(BUILD_DIR)/%/.stamp_rsynced:
@$(call MESSAGE,"Syncing from source dir $(SRCDIR)")
@test -d $(SRCDIR) || (echo "ERROR: $(SRCDIR) does not exist" ; exit 1)
- rsync -au --cvs-exclude --include core $(SRCDIR)/ $(@D)
+ rsync -au $(RSYNC_VCS_EXCLUSIONS) $(SRCDIR)/ $(@D)
$(foreach hook,$($(PKG)_POST_RSYNC_HOOKS),$(call $(hook))$(sep))
$(Q)touch $@
next prev parent reply other threads:[~2013-11-01 16:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-01 16:06 [Buildroot] [PATCH 0 of 4] Add POST_RSYNC hook Thomas De Schampheleire
2013-11-01 16:06 ` [Buildroot] [PATCH 1 of 4] infra: Add POST_RSYNC_HOOKS support Thomas De Schampheleire
2013-11-01 16:06 ` Thomas De Schampheleire [this message]
2013-11-01 16:06 ` [Buildroot] [PATCH 3 of 4] manual: split info on hooks to a separate section/file Thomas De Schampheleire
2013-11-01 16:06 ` [Buildroot] [PATCH 4 of 4] manual: add some info on the POST_RSYNC hook Thomas De Schampheleire
2013-11-01 21:08 ` [Buildroot] [PATCH 0 of 4] Add " Samuel Martin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cfdff3fa0098be5319f7.1383322007@argentina \
--to=patrickdepinguin@gmail.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox