Dnia 08-03-2008, sob o godzinie 12:00 -0800, Cameron Dale pisze:
> This would clean out ALL packages files though, and replace them with
> only the ones downloaded by DebTorrent, so if you have 'deb' lines in
> your sources.list file that aren't pointing to DebTorrent you may want
> to think twice before doing this.
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
Dnia 08-03-2008, sob o godzinie 12:00 -0800, Cameron Dale pisze:
> On 3/8/08, Mateusz Poszwa <[EMAIL PROTECTED]> wrote:
> > In case the caches are on different slices ln throws error messages,
> > so there is ability to catch them and fall back.
>
> I guess this adds another possible solution to this bug, in addition
> to the one I already mentioned, so I'll have to decide which one is
> better. Probably this method is better, especially if I make a script
> that removes and links only the files in apt's cache that debtorrent
> has available.
I know a method of doing that. Package fslint is required.
# /usr/share/fslint/fslint/findup \
-m /var/cache/apt/archives /var/cache/debtorrent
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.
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)}}}
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 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.
PS: Thank you for a dpkg::post-invoke tip. ;)
--
Sorry for my English.
Regards from Poland
Mateusz "Old" Poszwa
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]