From patchwork Fri Apr 1 20:25:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 605011 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 3qcCZ622vCz9sD5 for ; Sat, 2 Apr 2016 07:25:50 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=jsZ0wcTe; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 43C09A6384; Fri, 1 Apr 2016 20:25:49 +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 apWTUzkvLvfV; Fri, 1 Apr 2016 20:25:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id E302AA636E; Fri, 1 Apr 2016 20:25:42 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 493871C0B41 for ; Fri, 1 Apr 2016 20:25:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4515423189 for ; Fri, 1 Apr 2016 20:25:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3IBcP7M+jmXf for ; Fri, 1 Apr 2016 20:25:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by silver.osuosl.org (Postfix) with ESMTPS id EFC6D2CDF2 for ; Fri, 1 Apr 2016 20:25:38 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id i204so965948wmd.0 for ; Fri, 01 Apr 2016 13:25:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=kSqClYMJ9U5Wwh1vBGfCOFIi387kvrLKu/321xtwQhg=; b=jsZ0wcTeWvdiiGGihTd2jc5uAqjzgNYylFD5kzE5q965Ts2uy0SfRBJwlybbe0o40M W/VT35HAxkj2FeU8L85qw/SCsZUdJWRbV/qc1IBGwnXcEX9usrm9VAGyZiDoJYVH3Q+M y6xxAefhtYsdwvx4c4E91v90r/YUdgICSKolz+zWBYund+4wIVeCL6zP+N7sWx4r0w/O srifzswO7GLHJad3HBzkIa42L9G8Pg/Xfut1vf5DULUH20ILqrLgot+ZttWl5EJV7xb6 UgGDO9XFn6cDEEaE7Kgk/P+KniyzawgyPps6Ma+nsFGRRz8QXLXq2v+vn+NyW1sXtdZH eQCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=kSqClYMJ9U5Wwh1vBGfCOFIi387kvrLKu/321xtwQhg=; b=DAC/s7t1g2FVOB9CnIEBDJmQUPQ8ZfHPuXOMpJSWrGypFuXBV5DGILWLLZVsZhnEO2 IRnwpB6TkIPtSo8yaWO7RxDUst5d80xfakJ75ssjdUynEK+Z1YMBkftRynGdE5vDo8Pr k5F69foo2Ewjah3/KGqXUwDgGGvBkmQC6syGoXYvAcp8qRrBVtxl8Knoy1Hw3ocCEFj3 +NR1Ijp7xkWuqvZzKTlXkHyDfeOzZkW4qODvAaKWltejvzCNChdsWmVeuxgkhcpi/Rpu gBm0R4UIt5OibJTSxP8PvNjVZ3A0k5PehVV51jr86nyDbmAP8QjQ2yK4votGL2XYZ/bK EA8g== X-Gm-Message-State: AD7BkJJPwRG0PVNK72GgrBFW2kqew0uz5HE90vxsps3+4Ps4pOFktMdGP00qmS6EqrLl/Q== X-Received: by 10.28.211.130 with SMTP id k124mr553487wmg.7.1459542337595; Fri, 01 Apr 2016 13:25:37 -0700 (PDT) Received: from gourin.bzh.lan (ns304657.ip-46-105-103.eu. [46.105.103.66]) by smtp.gmail.com with ESMTPSA id w203sm559814wmg.14.2016.04.01.13.25.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Apr 2016 13:25:36 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Fri, 1 Apr 2016 22:25:31 +0200 Message-Id: <8373904cdf1fee9724d6834b56efaa706a92fc31.1459541702.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Cc: Aleksandar Simeonov , "Yann E. MORIN" Subject: [Buildroot] [PATCH 4/4 v2] core/pkg-infra: download git submodules if the package wants them X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 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" Add a new package variable that packages can set to specify that they need git submodules. Only accept this option if the download method is git, as we can not get submodules via an http download (via wget). Signed-off-by: "Yann E. MORIN" Cc: Aleksandar Simeonov Tested-by: Matt Weber Reviewed-by: Matt Weber Tested-By: Nicolas Cavallari --- Changes v1 -> v2: - properly accept the -r in the download wrapper (Aleksandar) --- package/pkg-download.mk | 1 + package/pkg-generic.mk | 8 ++++++++ support/download/dl-wrapper | 7 ++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/package/pkg-download.mk b/package/pkg-download.mk index 1332e66..2324a07 100644 --- a/package/pkg-download.mk +++ b/package/pkg-download.mk @@ -76,6 +76,7 @@ export BR_NO_CHECK_HASH_FOR = define DOWNLOAD_GIT $(EXTRA_ENV) $(DL_WRAPPER) -b git \ -o $(DL_DIR)/$($(PKG)_SOURCE) \ + $(if $($(PKG)_GIT_SUBMODULES),-r) \ $(QUIET) \ -- \ $($(PKG)_SITE) \ diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 3904c09..fee7eb0 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -453,6 +453,14 @@ ifndef $(2)_SITE_METHOD endif endif +# Do not accept to download git submodule if not using the git method +ifneq ($$($(2)_GIT_SUBMODULES),) + ifneq ($$($(2)_SITE_METHOD),git) + $$(error $(2) declares having git sub-modules, but does not use the \ + 'git' method (uses '$$($(2)_SITE_METHOD)' instead)) + endif +endif + ifeq ($$($(2)_SITE_METHOD),local) ifeq ($$($(2)_OVERRIDE_SRCDIR),) $(2)_OVERRIDE_SRCDIR = $$($(2)_SITE) diff --git a/support/download/dl-wrapper b/support/download/dl-wrapper index ef2d872..f944b71 100755 --- a/support/download/dl-wrapper +++ b/support/download/dl-wrapper @@ -21,15 +21,16 @@ set -e main() { local OPT OPTARG - local backend output hfile quiet + local backend output hfile recurse quiet # Parse our options; anything after '--' is for the backend - while getopts :hb:o:H:q OPT; do + while getopts :hb:o:H:rq OPT; do case "${OPT}" in h) help; exit 0;; b) backend="${OPTARG}";; o) output="${OPTARG}";; H) hfile="${OPTARG}";; + r) recurse="-r";; q) quiet="-q";; :) error "option '%s' expects a mandatory argument\n" "${OPTARG}";; \?) error "unknown option '%s'\n" "${OPTARG}";; @@ -82,7 +83,7 @@ main() { # If the backend fails, we can just remove the temporary directory to # remove all the cruft it may have left behind. Then we just exit in # error too. - if ! "${OLDPWD}/support/download/${backend}" ${quiet} "${tmpf}" "${@}"; then + if ! "${OLDPWD}/support/download/${backend}" ${quiet} ${recurse} "${tmpf}" "${@}"; then rm -rf "${tmpd}" exit 1 fi