From patchwork Fri Oct 25 09:21:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1183942 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GERfCj0E"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46zzBL02gsz9sP4 for ; Fri, 25 Oct 2019 20:21:13 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0251D810FA; Fri, 25 Oct 2019 09:21:12 +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 G3q2pcMqGSli; Fri, 25 Oct 2019 09:21:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 194B0811E4; Fri, 25 Oct 2019 09:21:11 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 86D051BF5D7 for ; Fri, 25 Oct 2019 09:21:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 83945811E4 for ; Fri, 25 Oct 2019 09:21:09 +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 nQkIRrzb1K63 for ; Fri, 25 Oct 2019 09:21:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by whitealder.osuosl.org (Postfix) with ESMTPS id 17975810FA for ; Fri, 25 Oct 2019 09:21:08 +0000 (UTC) Received: by mail-wr1-f53.google.com with SMTP id v9so1458447wrq.5 for ; Fri, 25 Oct 2019 02:21:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nuREwRWbby2A/pPi0UgB+i82vGYGEOSevp3XHIVIvbg=; b=GERfCj0ESSDqhnmSq8TIPPDJxgUI1JauOesWu4qp9TvSXdzofirqNa9e+ok6Avpmkx OpxozPHe6NcX6N4co37/s//84eYX8OniDUdvo05c+b1fuToAZ+nN7JYotjuCM67N6VVd WIIXvqBIslwws9UWNm7DFzWKXSZGh/owf8aUmkvDbTQRsbyHFh/AFfFicKn50ZbiOran UIxVVqkR8tA3hFiPIiaN1VnD5oLA9aJuyu0fCZYuVtcjSd6iu2DQ1l2+QkABcKg5cuKp rgX2CIDP1KaEeV0CMYVXXBBMXTHWjTDIXE5sS9+vLgryOEeDb4MC2Yn1LQ7AIq+tEyUv 74/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nuREwRWbby2A/pPi0UgB+i82vGYGEOSevp3XHIVIvbg=; b=Z2D4gSzsJiUDxSOjZVPwBgwm0P3vyn6kGF2Q8cjXf46oAch1lPJQ0uuCsI98yCVgg+ LmElROZeByY9Tv9X5YSAZSMYJD1iSYed7Vd4JNpCYaFIJntwqVVBVdWGGWSc2gI5SNDS 8f6BmS70ZP13GvDlJLHHA8/Mela4bY6d//ombG+tjefEoa+K4mUNsi1v5vvyCB7FCuXR xjW+xJM7V9OHGXETW3m+vVR80kRHftuODsOpUBX7G3l3zZaLinr3mQkMPq/yQTPXb9WN y5hYrzntBNho/ouOjUpYQJQVnABjXi11VUSPJ6qVbhChOKWH7npUbFeX+0XVIUAFBq0E WmRg== X-Gm-Message-State: APjAAAVtxivoiCRgpMwdS+5tzUAUPvqmyfQr/fkc3mLqtB1aXk0gSthC 14g62ZDIq1YckhQuIiXsCVpZVkAL X-Google-Smtp-Source: APXvYqzAgNZWfcynb3ZpJHzA0QvIB0BeZ9kUO6gcCTGIivyxJ7sbCz+yQL8EKIvsD6Zds56T9r7Ieg== X-Received: by 2002:adf:cd87:: with SMTP id q7mr2082302wrj.216.1571995266128; Fri, 25 Oct 2019 02:21:06 -0700 (PDT) Received: from hthiery01.sab.local ([213.135.10.150]) by smtp.gmail.com with ESMTPSA id l9sm1407643wme.45.2019.10.25.02.21.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 02:21:05 -0700 (PDT) From: Heiko Thiery To: buildroot@buildroot.org Date: Fri, 25 Oct 2019 11:21:04 +0200 Message-Id: <20191025092104.1164-1-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 1/1] check-package: add version format check X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Thiery , fontaine.fabrice@gmail.com, thomas.petazzoni@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Heiko Thiery To meet the requirement of "Anitya", the tool used by https://release-monitoring.org/, the _VERSION variable should not contain a prefix 'v'. Signed-off-by: Heiko Thiery --- utils/checkpackagelib/lib_mk.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/utils/checkpackagelib/lib_mk.py b/utils/checkpackagelib/lib_mk.py index dd04ffd58f..b04fe370d5 100644 --- a/utils/checkpackagelib/lib_mk.py +++ b/utils/checkpackagelib/lib_mk.py @@ -325,3 +325,23 @@ class VariableWithBraces(_CheckFunction): return ["{}:{}: use $() to delimit variables, not ${{}}" .format(self.filename, lineno), text] + + +class Version(_CheckFunction): + VERSION = re.compile(r"^([A-Z0-9_]+)_VERSION\s*[\+|:|]*=\s*(.*)") + VERSION_FAIL = re.compile("v[0-9]+") + + def check_line(self, lineno, text): + m = self.VERSION.search(text) + + if m is None: + return + + variable, assignment = m.group(1, 2) + + if self.VERSION_FAIL.match(assignment): + return ["{}:{}: remove 'v' prefix from {} of variable {}_VERSION " + "and add to {}_SITE" + .format(self.filename, lineno, assignment, variable, + variable), + text]