So, basically the pkg_info -E command gives you versions of a particular package (with package name and the version in the string that is returned)
Then you put each line of the output on the list pointed to by pkglist. The list pointed to by pkglist already has an element with name of a package that was put on the list because it was associated with a pkg_remove action in the parsing phase, but the code for FreeBSDPackageList doesn't really access that list until its starts adding to it with AppendItem. After returning from PackageList, in CheckPackages, you have a list pointed to by pending_pkgs with one element, that has the package name, and an element for every package of that name with the version that matched the comparison against the desired version. This eventually gets passed to ProcessPendingPackages? My main question is why do you need the first element with the package name? You are not accessing that element in the function FreeBSDPackageList and you already have the package name and version from the input file in the ptr structure. If I comment out the call to AppendItem, in CheckPackages (do.c line 2885), right before the call to PackageList, I get the get exactly what I want, the remove command with a list of all the packages (with version and revison number) that matched the cmp from the input file Craig J. Martin, Sr. Systems/Applications Engineer | Travelocity | *W: 682.605.6374 | *M: 972.365.2038 | Loc: B1-268 -----Original Message----- From: Jo Rhett [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 07, 2007 1:56 PM To: Martin, Craig Cc: bug-cfengine Subject: Re: cfengine code for PackageList and PackageCheck On Oct 30, 2007, at 1:31 PM, Martin, Craig wrote: > When you do pkg_info -E in FreeBSDPackageList, does pkg_info return > just > the version or the package name with the version attached? (i.e. > 1.30 vs > httpd-1.30 or something like that) Together. However we don't separate them in the cfengine code -- we use the freebsd utilities to do all version comparisons. So any version comparison problem is a OS bug, not a cfengine bug ;-) -- Jo Rhett senior geek Silicon Valley Colocation Support Phone: 408-400-0550 _______________________________________________ Bug-cfengine mailing list [email protected] https://cfengine.org/mailman/listinfo/bug-cfengine
