Date: Fri, 8 Apr 2016 09:53:54 -0700 (PDT) From: Roger Marquis <marquis@roble.com> To: Matthew Seaman <matthew@FreeBSD.org> Cc: freebsd-ports@freebsd.org Subject: Re: Deriving base port/package names In-Reply-To: <5707CCEE.6040301@FreeBSD.org> References: <51300.1460083670@server1.tristatelogic.com> <5707b24b.9143620a.1a679.ffffbb00SMTPIN_ADDED_MISSING@mx.google.com> <20160408144957.26ad363f@gumby.homeunix.com> <5707CCEE.6040301@FreeBSD.org>
index | | previous in thread | raw e-mail
Matthew Seaman wrote:
> Put another way, if you're working with full pkgnames '%n-%v' it's always
> the last '-' character that separates the name from the version.
> $ pkgname='postgresql92-client-9.2.16'
> $ echo ${pkgname%-*}
> postgresql92-client
> $ echo ${pkgname##*-}
> 9.2.16
Those of us who prefer to avoid shell perlisms/bashisms (blessed by
POSIX' IBM/RH/Oracle-dominated board or not) appreciate your inclusion
of the equivalent sed regex.
> $ echo $pkgname | sed -e 's,-[^-]*$,,'
> postgresql92-client
> $ echo $pkgname | sed -e 's,^.*-,,'
> 9.2.16
> I think a proposal to rename large chunks of the ports tree to eliminate
> hyphens and digits would certainly not receive a warm welcome.
`pkg rquery -a %n | grep -- '-[0-9]' | wc -l` shows only 40 ports (of
25096). Doesn't seem like a whole lot or a difficult refactor but
perhaps we're missing the use case of this particular group. Anyone
know why these 40 ports are so named?
Roger
home |
help
