[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: apt-get wrapper for maintaining Partial Mirrors



On Friday 19 June 2009 00:27:06 Goswin von Brederlow wrote:
> Joseph Rawson <umeboshi3@gmail.com> writes:
> > BTW, the subject of this thread is "apt-get wrapper for maintaining
> > Partial Mirrors".  The solution I'm proposing is "a simple tool for
> > maintaining Partial Mirrors" (which could possibly be wrapped by apt-get
> > later).
> >
> > I think that just pursuing an "apt-get wrapper" leads to some
> > complications that could be avoided by creating the "partial mirror tool"
> > first, then looking at wrapping it later.  One complication might be "how
> > do handle apt-get remove", and another might be "how to handle sid
> > libraries that disappear from official repository, yet local machines
> > must have them".
>
> Ahh, so maybe I completly misread that part.
>
> Do you mean a wrapper around apt-get so that "apt-get install foo" on
> any client would automatically add "foo" to the list of packages being
> mirrored on the server?
>
> If so then you can configure a post invoke hook in apt that will copy
> the dpkg status file of the host to the server [as status.$(hostname)]
> and then use those on the server to generate the filter for
> reprepro. I think I still have a script for that somewhere but it is
> easy enough to rewrite.
>
When you mentioned the word "hook", I was reminded of reprepro's ability to 
use hooks.  I started testing using a ListHook script with reprepro.  I'm 
attaching the script so you can see the general idea.  The script doesn't do 
anything effective, but may be helpful in understanding more of the way I'm 
approaching the idea.  Please don't laugh too hard, I'm just playing with 
ideas now.

Among other possible reasons, there are two main reasons why this particular 
approach won't work.  One reason is that the ListHook calls a script for each 
list independently.  So, if you have a package in contrib that depends on a 
package in main, like many do, the dependency won't be resolved using this 
method.  Also, the germinator object only handles one arch at a time, so if 
you are mirroring multiple arches, you need to use a germinator object for 
each one.  One way that this problem can be countered is by running a simple 
server that holds the germinator object, and the script that ListHook 
executes would communicate with that server.  Then the server would "grow" 
the seeds and create the filter lists that would be used by reprepro.

I tried this approach because I didn't see the sense in downloading the 
packages lists more than necessary.  The way I was thinking before was to 
seed germinate (which would download the package lists), parse the output, 
create filter lists from that output, send them to reprepro, and call 
reprepro to update.  This forces all of those package lists to be downloaded 
twice, which was something I tried to avoid with this short experiment.

It also seems to be somewhat difficult to "plant the seeds" into germinate 
manually.  I'm sure that problem could be solved by looking through the code 
a bit longer.

> MfG
>         Goswin



-- 
Thanks:
Joseph Rawson

Attachment: testgerm
Description: application/python

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: