From: Aron Griffis <agriffis@gentoo.org>
To: gentoo-dev@robin.gentoo.org
Subject: Re: [gentoo-dev] Parsing emerge
Date: Sun, 6 Mar 2005 17:49:19 -0500 [thread overview]
Message-ID: <20050306224919.GB13606@mustard.flatmonk.org> (raw)
In-Reply-To: <1109999484.11103.54.camel@secures>
[-- Attachment #1: Type: text/plain, Size: 707 bytes --]
Chris White wrote: [Sat Mar 05 2005, 12:11:24AM EST]
> sub package_nvsplit {
> $i=0;
> while($_[$i] !~ /^\d/) {
> $i++;
> }
> $package_end=$i-1;
> $pn=join("-",@_[0..$package_end]);
> $pv=@_[$i..$#package_array];
> return $pn, $pv;
> }
my ($cat, $name, $ver) = m{(.*)/(.*?)-(\d.*)};
There are much better regexes that will actually validate, but the
above regex does everything you described.
If you're interested in completed Perl code to correctly sort ebuilds
according to portage rules, see
http://dev.gentoo.org/~agriffis/darcs/skel/bashrc.funcs and search for
sortvers.
Regards,
Aron
--
Aron Griffis
Gentoo Linux Developer
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2005-03-06 23:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-04 8:29 [gentoo-dev] Parsing emerge Chris White
2005-03-04 11:08 ` Ian Leitch
2005-03-04 15:05 ` Chris White
2005-03-04 15:05 ` Chris White
2005-03-04 16:19 ` Chris Gianelloni
2005-03-04 17:52 ` Ian Leitch
2005-03-05 3:03 ` Jason Stubbs
2005-03-05 5:11 ` Chris White
2005-03-06 22:49 ` Aron Griffis [this message]
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=20050306224919.GB13606@mustard.flatmonk.org \
--to=agriffis@gentoo.org \
--cc=gentoo-dev@gentoo.org \
--cc=gentoo-dev@robin.gentoo.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox