On Mon, Dec 14, 2009 at 12:02 AM, Shawn Walker <swal...@opensolaris.org> wrote:
> Peter Tribble wrote:
>>
>> On Thu, Dec 3, 2009 at 7:43 PM, Shawn Walker <swal...@opensolaris.org>
>> wrote:
>>>
>>> Vikash Tulsiyan wrote:
>>>>
>>>> Do we have a " pkginfo -q" equivalent in IPS. I want to just check if a
>>>> package is installed without all the details
>>>
>>> Check the return code of "pkg info <name>"; if it's 0, the package is
>>> installed, otherwise it isn't installed.
>>
>> Apart from the minor irritant of having to throw away the output,
>> using pkg is significantly more expensive, particularly for packages
>> that are installed:
>>
>>> ptime pkginfo -q SUNWtcsh
>>
>> real        0.032076561
>> user        0.008303552
>> sys         0.017553991
>>
>>> ptime pkg info SUNWtcsh
>>
>> real        2.317786366
>> user        1.105758292
>> sys         0.876040367
>>
>>> ptime pkginfo -q froggle
>>
>> real        0.027556938
>> user        0.007866105
>> sys         0.016008880
>>
>>> ptime pkg info froggle
>>
>> real        0.649661522
>> user        0.359215141
>> sys         0.252858754
>>
>> It's sufficiently slow that using pkg to work out whether packages are
>> or aren't installed isn't really a viable option.
>
> And which version of pkg or build of OpenSolaris are you using to do that?

128a

> This is what I see:
>
> $ ptime pkg info SUNWtcsh
> pkg: info: no packages matching the following patterns you specified are
> installed on the system.  Try specifying -r to query remotely:
>
>        SUNWtcsh
>
> real        0.242818029
> user        0.199911385
> sys         0.042019782
>
> ...but I'm running build 129.  There have been major performance
> improvements in pkg in recent builds.
>
> And sorry, but you're complaining about .64 seconds?  Seriously?

Absolutely. Do that multiple times across hundreds of servers and it
becomes considerable. The conclusion is that you;ll avoid using pkg
to determine whether a package is installed, but end up using some
other mechanism, like checking for a file you hope will always be in
the package.

-- 
-Peter Tribble
http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to