[OmniOS-discuss] Newer pkg list -v no longer displays build version

Eric Sproul eric.sproul at circonus.com
Wed Apr 8 20:25:59 UTC 2015


On Wed, Apr 8, 2015 at 4:12 PM, Lauri Tirkkonen <lotheac at iki.fi> wrote:
> It's just something to be aware of. I do remember testing whether it was
> possible to publish packages which omit branch and release versions back
> when I was patching a certain piece of configuration management software
> to handle pkg versions properly, and on 151006 pkg it was, so I built my
> regexes accordingly. Luckily, it seems.

I concur.  No need to rebuild or maintain a difference from upstream
for that.  Since the number of components in the version can now vary,
I opted for a series of substring operations in bash rather than a
single sed invocation, e.g.

pkgver=`pkg list -Hv $pkg 2>/dev/null`
pkgver=${pkgver#*@}      # trim up thru '@'
pkgver=${pkgver%:*}      # trim off ':' and after
pkgver=${pkgver//,5.11/} # eliminate build version, if present

This works on both 006 and 014.

Eric


More information about the OmniOS-discuss mailing list