Re: [Pkgutil-users] patch to support non-standard VERSION entries
Status: Beta
Brought to you by:
bonivart
|
From: Peter B. <bon...@op...> - 2010-07-24 13:40:59
|
On Fri, Jul 23, 2010 at 12:24 PM, <ma...@pr...> wrote:
> Can I suggest that the following patch is accepted into the next release of
> pkgutil?
>
> *** 2.1b1/pkgutil Sat Jul 17 15:44:53 2010
> --- pkgutil-2.1b1-edited Fri Jul 23 11:00:14 2010
> ***************
> *** 1776,1781 ****
> --- 1776,1783 ----
> @p2list = split(/\./,$p2tmp);
>
> for (my $i = 0; $i < scalar(@p1list); $i++) {
> + $p1list[$i] =~ s/[^0-9]//g;
> + $p2list[$i] =~ s/[^0-9]//g;
> if (! $p2list[$i]) {
> $update = 1;
> last;
>
> The reason we need this is we are using pkgutil against our own internal
> repository, and we have in-house developed packages and third party packages
> with non-standard VERSION parameters, such as:
>
> VERSION=2.0p1,REV=16_sun
> or
> VERSION=5.0,REV=5.0A55_sol
>
> pkgutil currently splits the REV component by dots and then performs a
> numerical comparison on each element in order to determine which package is
> more current. This works for us just fine, except that the components are
> not entirely numerical so we get the following errors:
>
> Argument "16_sun" isn't numeric in numeric ne (!=) at /opt/csw/bin/pkgutil
> line 1783.
> Argument "18_sun" isn't numeric in numeric ne (!=) at /opt/csw/bin/pkgutil
> line 1783.
>
> The patch above fixes this issue by stripping all non-digits from an element
> before performing the comparison.
Since It's a numerical comparison it could be considered a bug not
cleaning up the values so I have checked in your change, it will be in
2.1 released soon. Thank you.
--
/peter
|