[Slapt-get-devel] slapt-get source priority patches
Jason Woodward
woodwardj at jaos.org
Mon Nov 24 20:16:44 EST 2008
Hi Ken,
> Specifically:
>
> * When comparing two packages on mirrors:
>
> - The package with the highest priority wins, but:
> - If the priorities tie, then the package with the highest version
> number wins.
>
> * When comparing an installed package with a mirror package:
>
> - If the two packages have *exactly* the same version string, then they
> compare equal, regardless of priorities.
> - Otherwise, the package with the highest priority wins. (Taking the
> priority of the installed package as zero). But:
> - If the priorities tie, then the package with the highest version
> number wins.
good specs
> If I have read your patch correctly, then when you have two packages
> with the same version number on different mirrors, it will be pot luck
> which one gets installed. You may or may not consider this a bad thing,
> but I consider it very, very bad!
I did not see that specific problem in the initial pass, thanks for clarifying.
Since I would rather not have two specific comparison functions made even trickier by using a
specific one depending on the context... how about this:
* add an installed attribute to the package that is set when parsing the /var/log/packages
entries that defaults to false in slapt_init_pkg()
* in slapt_cmp_pkgs(), insert
- /* bail out early if possible */
- if (strcasecmp(a->version,b->version) == 0)
- return equal;
+ /* if either of the two packages is installed, we look
+ for the same version to bail out early if possible */
+ if (a->installed == SLAPT_TRUE || b->installed == SLAPT_TRUE)
+ if (strcasecmp(a->version,b->version) == 0)
+ return equal;
That should fulfill the specifications you outlined, yes? Attached is a diff against the
previous patch.
take care,
jason
--
Jason Woodward
woodwardj at jaos.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: online_installed.diff
Type: text/x-patch
Size: 923 bytes
Desc: not available
URL: <http://software.jaos.org/pipermail/slapt-get-devel/attachments/20081124/b0985b34/attachment.bin>
More information about the Slapt-get-devel
mailing list