On 03/12/10 02:30 PM, Sean Wilcox wrote:
On 03/12/10 01:24 PM, Shawn Walker wrote:
On 03/12/10 02:19 PM, Sean Wilcox wrote:
If I do a pkg info on an old package name (e.g SUNWloc) should it return
info if text/locale is installed. In other words should pkg be smart
enough to follow the rename?
It should show if you if the package has been renamed, but it should
not automatically follow it.
That is what I'm experiencing it is not following it when I do the pkg
info (or more precisely the zones
test suites configure script). Which is checking for packages installed
on the system and then attempting
to install them if not present.
For example a pkg info SUNWloc fails, and then a pkg install of SUNWloc
progresses with no updates
needed, which in the current configure script causes a failure.
I have copied Jim on this so that he is aware.
So yes, the behaviour could be viewed as a bit confusing. What's
happening is that 'pkg info' is both for retrieving information about a
specific package, and without -r, can also be used to check whether the
package is installed by checking the exit code of pkg(1).
However, in the case of install, the user isn't checking for the status
of a package -- they're requesting a specific package to install. So,
in the case of a renamed package, install will follow the rename if that
rename applies to your system.
Consider that, if you are on a b132 system, and you attempt 'pkg install
SUNWloc', that the rename didn't actually happen until 133, so install
should install SUNWloc, but if you were on a b133 or later system, it
knows that the rename applies and starts planning an install operation.
If your desire is to simply ensure that the package is installed, just
use 'pkg install' and check the exit code(s) documented in the pkg(1)
man page as Danek suggested. You might also want to consider using the
--no-refresh option if you were doing this for multiple packages in an
automated manner to reduce overhead.
If you were actually trying to see if something was installed for a
specific build, then you may need a different check.
Cheers,
--
Shawn Walker
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss