Deriving base port/package names

RW rwmaillists at googlemail.com
Fri Apr 8 13:50:03 UTC 2016


On Fri, 8 Apr 2016 06:29:31 -0700 (PDT)
Roger Marquis wrote:

> Ronald F. Guilmette wrote:
> > what would be a proper sort of sed command to extract
> > _just_ the port/package names, without the version numbers
> > attached?  
> 
> This has changed in the past so may not currently be 100% correct but
> these should work:
> 
>    awk -F'-[0-9]' '{ print $1 }'
> 
> or:
> 
>    sed 's/-[0-9].*$//'

A port name can contain digits and hyphens, so this could remove
part of the name. 

Miroslav's version is better because it requires that the part that's
stripped only has a hyphen as it's first character.


More information about the freebsd-ports mailing list