unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Guillaume Le Vaillant <glv@posteo.net>
Cc: 48225@debbugs.gnu.org
Subject: bug#48225: Wrong result of package-name->name+version
Date: Tue, 04 May 2021 22:08:17 +0200	[thread overview]
Message-ID: <87pmy6l0su.fsf@gnu.org> (raw)
In-Reply-To: <87o8dqy636.fsf@yamatai> (Guillaume Le Vaillant's message of "Tue, 04 May 2021 13:35:41 +0000")

Hi Guillaume,

Guillaume Le Vaillant <glv@posteo.net> skribis:

> The 'package-name->name+version' function defined in
> "guix/build/utils.scm" returns a wrong result if there is a '-'
> followed by a number in the package name:
>
> (use-modules ((guix build utils)))
> (package-name->name+version "sbcl-3d-vectors-3.1.0-1.29bb968")
>
> $1 = "sbcl"
> $2 = "3d-vectors-3.1.0-1.29bb968"
>
>
> It should be:
>
> $1 = "sbcl-3d-vectors"
> $2 = "3.1.0-1.29bb968"
>
> Can someone think of an elegant modification for
> 'package-name->name+version' so that it finds where the version is
> even if there are several hyphens before of after it (as in
> "sbcl-3d-vectors-3.1.0-1.29bb968" or "nyxt-2-pre-release-6")?

It’s implements a heuristic meant to work for most packages.  It’s hard
to tweak that without breaking something else instead.  (Plus,
“nyxt-2-pre-release-6” looks really bogus to me.)

A better fix would be to not guess and instead pass #:name and #:version
to all the build phases, with the value taken from the <package> object.
(That’s a world-rebuild fix though.)

WDYT?

> This is related to issue #48208, and also probably to issue #41437.

Perhaps we can find a workaround for these?

Thanks,
Ludo’.




  parent reply	other threads:[~2021-05-04 20:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04 13:35 bug#48225: Wrong result of package-name->name+version Guillaume Le Vaillant
2021-05-04 19:39 ` Leo Prikler
2021-05-04 20:08 ` Ludovic Courtès [this message]
2021-05-05 21:27 ` bug#48225: Simple workaround Sharlatan Hellseher
2021-05-06  9:10   ` bug#48225: Wrong result of package-name->name+version Guillaume Le Vaillant
2021-05-08 10:27     ` Ludovic Courtès
2021-05-08 12:41       ` Guillaume Le Vaillant

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87pmy6l0su.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=48225@debbugs.gnu.org \
    --cc=glv@posteo.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).