On 01-07-11 16:40, no-re...@cfengine.com wrote:
> Forum: Cfengine Help
> Subject: Re: Cfengine Help: Re: Advice on using package promises
> Author: jgreer
> Link to topic: https://cfengine.com/forum/read.php?3,22694,22697#msg-22697
>
> Bas,
>
> Thanks for the feedback.
>
> I was hoping, in the general case (there may be occasions where I'll need to 
> be more explicit), to write promises in terms of simply the application 
> version (1.2.7), as opposed to the long format you've proposed, which is the 
> concatenation of the application version and the release of the package 
> itself:
>
> # /bin/rpm -qa --qf '%{name} %{epoch} %{version} %{release} %{arch}\n' apr
> apr (none) 1.2.7 11.el5_6.5 x86_64
> apr (none) 1.2.7 11.el5_6.5 i386
>
>
> The yum manpage indicates "name-version" is a valid format:
>
>         Specifying package names
>                A package can be referred to for install,update,list,remove 
> etc with any of the following:
>
>                name
>                name.arch
>                name-ver
>                name-ver-rel
>                name-ver-rel.arch
>                name-epoch:ver-rel.arch
>                epoch:name-ver-rel.arch
>
>                For example: yum remove kernel-2.4.1-10.i686
>
>
> It's my hope that the ultimate resolution to Cfengine package version 
> comparison problems for RPM supports all three valid means of grouping 
> version-related information:
>
> ver
> ver-rel
> epoch:ver-rel
>
> That is, if I craft a "package_version_regex" that results in any of the 
> above formats, Cfengine should be able to make the correct string comparison.
>

Jessica,

  Thanks for the detailed info about yum.  With your package_method. 
Cfengine parse the package in this format:
  Package (apr,1.2.7,x86_64) found


Then it try's to see if its installed and matches:
 > Looking for (apr-1.2.7,*,x86_64)
cf3> No installed packages matched (apr-1.2.7,*,x86_64)
cf3>  -> Looking for (apr-1.2.7,*,x86_64)
cf3> No installed packages matched (apr-1.2.7,*,x86_64)
cf3> Checking if package (apr-1.2.7,*,x86_64) is at the desired state 
(installed=0,matched=0)
cf3>  -> Package promises to refer to itself as "apr-1.2.7-*" to the manager
cf3> !! Package name contians '*' -- perhaps a missing attribute 
(name/version/arch) should be specified
cf3>  -> Package version seems to match criteria
cf3>  -> Schedule package for addition

This fails because cfengine expect a package name with a seperate version. 
So it can not find the package 'apr-1.2.7', See out out of cfengine parse 
the yum output. After this is will schedule the package for update. Because 
the match/select will always fail. It will always try to install/update the 
package. A you experienced. Or all combo's of yum must be implemented. I 
did not know that there where that many ;-). Or you must use package name 
without versions numbers and use the version in the package_select statement.

cf3>  -> Package (apr-1.2.7-*,any,any) found
cf3> Execute scheduled package addition
cf3> Command prefix: /usr/bin/yum -y install
cf3> Executing /usr/bin/yum -y install apr-1.2.7-*...
cf3> Q:yum -y install apr-1 ...:Loaded plugins: dellsysid, fastestmirror, 
protectbase, versionlock
cf3> Q:yum -y install apr-1 ...:Loading mirror speeds from cached hostfile
cf3> Q:yum -y install apr-1 ...: * glite-TORQUE_client: glitesoft.cern.ch
cf3> Q:yum -y install apr-1 ...: * glite-TORQUE_externals: glitesoft.cern.ch
cf3> Q:yum -y install apr-1 ...: * glite-TORQUE_updates: glitesoft.cern.ch
cf3> Q:yum -y install apr-1 ...: * glite-WN: ftp.sara.nl
cf3> Q:yum -y install apr-1 ...: * glite-WN_ext: ftp.sara.nl
cf3> Q:yum -y install apr-1 ...: * glite-WN_updates: ftp.sara.nl
cf3> Q:yum -y install apr-1 ...:10797 packages excluded due to repository 
protections
cf3> Q:yum -y install apr-1 ...:Reading version lock configuration
cf3> Q:yum -y install apr-1 ...:Setting up Install Process
cf3> Q:yum -y install apr-1 ...:Package apr-1.2.7-11.el5_6.5.x86_64 already 
installed and latest version
cf3> Q:yum -y install apr-1 ...:Package apr-1.2.7-11.el5_6.5.i386 already 
installed and latest version
cf3> Q:yum -y install apr-1 ...:Nothing to do
cf3> Q:yum -y install apr-1 ...:
cf3>  -> Finished command related to promiser "apr-1.2.7" -- succeeded
cf3> Package schedule execution ok for apr-1.2.7-* (outcome cannot be 
promised by cf-agent)



regards





-- 
********************************************************************
*  Bas van der Vlies                    e-mail: b...@sara.nl       *
*  SARA - Academic Computing Services   Amsterdam, The Netherlands *
********************************************************************
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to