all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Kost <alezost@gmail.com>
To: Arun Isaac <arunisaac@systemreboot.net>
Cc: 26802@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	[thread overview]
Message-ID: <87shjyh9ds.fsf@gmail.com> (raw)
In-Reply-To: <565a99c4.AEMAKbu972sAAAAAAAAAAAO9aM4AAAACwQwAAAAAAAW9WABZHeEv@mailjet.com> (Arun Isaac's message of "Thu, 18 May 2017 23:29:53 +0530")

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

  reply	other threads:[~2017-05-21  9:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170517165246.14042-1-arunisaac@systemreboot.net>
2017-05-17 16:52 ` bug#26802: [PATCH 2/4] guix: lint: Slightly simplify `check-source-file-name' Arun Isaac
2017-05-18 11:30   ` Ludovic Courtès
2017-05-18 18:00     ` Arun Isaac
2017-05-17 16:52 ` bug#26802: [PATCH 3/4] guix: lint: Check for version in source file name Arun Isaac
2017-05-18 11:32   ` Ludovic Courtès
2017-05-18 17:59     ` Arun Isaac
2017-05-21  9:00       ` Alex Kost [this message]
     [not found]     ` <f8951611.AEMAKbu9720AAAAAAAAAAAOzWv8AAAACwQwAAAAAAAW9WABZHeEw@mailjet.com>
2017-05-18 21:01       ` Ludovic Courtès
2017-05-21  8:44         ` Alex Kost
2017-05-17 16:52 ` bug#26802: [PATCH 4/4] build: emacs: Fix `store-file->elisp-source-file' Arun Isaac
2017-05-21  8:33   ` Alex Kost
2017-05-21 22:24     ` Ludovic Courtès
2017-05-22 23:10       ` Arun Isaac
     [not found]       ` <cu7shjwebd7.fsf@systemreboot.net>
2017-05-23  0:52         ` Arun Isaac
     [not found]         ` <95c4b155.AEQAKqmySzQAAAAAAAAAAAOzWv8AAAACwQwAAAAAAAW9WABZI4fH@mailjet.com>
2017-05-23  8:15           ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87shjyh9ds.fsf@gmail.com \
    --to=alezost@gmail.com \
    --cc=26802@debbugs.gnu.org \
    --cc=arunisaac@systemreboot.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.