Re: cfengine2 bug with unrecognized package version (dpkg)
Eric Searcy <[email protected]> Mon, 27 Apr 2009 10:54:28 -0700
| Newsgroups | gmane.comp.sysutils.cfengine.bugs |
|---|---|
| Message-ID | <[email protected]> |
Daniel Ortmann wrote:
> Hello,
>
> Am I the only one having problems with package versions not being recognized?
> I am running the recent jaunty ubuntu with the following bind9 installed as
> reported by dpkg --list bind9:
> 1:9.5.1.dfsg.P2-1
>
> Cfengine2 has a problem recognizing that bind9 is installed. The system
> architecture is x86_64 (i.e. Core2 Duo).
>
> I am running configurations modified from Nate Campi and Kirk Bauer's recent
> excellent book "Automating Linux and Unix System Administration".
>
> Note that DefaultPkgMgr = ( dpkg ) as in the book.
>
> I have tried the variations on the following packages section, including no
> version as well as all the other versions listed here and "ge" and "eq".
>
> packages:
> debian::
> bind9
> #version=1:9.5.1.dfsg.P2-1
> #version="1:9.5.1.dfsg.P2-1"
> version=9.3.4
I suspect this is a cf parsing issue rather than something going awry in
the package.c routine. The test that is done is based on the string in
the "Installed:" portion of "apt-cache policy pkgname." If it matches
exactly your version=, then cmp=le, cmp=ge, and cmp=eq will match. If
the string doesn't match (aside from the "(none)" case) it uses "dpkg
--compare-versions INSTALLEDVER {gt|lt} CFVER" to determine comparison.
So ...
There might be an issue with the colon here, which in some cases you
need to escape (like in shellcommands). So maybe:
version=1\:9.5.1.dfsg.P2-1
Unfortunately DPKGPackageCheck() never verbosely outputs the version
asked for, but you can find it in the debug promise output.
Here's a snippet from `cfagent -qdn -j packages':
> PROMISED PACKAGE CHECKS
>
> ExpandVarstring( httpd.x86_64 )
> Add |httpd.x86_64| to str, waiting at ||
> Returning varstring (httpd.x86_64)
> Package "httpd.x86_64" promises
> Search constraint body:
> Will have version ge 2.2.3-11.el5_2.centos.4
> Behaviour constraint body:
> Promise to install package
> Using Package database: rpm
> IfElapsed=0, ExpireAfter=120
> Define if matches
> ElseDefine if no match
> Rule from /var/cfengine/inputs/httpd at/before line 11
What do you have in there under "search constraint body" when you have
version=1:9.5.1.dfsg.P2-1, and does using a backslash help?
Eric
_______________________________________________
Bug-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/bug-cfengine
signature.asc
(application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkn18VYACgkQ2dLsqno9ypegcgCgnkWeWDsCiYwuMaIEjvFXZLF9 NxgAnRGNJ+AhMSE6pmikhXL5fooBu1Ux =Wwvg -----END PGP SIGNATURE-----