guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#26802: [PATCH 3/4] guix: lint: Check for version in source file name


From: Ludovic Courtès
Subject: bug#26802: [PATCH 3/4] guix: lint: Check for version in source file name.
Date: Thu, 18 May 2017 23:01:55 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Arun Isaac <address@hidden> skribis:

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

Oh right, my bad.

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

Well patch 3 is OK after all, if you want to push it.

As for the patch 4, I prefer to let Alex reply!

Thanks,
Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]