Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id F29B7E00851; Thu, 14 Sep 2017 15:12:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, * medium trust * [147.11.1.11 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 5A570E00851 for ; Thu, 14 Sep 2017 15:12:18 -0700 (PDT) Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail.windriver.com (8.15.2/8.15.1) with ESMTPS id v8EMCHZ8019871 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL) for ; Thu, 14 Sep 2017 15:12:17 -0700 (PDT) Received: from ala-dreyna-lx3.corp.ad.wrs.com (147.11.157.78) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 14 Sep 2017 15:12:17 -0700 From: David Reyna To: Date: Thu, 14 Sep 2017 15:04:04 -0700 Message-ID: <1505426644-30792-1-git-send-email-david.reyna@windriver.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [147.11.157.78] Subject: [PATCH] toaster: reserve HEAD from imported layers X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2017 22:12:19 -0000 Content-Type: text/plain From: David Reyna The HEAD reference in Toaster layers are reserved for the "Local Yocto Project" layers, stored at the top directory. Imported layers are not allowed to use this since they are managed differently - for example the 'remotes' will collide. [YOCTO #9924] Signed-off-by: David Reyna --- bitbake/lib/toaster/toastergui/static/js/importlayer.js | 15 ++++++++++++--- bitbake/lib/toaster/toastergui/templates/importlayer.html | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/static/js/importlayer.js b/bitbake/lib/toaster/toastergui/static/js/importlayer.js index b3f094e..f351751 100644 --- a/bitbake/lib/toaster/toastergui/static/js/importlayer.js +++ b/bitbake/lib/toaster/toastergui/static/js/importlayer.js @@ -244,9 +244,18 @@ function importLayerPageInit (ctx) { enable_import_btn(true); } - if ($("#git-repo-radio").prop("checked") && - vcsURLInput.val().length > 0 && gitRefInput.val().length > 0) { - enable_import_btn(true); + if ($("#git-repo-radio").prop("checked")) { + if (gitRefInput.val().length > 0 && + gitRefInput.val() == 'HEAD') { + $('#invalid-layer-revision-hint').show(); + $('#layer-revision-ctrl').addClass('has-error'); + enable_import_btn(false); + } else if (vcsURLInput.val().length > 0 && + gitRefInput.val().length > 0) { + $('#invalid-layer-revision-hint').hide(); + $('#layer-revision-ctrl').removeClass('has-error'); + enable_import_btn(true); + } } } diff --git a/bitbake/lib/toaster/toastergui/templates/importlayer.html b/bitbake/lib/toaster/toastergui/templates/importlayer.html index afbeb94..7e5253e 100644 --- a/bitbake/lib/toaster/toastergui/templates/importlayer.html +++ b/bitbake/lib/toaster/toastergui/templates/importlayer.html @@ -115,8 +115,8 @@ - + -- 1.9.1