Sorry for the delay, now that trunk is stable I'm poking at your patch.

On Jul 20, 2007, at 5:14 PM, [EMAIL PROTECTED] wrote:
> @@ -2778,8 +2779,31 @@ for (ptr = VPKG; ptr != NULL; ptr=ptr->n
>        AddMultipleClasses(ptr->defines);
>        if (ptr->action == pkgaction_remove)
>           {
> -         PackageList(ptr->name, ptr->pkgmgr, ptr->ver, ptr->cmp,  
> &pending_pkgs);
> -         AppendItem(&pending_pkgs, ptr->name, NULL);
> +         if (ptr->pkgmgr == pkgmgr_portage && (ptr->ver)[0])
> +            {
> +            /* Portage doesn't use a list, just the package atom */
> +            int wholesize = 2 + strlen(ptr->name) + strlen(ptr- 
> >ver) + strlen(CMPSENSEOPERAND[ptr->cmp]);
> +            wholepackage = (char *) malloc(wholesize);
> +            strncpy(wholepackage, CMPSENSEOPERAND[ptr->cmp],  
> wholesize - 1);
> +            strncat(wholepackage, ptr->name, wholesize - strlen 
> (wholepackage) - 1);
> +            strncat(wholepackage, "-", wholesize - strlen 
> (wholepackage) - 1);
> +            strncat(wholepackage, ptr->ver, wholesize - strlen 
> (wholepackage) - 1);

Woah!  That is probably not what you want...  you are replacing the  
installation version with the to-check-for version.  What if you want  
to check for any 2.x but install 2.1.4 if not?

And as I asked in a previous message, could you write out what you  
are trying to accomplish here?  Show me input, then output, and why  
it is better...  I'm not trying to hold you back, I'm just very aware  
that I don't "get it" and I'd rather understand it before I propose  
anything.

> +            /* Replace pkg->name with package atom */
> +            free(ptr->name);
> +            ptr->name = wholepackage;
> +            wholepackage = NULL;
> +
> +            AppendItem(&pending_pkgs, ptr->name, NULL);

I would think that you should not touch the pkg item and instead use  
this single line...

+            AppendItem(&pending_pkgs, wholepackage, NULL);

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