[pacman-dev] Removing deltas from repos - Was: Allow package to display a brief message before sync install
Marc - A. Dahlhaus
mad at wol.de
Thu Sep 17 16:13:03 EDT 2009
Xavier schrieb:
> On Thu, Sep 17, 2009 at 6:42 PM, Marc - A. Dahlhaus [ Administration |
> Westermann GmbH ] <mad at wol.de> wrote:
>> This is because you check for size and echo the delta on the same level
>> of the recursion and the condition checking is wrong. We need to check
>> for the retval of the recursion and actualy throw the error condition up
>> one level when we exceed the sizelimit. The checking can only work one
>> recursion level down from the current level because you push the actual
>> deltas size one level down.
>>
>> Recursions are fun are't they? ;-D
>>
>
> Both scripts have the same output.
> For example :
>
> 38866 < 139532 : Ignoring dhcpcd-4.0.2-1-i686.pkg.tar.gz
> 38866 < 88713 : Ignoring dhcpcd-4.0.2-2-i686.pkg.tar.gz
> 38866 < 87880 : Ignoring dhcpcd-4.0.3-1-i686.pkg.tar.gz
> 38866 < 67312 : Ignoring dhcpcd-4.0.4-1-i686.pkg.tar.gz
> 38866 < 57650 : Ignoring dhcpcd-5.0.2-1-i686.pkg.tar.gz
>
> vs
>
> dhcpcd-3.2.1-1_to_4.0.2-1-i686.delta 139532
> dhcpcd-4.0.2-1_to_4.0.2-2-i686.delta 88713
> dhcpcd-4.0.2-2_to_4.0.3-1-i686.delta 87880
> dhcpcd-4.0.3-1_to_4.0.4-1-i686.delta 67312
> dhcpcd-4.0.4-1_to_5.0.2-1-i686.delta 57650
>
> but I checked several other packages as well.
>
> So I am not sure what you are trying to explain.
Scratch the point about the check one level to high. Didn't realized
that you reused the var that you passed down one level in the check.
> Actually I was using the retval first, I just changed it at the end,
> and kept the same result.
> But now I just realize there is something wrong about it, and I
> actually don't know how it works at all. I set deltaname and newsize
> inside a subshell so normally we cannot access these outside.
I think we look at the same problem but from different angles. What i
think is needed to do in a cleanup run is to only care about the deltas
that need to be added to the new repo. Your plan was to use unneeded
ones as an argument for repo-remove, right? We don't need to. We only
need to recreate the new repos "deltas"-file content with the delta
lines of deltas we want to keep in the repo.
The recursion algorithm as proposed in my first mail takes care that it
only adds the deltas that are directly chained to the package version in
the repo with its walk down as long as the "delta-quota" is not reached.
It will add the lowest delta version first in the return path up to the
newest. The rest of deltas is unneeded.
The functions arguments and the vars created in its body are local. This
is ok as we
Take a look at attached version that actually implements the whole
cleanup this way. It's fast, short and self contained IMO.
What do you think?
I'll integrate it into repo-add and post a patch tomorrow.
Marc
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cleanup3.sh
URL: <http://mailman.archlinux.org/pipermail/pacman-dev/attachments/20090917/08ca5fae/attachment.ksh>
More information about the pacman-dev
mailing list