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

how does apt build the URL from the source specification?



Hi,

I'm writing a custom mirror script to mirror some unofficial apt source
sites.

Since I don't want to keep the original directory hierarchy, I thought I'd
build the URLs to fetch from the Packages file of the apt-source. However,
this appears to be a non-trivial task.

Basically, how do I get the URL of the package file from the following
information:

- sources.list line in the form of 'deb proto://A/ B C1 C2 ... Cn'

- 'Filename: ' line in the Packages file in the form of
  'dir1/dir2/.../dirn/filename.deb'

In some of the cases I've looked at,
'proto://A/dir1/dir2/.../dirn/filename.deb' would work; in others, 'B' or
even 'Ci' would have to show up in the URL.

Could you please specify the algorithm apt uses internally in pseudocode?

Thank you very much and best regards,

Andrew

-- 
            Andrew Korn (Korn Andras) <korn@chardonnay.math.bme.hu>
             Finger korn@chardonnay.math.bme.hu for pgp key. QOTD:
                A language is a dialect with an army behind it.



Reply to: