On 9/7/10 5:37 PM, "Geoff Davis" <gada...@ucsd.edu> wrote: > It appears that Cfengine 2.2.10 does not handle Solaris SVR4 package names > with hyphens in them correctly. > > Given a statement like > packages: > solaris:: > CSWpy-numpy pkgmgr=sun action=install > > From my reading of the source code, the function SUNPackageCheck() in > packages.c incorrectly assumes that CSWpy is the package name, and numpy is > the requested package version. See lines 1220 and 1258 in packages.c [1] > > I don't care which version of a package is installed - I always want the > freshest version of a package. So it makes little sense to me to request a > particular version of a package by doing something like > CSWpy-numpy-EXPLICITVERSIONHERE per the manual. [2] This also breaks if your > favorite package has a funny version string like 0.2.4-alpha
This affects my BSD/Linux clients too... So don't think it is Solaris specific? Maybe the same implementation was shared. We "fix" this by doing what you don't like... Using something like "package-name-" and then version=1.2.3. However, I'll play devil's advocate... And this will ultimately depend on the size/volatility of your environment. If you "always grab the latest", rebuilds could very well be inconsistent. (Perhaps RelEng builds a new package, and it gets pushed out as soon as it's dropped on your build server but before you've had time to test, update monitoring for new semantics, etc.) This can get quite nasty in large environments with many hands in the cookie jar, so we actually adopted a best practice of always specifying package versions in policies. New releases update packages and policies to match. > I thought about modifying the code to packages.c to first try looking for the > whole package name as specified in the package argument to SUNPackageCheck, > and then fall back to checking for the version to be after the last hypen, but > this would fall down in cases where you had a package called VENDfoo installed > but you needed VENDfoo-bar installed. > > I'm tempted to just modify my package install wrapper script to look for the > string "-ANYVERSION" and strip it from the package names to trick > SUNPackageCheck() into doing the "right" thing. Any thoughts? If you do decide to patch it, I'd be willing to help test on FreeBSD (most versions) and RHEL/CentOs (5). I have found it mildly annoying, but after internal discussion learned to live with it. _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine