GNU bug report logs - #26802
Single source file emacs packages get a ".el.el" extension

Previous Next

Package: guix-patches;

Reported by: Arun Isaac <arunisaac <at> systemreboot.net>

Date: Sat, 6 May 2017 12:53:01 UTC

Severity: normal

Done: Arun Isaac <arunisaac <at> systemreboot.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alex Kost <alezost <at> gmail.com>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 26802 <at> debbugs.gnu.org
Subject: bug#26802: [PATCH 3/4] guix: lint: Check for version in source file name.
Date: Sun, 21 May 2017 12:00:47 +0300
Arun Isaac (2017-05-18 23:29 +0530) wrote:

>>>    (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.

Well, it will not "break" the packages, it will just add many new lint
warnings.  But I agree that the Ludovic's version is too strict.

What I would prefer is to make this linter check for "name-version" (or
for "name" and "version" separately) inside a source file name (not with
'string-prefix?', but with 'string-match'), so that the store file names
will look like this:

  foo-0.1.tar
  emacs-bar-0.2.el

and not like this:

  v0.1.tar
  emacs-bar.el

> Couldn't we drop patch 3, and just use patch 4 to fix this bug?

I think so, patch 4 is definitely a fix for the original problem, while
a general file-name linting is probably for another thread.

-- 
Alex




This bug report was last modified 8 years and 87 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.