[plug] re: awk

Craig Foster fostware at iinet.net.au
Sun Jul 20 21:04:36 WST 2003


Craig Ringer wrote:
>> `awk` would certainly do the job. `sed` or `cut` might be easier,
>> though. (Craig suggested `cut` -- it should have the most obvious
>> usage.)
> 
> Unfortunately, it can't. Example RPM output:
> 
> bzip2-libs-1.0.2-8
> glib-1.2.10-10
> ...
> 
> 
> As you see, pkgnames can contain hyphens, which are also used to
> separate out the version from the pkgname. I suppose you could assume
> that any -[\d] sequence was the beginning of the version, but nothing
> stops someone having a pakgename of 'something-3d' for example.
> *sigh*. 
> 
> RPM's format print output options are the only way I can see to do it
> - as well as the way with the least messing about.
> 
> Hyphens should probably have been forbidden in pkgnames, but it's a
> bit late now...
> 
> Craig Ringer

I find the hyphens useful in differentiation between parts of a package,
eg:-

samba-client-2.2.8a-1cf2
e-smith-samba-1.7.2-08
samba-2.2.8a-1cf2
samba-common-2.2.8a-1cf2

In the case of custom RedHat based distro's it helps that the distro's
package extensions are prefixed by an identifier. Eg e-smith-samba alters
the way the main samba package works to fit with the distro. It *should*
work with subsequent samba versions. However it does NOT alter the
original files of the samba rpm, therefore keeping package conflicts to a
minimum. (not quite Debian though :P )

And --qf '%{NAME}\n' does get it's fair usage when removing packages too
:)

Regards,

Craig F.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3925 bytes
Desc: not available
URL: <http://lists.plug.org.au/pipermail/plug/attachments/20030720/8df1f448/attachment.bin>


More information about the plug mailing list