On 3/9/08, Mateusz Poszwa <[EMAIL PROTECTED]> wrote:
> That's why I said:
>
> Dnia 08-03-2008, sob o godzinie 12:00 -0800, Cameron Dale pisze:
>
> > On 3/8/08, Mateusz Poszwa <[EMAIL PROTECTED]> wrote:
>
> > > If debtorrent is the only method of obtaining packages
Sorry, I missed that. :)
> I know a method of doing that. Package fslint is required.
>
> # /usr/share/fslint/fslint/findup \
> -m /var/cache/apt/archives /var/cache/debtorrent
Another great tip! Thanks again. :)
> Advantage is that it deletes&links only packages common for both caches.
> Unfortunately it runs rather slow, and requires additional dependency.
> What is more, it is not safe, because if files are on different
> filesystems or machines it produces symbolic links instead of hardlinks.
That might still work, as long as the symlinks are in the apt cache.
Symlinks in the DebTorrent cache will definitely not work, but I'm not
sure how apt will behave when there are symlinks in its cache.
> I think of writing a script which would work like that:
>
> if(caches are on the same machine and the same filesystem){
> for_each(package in debtorrent's cache){
> if(corresponding package in apt's cache exists){
> if(and is not a hardlink of package in debtorrents cache){
> delete it}
> else{
> break;}//in order not to let ln throw any error messages
> create link to package in debtorrent's cache named just like the\
> package deleted a moment ago (as names of files are usually slightly\
> different)}}}
That's pretty much what I was thinking of too. Except for the "names
of files are usually slightly different" part, which I don't see ever
happening. Why would the package file be named differently in apt's
cache than in DebTorrent's?
> This would solve the problem of packages which are in apt's cache only.
> A side effect of this solution is that packages, which were previously
> only in debtorrent's cache are in both caches after executing the
> script, but i think it is not a big problem (it is even desirable ;).
I agree.
> I wonder if there is a method of making apt try creating hardlink before
> making actual copy of package. This would be (IMO) the best solution.
I don't believe there is, although as I mentioned in my previous mail
to this bug, you can make apt not create a copy of the file in it's
cache at all. Not ideal, but still a possible solution.
Cameron
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]