From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBPjV-0003DL-M6 for guix-patches@gnu.org; Thu, 18 May 2017 14:01:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dBPjS-0002Us-7o for guix-patches@gnu.org; Thu, 18 May 2017 14:01:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:51070) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dBPjS-0002Un-4C for guix-patches@gnu.org; Thu, 18 May 2017 14:01:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dBPjR-0007U0-QQ for guix-patches@gnu.org; Thu, 18 May 2017 14:01:01 -0400 Subject: bug#26802: [PATCH 3/4] guix: lint: Check for version in source file name. Resent-Message-ID: Message-Id: <565a99c4.AEMAKbu972sAAAAAAAAAAAO9aM4AAAACwQwAAAAAAAW9WABZHeEv@mailjet.com> MIME-Version: 1.0 From: Arun Isaac Date: Thu, 18 May 2017 23:29:53 +0530 In-reply-to: <87vaoy764n.fsf@gnu.org> References: <20170517165246.14042-1-arunisaac@systemreboot.net> <25c18e57.AEQAKeUK09kAAAAAAAAAAAO9aM4AAAACwQwAAAAAAAW9WABZHIAR@mailjet.com> <87vaoy764n.fsf@gnu.org> Content-Type: text/plain 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Alex Kost , 26802@debbugs.gnu.org >> (define (origin-file-name-valid? origin) >> - ;; Return #f if the source file name contains only a version or is = #f; >> - ;; indicates that the origin needs a 'file-name' field. >> + ;; Return #f if the source file name is #f, contains only a version= , or >> + ;; does not contain a version; indicates that the origin needs a >> + ;; 'file-name' field. >> (let ((file-name (origin-actual-file-name origin)) >> (version (package-version package))) >> (and 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))= ))) >> + (not (string-match (string-append "^v?" version) file-name)) >> + (string-match version file-name)))) > > What about simply: > > (string-prefix? (string-append (package-name package) "-" > (package-version package)) > file-name) This will break all those emacs, python, etc. packages that have "emacs-", "python-" prefixes in the package-name, but not in their source file names. We'll have to add the file-name field to practically every Guix package. I'm not sure this is a good idea. Couldn't we drop patch 3, and just use patch 4 to fix this bug? =