From patchwork Sun Sep 4 15:41:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 75352 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp108266qgf; Sun, 4 Sep 2016 08:41:41 -0700 (PDT) X-Received: by 10.98.141.219 with SMTP id p88mr22173056pfk.153.1473003701416; Sun, 04 Sep 2016 08:41:41 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id e188si23894943pfc.61.2016.09.04.08.41.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Sep 2016 08:41:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5B43B1A1E27; Sun, 4 Sep 2016 08:41:40 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 590BA1A1E26 for ; Sun, 4 Sep 2016 08:41:39 -0700 (PDT) Received: by mail-wm0-x234.google.com with SMTP id c133so91495433wmd.1 for ; Sun, 04 Sep 2016 08:41:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=KfVakMqpfwM8zA+IZXNshrvsuoRdDVivNIdVR/gFMYo=; b=YCN/rq51N+w6VMWotFMU8yMAPrk13ZUKiladYc0FzaqBXMXgek8tQqc1pJIRahkPJV aG4DMBV1kfPri3hwBs4N3ZffHsxscH1aCI1BMFcKPsKhK42pCBF4sbZCIn2+7J7Pp0TU gCGGreYmUDUFrCRQnfIiw8lco+LVFyGfFcgmE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KfVakMqpfwM8zA+IZXNshrvsuoRdDVivNIdVR/gFMYo=; b=cWwCxc/Iu4v0HuFRxbNhGLUBnZVcGbP2FoywtcchNoTYhUFpLgleJNDdiAgMsa3YYS NSR0opiXA6Xc7UhsbI6adRNBzA1QD+1uAhII1BRLFxXIjbXi+0zbWSEYClxvq6P6qE+f PopYjXFZtKsJEGf94FOFXicVCAUU1FyPCUrM1afpHDGzFe7lmdh59X6aj6IaY6dpB4Cb f1GNT5rJoIoYHoCmj1nEaUnPWb6/FLc3uEFuZ6Py8v/iZmCYVNlEZEb2R9OUYyRlU38x zHw63cATO+yo8AA3EZtXRhxhBo5IGjVuw2vOOIiG+XMl9mFUmM5KbPsNva52wqLpxKke v8wg== X-Gm-Message-State: AE9vXwM7XdZskFUHozMhGViWn+B7u99ZtwpqYxg6X2dbJyGzdyGQqAdtSa+Rr/lSu9NDBsNK X-Received: by 10.194.95.105 with SMTP id dj9mr29650460wjb.20.1473003697921; Sun, 04 Sep 2016 08:41:37 -0700 (PDT) Received: from mohikan.mushroom.smurfnet.nu ([2a01:348:6:8735:e23f:49ff:fe6d:9d26]) by smtp.gmail.com with ESMTPSA id u7sm13831018wmf.8.2016.09.04.08.41.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Sep 2016 08:41:37 -0700 (PDT) From: Leif Lindholm To: edk2-devel@lists.01.org Date: Sun, 4 Sep 2016 16:41:35 +0100 Message-Id: <20160904154135.4324-1-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.9.3 Subject: [edk2] [RFC] edksetup.sh: detect updated BaseTools templates X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao , Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Make edksetup.sh automatically update the cached configuration under Conf/ when the templates under BaseTools/Conf/ change. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leif Lindholm --- We keep getting questions from people starting out with EDK2 development, whenever certain options in the BaseTools template configs change and their builds break. I don't know if this naive sledgehammer approach is acceptable, but I'd like to make life easier for people. edksetup.sh | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) -- 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/edksetup.sh b/edksetup.sh index 57368b5..77f0d43 100755 --- a/edksetup.sh +++ b/edksetup.sh @@ -33,12 +33,41 @@ function HelpMsg() return 1 } +function ClearCache() +{ + CONF_FILES="build_rule target tools_def" + if [ -z "$EDK_TOOLS_PATH" ] + then + TEMPLATE_PATH=./BaseTools/Conf/ + else + TEMPLATE_PATH="$EDK_TOOLS_PATH/Conf/" + fi + + DELETED_FILES=0 + for File in $CONF_FILES + do + TEMPLATE_FILE="$TEMPLATE_PATH/$File.template" + CACHE_FILE="Conf/$File.txt" + if [ "$TEMPLATE_FILE" -nt "$CACHE_FILE" ] + then + echo "Removing outdated '$CACHE_FILE'." + rm "$CACHE_FILE" + DELETED_FILES=$(($DELETED_FILES + 1)) + fi + done + + unset TEMPLATE_PATH TEMPLATE_FILE CACHE_FILE + return $DELETED_FILES +} + function SetWorkspace() { # - # If WORKSPACE is already set, then we can return right now + # Check for updated BaseTools templates. If none, and + # WORKSPACE is already set, then we can return right now # - if [ -n "$WORKSPACE" ] + ClearCache + if [ $? -ne 0 -a -n "$WORKSPACE" ] then return 0 fi