On Wed, 04 Apr 2007 10:47:00 +0200 Goswin von Brederlow <brederlo@informatik.uni-tuebingen.de> wrote: > Parse sources.list. Many people have multiple suites in there and you > will want to add multiple entries then. 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. > You also want to pick a mirror > near to the mirror already used. That won't work - the only reason to add a primary mirror is when the system is not using ANY primary mirrors, just something like ftp.debian.org as set by debootstrap. Therefore, there is no reliable way of telling what mirror is close because the existing setting has not been set by the user. AFAICT this only happens with debootstrap. I'm actually now thinking of *not* adding a primary mirror *unless* ftp.debian.org is the only source in apt-cache policy. Then I'll add some code that tries to check that the provided mirror(s) support the architectures requested. (The code already exists, it just needs to make a more usable error message once these postinst changes have done what can be done to narrow down the reasons for the error.) I'm undecided whether adding the primary mirror outside a debootstrap installation should be an automated step or just a usable error message with a detailed note in the manpage. However, it is important that debootstrap installations using ftp.debian.org are handled automatically, so that I can build scripts around debootstrap without the hassle of patching it and without needing user intervention. (debootstrap takes long enough without the user finding that it's stalled waiting for an obvious answer to a prompt.) 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)? The Emdebian repository would still be added but there is no other mirror for that so there's no question of finding anything nearer to the user. That isn't a problem, that repository only contains the toolchains. Adding a second primary mirror isn't actually that much of a problem anyway - apt will prefer the first mirror in /etc/apt/sources.list before using files in /etc/apt/sources.list.d/ so the *only* time that the primary mirror is needed is when emdebian-tools itself tries to read: apt-cache -o Apt::Architecture=arm or whatever because apt will not be able to find that arch at ftp.debian.org and will therefore use the added primary. I will look at 'ucf' to manage the file in /etc/apt/sources.list.d/ - as you suggested. However, if no primary mirror needs to be added to /etc/apt/sources.list.d/emdebian.sources.list, I'm not sure ucf is necessary - ucf isn't relevant in a debootstrap chroot. Options, options . . . -- Neil Williams ============= http://www.data-freedom.org/ http://www.nosoftwarepatents.com/ http://www.linux.codehelp.co.uk/
Attachment:
pgpr51Zshmnxi.pgp
Description: PGP signature