From patchwork Mon Jul 29 06:48:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzu-Jung Lee X-Patchwork-Id: 262692 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 543F72C00F0 for ; Mon, 29 Jul 2013 16:44:40 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 93F58936E4; Mon, 29 Jul 2013 06:44:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Bbaj8awT6grG; Mon, 29 Jul 2013 06:44:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 1D6C2936F4; Mon, 29 Jul 2013 06:44:52 +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 979C01BFA83 for ; Mon, 29 Jul 2013 06:44:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id F16D18D884 for ; Mon, 29 Jul 2013 06:44:37 +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 5XOx2fLTI09w for ; Mon, 29 Jul 2013 06:44:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by whitealder.osuosl.org (Postfix) with ESMTPS id C0BE78E12C for ; Mon, 29 Jul 2013 06:44:36 +0000 (UTC) Received: by mail-pa0-f44.google.com with SMTP id jh10so5476573pab.3 for ; Sun, 28 Jul 2013 23:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=t60VunOsIrEV0E+LHKf5YrdYtli1vuTwyc3V5QnGDi0=; b=pd8/eDLi4F0HP0j6x4H1J88+703wWf0VkMIC5xOnMTETPzuc2gvabUPzq8yPRuz32d fMSP+hgqJ/WRCNpt5O96wIMqNv7TqUCXSgsYjIDPYbPJVAfD4nR5ovduBa1gu5sOFa2s M+1biADWj+EVYWPltxsVDpa2yRMEingcqW/1Zv4iaKq0UzG6GwCubD6A4xxK1zrU3H/I l9OvudNoEsVIIUFzrBVHlwSiCLMjsugUpYo3S4GOSM7dEXm8dE1TXtxCSU60hJ+WG7xl viRcMV5UJQZvR6DTfr2xFyUOnkukFxIFi6UMXva69Aj5Id/+b9vUwEJFcDiAKYWCsb3k O96Q== X-Received: by 10.68.105.195 with SMTP id go3mr61739824pbb.180.1375080276491; Sun, 28 Jul 2013 23:44:36 -0700 (PDT) Received: from localhost.localdomain (59-104-36-192.adsl.dynamic.seed.net.tw. [59.104.36.192]) by mx.google.com with ESMTPSA id ai6sm18895892pad.15.2013.07.28.23.44.34 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Jul 2013 23:44:35 -0700 (PDT) From: Tzu-Jung Lee To: buildroot@busybox.net Date: Mon, 29 Jul 2013 14:48:10 +0800 Message-Id: <1375080490-6569-1-git-send-email-tjlee@ambarella.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: References: Cc: , thomas.petazzoni@free-electrons.com, Tzu-Jung Lee Subject: [Buildroot] [PATCH v3] -rsync: support user custom cmds 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 This patch allows users to override the options or entire command line of rsync. The default options filters out object or libraries during rsync. For local packages which come with pre-built binaries, the copy in build/ directory will not have complete files as src/ Signed-off-by: Tzu-Jung Lee --- Fix the rsync default command line. docs/manual/adding-packages-generic.txt | 9 +++++++++ package/pkg-generic.mk | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt index 2889add..681b2e3 100644 --- a/docs/manual/adding-packages-generic.txt +++ b/docs/manual/adding-packages-generic.txt @@ -358,6 +358,15 @@ LIBFOO_VERSION = 2.32 Now, the variables that define what should be performed at the different steps of the build process. +* +LIBFOO_RSYNC_CMDS+ lists the actions to be performed at the + fetch step for a package to be built from local source. By default, + the local source directory is copied to the build directory by rsync + with default options '-au --cvs-exclude --include core'. This works + fine and is efficient for general cases since it doesn't copy SCM + metadata as well as object files, and libraries. For packages that + come with pre-built binaries, user can override the default options + or entire command line to copy them at this fetch step. + * +LIBFOO_CONFIGURE_CMDS+ lists the actions to be performed to configure the package before its compilation. diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 6d49a29..ea6fba9 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -62,7 +62,7 @@ $(BUILD_DIR)/%/.stamp_extracted: $(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) + $($(PKG)_RSYNC_CMDS) $(foreach hook,$($(PKG)_POST_RSYNC_HOOKS),$(call $(hook))$(sep)) $(Q)touch $@ @@ -310,6 +310,10 @@ $(2)_INSTALL_IMAGES ?= NO $(2)_INSTALL_TARGET ?= YES $(2)_DIR_PREFIX = $(if $(4),$(4),$(TOP_SRCDIR)/package) +# default rsync command +$(2)_RSYNC_CMDS ?= \ + rsync -au --cvs-exclude --include core $$($(2)_OVERRIDE_SRCDIR)/ $$($(2)_DIR) + # define sub-target stamps $(2)_TARGET_INSTALL_TARGET = $$($(2)_DIR)/.stamp_target_installed $(2)_TARGET_INSTALL_STAGING = $$($(2)_DIR)/.stamp_staging_installed