Any level is good.

On Nov 13, 2007, at 12:55 PM, Martin, Craig wrote:

> Which debug level should I use?
>
> 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: Tuesday, November 13, 2007 12:53 PM
> To: Martin, Craig
> Cc: bug-cfengine
> Subject: Re: cfengine code for PackageList and PackageCheck
>
> Craig, what I am saying is that what you believe simply doesn't
> happen.  I'm not in a position to pull up and show you the code to
> dispute it, but it does not occur.  I've got dozens of systems
> completely built from scratch and maintained using these package
> routines, and if the package name was prepended to the list I would
> see constant failures.
>
> Now please do as I requested and send debug output from the latest
> subversion showing this behavior.
>
> On Nov 13, 2007, at 12:45 PM, Martin, Craig wrote:
>> What do you mean by "those lists are discrete."  AppendItem is
>> called in
>> CheckPackages immediately preceeding PackageList and it appends the
>> item
>> with the package name onto pending_pkgs.  The variable  
>> pending_pkgs is
>> passed by address to PackageList.
>>
>> Here are the calls that pass pending_pkgs down to FreBSDPackageList
>>
>> --------------------------------------------------------------------- 
>> -
>
>> --
>> From CheckPackages in do.c line 2885
>>          AppendItem(&pending_pkgs,name,NULL);
>>
>> PackageList(ptr,name,ptr->pkgmgr,ptr->ver,ptr->cmp,&pending_pkgs);
>> --------------------------------------------------------------------- 
>> -
>
>> --
>>
>> This is not package manager specific, it is executed for all package
>> managers when the remove action is specified in the input file.   
>> Every
>> time PackageList is invoked, pending_pkgs should have one item
>> containing the package name . . .
>>
>> The PackageList function receives the pointer to pending_pkgs as
>> "struct
>> Item **pklist".
>>
>> --------------------------------------------------------------------- 
>> -
>
>> --
>> From PacakgeList in package.c line 132
>> int PackageList(struct Package *ptr,char* package, enum pkgmgrs
>> pkgmgr,
>> char *version,enum cmpsense cmp, struct Item **pkglist)
>> --------------------------------------------------------------------- 
>> -
>
>> --
>>
>> PackageList passes it, untouched, to each of the package manager
>> specific functions including FreeBSDPackageList
>>
>> --------------------------------------------------------------------- 
>> -
>
>> --
>> From PackageList in package.c line 153
>>       match = FreeBSDPackageList(package, version, cmp, pkglist);
>> --------------------------------------------------------------------- 
>> -
>
>> --
>>
>> After FreeBSDPackageList executes the pkg_info command, it adds an
>> item
>> to the list pkglist, for each line of the command output, with
>> AppendItem.
>>
>> --------------------------------------------------------------------- 
>> -
>
>> --
>> From FreeBSDPackageList in package.c line 1901
>> while (!feof (pp))
>>    {
>>    *VBUFF = '\0';
>>    ReadLine (line, CF_BUFSIZE - 1, pp);
>>    Debug("PackageList: read line %s\n",line);
>>
>>    if( strlen(line) > 1 )
>>       {
>>       snprintf(OUTPUT,CF_BUFSIZE,"Package to remove: %s\n",line);
>>       AppendItem(pkglist,line,"");
>>       }
>>    }
>> --------------------------------------------------------------------- 
>> -
>
>> --
>>
>> I can't see a way that the item with the package name cannot be on  
>> the
>> pkglist when FreeBSDPackageList gets it.
>>
>> This actually seems like a problem for remove, because further
>> down, in
>> CheckPackages, ProcessPendingPackages is called based on if the list
>> pending_pkgs has an element on it.  Even if PackageList didn't find
>> any
>> versions that match, the first element would still be on the list.
>>
>> Am I missing something?
>>
>> Craig J. Martin, Sr. Systems/Applications Engineer | Travelocity |  
>> *W:
>> 682.605.6374 | *M:  972.365.2038 | Loc: B1-268
>
> -- 
> Jo Rhett
> senior geek
>
> Silicon Valley Colocation
> Support Phone: 408-400-0550
>
>

-- 
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

Reply via email to