On Thu, 05 Apr 2007 23:22:50 +0200 Goswin von Brederlow <[EMAIL PROTECTED]> wrote:
> > apt-cache policy already covers that output and it is easier to > > parse - the code offered by Ben Hutchings adds to my own code by > > supporting the priority figure specified in apt-cache policy, I was > > already parsing the rest. Thanks Ben. > > But it lacks information: The extra information isn't important UNLESS it means that the available sources will not include any Packages content for arm or whichever other architecture the user chooses to select to cross-build. The parsing of apt-cache policy is only used to identify the suite - at this stage of the process, the mirror in use for that suite is irrelevant. The suite is then checked against the list of supported suites for Emdebian to generate the emdebian repository source lines. A later stage then has to work out if a source exists for the chosen arch using the identified suite. If not, I'll need to add a primary mirror to /etc/apt/sources.list.d/emdebian.sources.list > 500 http://storage sid/main Packages > release o=Debian,a=unstable,l=Debian,c=main > origin ftp.de.debian.org > > Now is that > http://storage/debian/sid/main/binary-amd64/Packages > or > http://storage/mirror/debian/sid/main/binary-amd64/Packages > ? > > You just don't have all the info. All that needs to give me is which suite has the highest priority for main. > > Am I right in thinking that normal d-i installations ensure that at > > least one primary mirror is selected (or at least strongly advise > > that one primary should exist)? > > Nothing wrong with picking ftp.debian.org from the mirror list if one > is in us. D-I takes the full list, filters out mirrors that carry the > requested arch and then tries to pick one from the country the locales > are set to. Otherwise the user gets asked to pick one afaik. > > So nothing says the mirror you end up with on i386 will have arm > packages. So I'll need to adapt postinst to attempt to verify if there is a suitable source available for cross-building. There's no point in picking a mirror on the basis that it has packages for i386 and arm but not amd64 or mips. I'm adding a mirror purely to support cross-building with a toolset that can cross-build for any Debian arch, I need to ensure that a primary mirror is available and add one if it is not. I'll put a note in the manpage on how to optimise this: "If emdebian-tools identifies that your available sources do not contain at least one primary mirror, emdebian-tools will add the ftp.uk.debian.org primary mirror to /etc/apt/sources.list.d/emdebian.sources.list alongside the Emdebian repository. If you prefer to use a closer/faster primary mirror, please refer to the Debian Mirror List (href=) and add your preferred primary mirror to /etc/apt/sources.list, then use 'dpkg-reconfigure emdebian-tools' to update /etc/apt/sources.list.d/emdebian.sources.list. At least one primary mirror, as defined on the DML page, *must* be available to use emdebian-tools." This only occurs if the existing installation does not already use a primary. The added primary is only used when querying cache status of $arch packages *during* cross-building because the existing source always takes priority over sources in sources.list.d/. In this context, I don't think I'll implement the extra workload of deciding which primary to use, emdebian-tools can do what is necessary and leave the user instructions on how to optimise it, if appropriate. The question then follows: In order to calculate this situation, I'll need to parse apt-cache policy *and* `apt-cache -o Apt::Architecture= $arch pkgnames gcc` which requires that apt-get update has been run or can be run - doesn't that mean I'll need to pre-depend on apt? -- Neil Williams ============= http://www.data-freedom.org/ http://www.nosoftwarepatents.com/ http://www.linux.codehelp.co.uk/
pgpVfhYYjlYWv.pgp
Description: PGP signature