all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mathieu Lirzin <mthl@gnu.org>
Cc: 19219@debbugs.gnu.org
Subject: bug#19219: Package names with digits following dashes
Date: Mon, 21 Dec 2015 22:46:30 +0100	[thread overview]
Message-ID: <87k2o7h3ux.fsf@gnu.org> (raw)
In-Reply-To: <87h9jblks4.fsf@gnu.org> (Mathieu Lirzin's message of "Mon, 21 Dec 2015 19:27:23 +0100")

Mathieu Lirzin <mthl@gnu.org> skribis:

> The test case contains the example "guile-2.0.6.65-134c9" which
> invalidates my proposal.  Here is another idea which identifies the
> version part by the presence of dots.  WDYT?

Sometimes the version part does not contain dots, as in “diffoscope-34”.
Here’s the complete list of dot-less versions:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> ,use(gnu packages)
scheme@(guile-user)> (fold-packages (lambda (p r)
				      (if (string-index (package-version p) #\.)
					  r
					  (cons (package-full-name p) r)))
				    '())
$38 = ("xterm-320" "unclutter-8" "tidy-20091223" "perl-uri-find-20140709" "libx264-20150706-2245" "vapoursynth-28" "texlive-texmf-2015" "texlive-bin-2015" "texlive-2015" "scmutils-20140302" "perl-regexp-common-2013031301" "parallel-20151122" "diffoscope-34" "mg-20050429" "ngircd-22" "bootstrap-tarballs-0" "static-binaries-tarball-0" "usbutils-006" "kmod-17" "less-481" "libjpeg-9a" "libjpeg-8d" "hugs-Sep2006" "ghc-bifunctors-5" "ghc-nats-1" "brdf-explorer-17" "libgudev-230" "psutils-17" "gcal-4" "libspiro-20071029" "fontforge-20120731-b" "font-gnu-freefont-ttf-20100919" "pcb-20140316" "paredit-24" "sfarkxtc-b5e0a2ba39" "lz4-131" "ld-wrapper-0" "glibc-bootstrap-0" "gcc-bootstrap-0" "binutils-bootstrap-0" "bootstrap-binaries-0" "bless-1p02" "tzdata-2015c" "freepats-20060219" "acpica-20150410")
--8<---------------cut here---------------end--------------->8---

Would they still be suitably parsed?

I liked that the initial algorithm was trivial, as in Nix:

--8<---------------cut here---------------start------------->8---
/* Parse a derivation name.  The `name' part of a derivation name is
   everything up to but not including the first dash *not* followed by
   a letter.  The `version' part is the rest (excluding the separating
   dash).  E.g., `apache-httpd-2.0.48' is parsed to (`apache-httpd',
   '2.0.48'). */
DrvName::DrvName(const string & s) : hits(0)
{
    name = fullName = s;
    for (unsigned int i = 0; i < s.size(); ++i) {
        /* !!! isalpha/isdigit are affected by the locale. */
        if (s[i] == '-' && i + 1 < s.size() && !isalpha(s[i + 1])) {
            name = string(s, 0, i);
            version = string(s, i + 1);
            break;
        }
    }
}
--8<---------------cut here---------------end--------------->8---

Another option would be to return a list of possible name version pairs,
and to change the UI to try them one after another?  The downside would
be that it moves complexity to the UI.  Hmm…

Ludo’.

  reply	other threads:[~2015-12-21 21:47 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-29 20:31 bug#19219: Package names with digits following dashes Andreas Enge
2014-12-06 23:38 ` Ludovic Courtès
2015-12-08 18:42   ` Mathieu Lirzin
2015-12-10 13:36     ` Ludovic Courtès
2015-12-21 18:27       ` Mathieu Lirzin
2015-12-21 21:46         ` Ludovic Courtès [this message]
2015-12-22 21:23           ` Mathieu Lirzin
2015-12-23  8:05             ` Alex Kost
2015-12-30 14:07             ` bug#19219: New command-line syntax for package + version? Ludovic Courtès
2015-12-30 22:45               ` Mathieu Lirzin
2015-12-31  1:16                 ` Leo Famulari
2015-12-31  8:09                   ` Efraim Flashner
2016-01-01 15:55                     ` Ludovic Courtès
2016-01-01 21:25                       ` Leo Famulari
2016-01-01 21:45                         ` Leo Famulari
2016-01-02  3:18                           ` carl hansen
2015-12-31  8:19                 ` Alex Kost
2015-12-31 11:27                 ` Ludovic Courtès
2015-12-31 16:26                   ` Christopher Allan Webber
2016-01-01 20:36                     ` Andreas Enge
2016-01-09  3:04                   ` Mathieu Lirzin
2016-01-18  8:10                     ` Ludovic Courtès
2016-01-18  8:31                       ` Mathieu Lirzin
2016-03-02 21:10                         ` Mathieu Lirzin

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=87k2o7h3ux.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=19219@debbugs.gnu.org \
    --cc=mthl@gnu.org \
    /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.