From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dB2D7-0000X1-FI for guix-patches@gnu.org; Wed, 17 May 2017 12:54:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dB2D4-0007Ob-Hq for guix-patches@gnu.org; Wed, 17 May 2017 12:54:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:48442) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dB2D4-0007OR-EZ for guix-patches@gnu.org; Wed, 17 May 2017 12:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dB2D4-0001jp-8C for guix-patches@gnu.org; Wed, 17 May 2017 12:54:02 -0400 Subject: bug#26802: [PATCH 2/4] guix: lint: Slightly simplify `check-source-file-name'. Resent-Message-ID: Message-Id: <71d8391d.AEAAKQk5dMAAAAAAAAAAAAO9aM4AAAACwQwAAAAAAAW9WABZHIAB@mailjet.com> From: Arun Isaac Date: Wed, 17 May 2017 22:22:44 +0530 In-Reply-To: <20170517165246.14042-1-arunisaac@systemreboot.net> References: <20170517165246.14042-1-arunisaac@systemreboot.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 26802@debbugs.gnu.org * guix/scripts/lint.scm (check-source-file-name): Implement file name match= ing with regular expression. --- guix/scripts/lint.scm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm index 2b0071475..1d930d8c0 100644 --- a/guix/scripts/lint.scm +++ b/guix/scripts/lint.scm @@ -672,11 +672,10 @@ descriptions maintained upstream." (let ((file-name (origin-actual-file-name origin)) (version (package-version package))) (and file-name - (not (or (string-prefix? version file-name) - ;; Common in many projects is for the filename to star= t - ;; with a "v" followed by the version, - ;; e.g. "v3.2.0.tar.gz". - (string-prefix? (string-append "v" version) file-name)= ))))) + ;; Common in many projects is for the filename to start + ;; with a "v" followed by the version, + ;; e.g. "v3.2.0.tar.gz". + (not (string-match (string-append "^v?" version) file-name))))) =20 (let ((origin (package-source package))) (unless (or (not origin) (origin-file-name-valid? origin)) --=20 2.12.2 =