Bug#348509: add support for local archives
Here's a new version of generators/60local. I've added support for deb-src, and the syntax for apt-setup/local../repository has changed. Also the key handling is now a bit more robust, because every key is on it's own file. Colin suggested that the templates are not necessary because a dummy template is generated on the fly if needed. I'm not sure what happens if the db_get-commands fail in the case that some settings are not set. -- #!/bin/sh set -e . /usr/share/debconf/confmodule file="$1" # initial value i=0 while db_get "apt-setup/local$i/repository" && [ "$RET" ]; do repository="$RET" db_get apt-setup/local$i/comment comment="$RET" db_get apt-setup/local$i/key key="$RET" echo >> $file cat >> $file <> $file <
Bug#348509: add support for local archives
Ok, silence is good, right? =) Here are the patches for templates and documentation: --- preseed.xml 2006-01-17 13:04:29.786028000 +0200 +++ preseed.xml.copy2006-01-23 10:38:37.546467000 +0200 @@ -666,7 +666,7 @@ Setup of the /etc/apt/sources.list and basic configuration options is fully automated based on your installation method and answers to -earlier questions. Only the three variables below are relevant for preseeding. +earlier questions. You can also add other repositories. @@ -676,7 +676,12 @@ #d-i apt-setup/contrib boolean true # To avoid adding security sources, or to use a different server # than security.debian.org. -#d-i apt-setup/security_host string +#d-i apt-setup/security_host string +# Additional repositories, local[0-9] available +#d-i apt-setup/local0/comment string local server +#d-i apt-setup/local0/repository string deb http://local.server/debian stable main +# URL to the public key of the repository +#d-i apt-setup/local0/key string http://local.server/key --- apt-mirror-setup.templates.orig 2006-01-17 14:13:33.531371000 +0200 +++ apt-mirror-setup.templates 2006-01-23 10:30:44.587941000 +0200 @@ -35,3 +35,123 @@ network, or with the mirror. You can choose to retry the download, select a different mirror, or ignore the problem and continue without all the packages from this mirror. + +Template: apt-setup/local0/comment +Type: string +Description: Comment for local repository. + +Template: apt-setup/local1/comment +Type: string +Description: Comment for local repository. + +Template: apt-setup/local2/comment +Type: string +Description: Comment for local repository. + +Template: apt-setup/local3/comment +Type: string +Description: Comment for local repository. + +Template: apt-setup/local4/comment +Type: string +Description: Comment for local repository. + +Template: apt-setup/local5/comment +Type: string +Description: Comment for local repository. + +Template: apt-setup/local6/comment +Type: string +Description: Comment for local repository. + +Template: apt-setup/local7/comment +Type: string +Description: Comment for local repository. + +Template: apt-setup/local8/comment +Type: string +Description: Comment for local repository. + +Template: apt-setup/local9/comment +Type: string +Description: Comment for local repository. + +Template: apt-setup/local0/repository +Type: string +Description: Local repository to be added in sources.list. + +Template: apt-setup/local1/repository +Type: string +Description: Local repository to be added in sources.list. + +Template: apt-setup/local2/repository +Type: string +Description: Local repository to be added in sources.list. + +Template: apt-setup/local3/repository +Type: string +Description: Local repository to be added in sources.list. + +Template: apt-setup/local4/repository +Type: string +Description: Local repository to be added in sources.list. + +Template: apt-setup/local5/repository +Type: string +Description: Local repository to be added in sources.list. + +Template: apt-setup/local6/repository +Type: string +Description: Local repository to be added in sources.list. + +Template: apt-setup/local7/repository +Type: string +Description: Local repository to be added in sources.list. + +Template: apt-setup/local8/repository +Type: string +Description: Local repository to be added in sources.list. + +Template: apt-setup/local9/repository +Type: string +Description: Local repository to be added in sources.list. + +Template: apt-setup/local0/key +Type: string +Description: Optional public key for the repository. + +Template: apt-setup/local1/key +Type: string +Description: Optional public key for the repository. + +Template: apt-setup/local2/key +Type: string +Description: Optional public key for the repository. + +Template: apt-setup/local3/key +Type: string +Description: Optional public key for the repository. + +Template: apt-setup/local4/key +Type: string +Description: Optional public key for the repository. + +Template: apt-setup/local5/key +Type: string +Description: Optional public key for the repository. + +Template: apt-setup/local6/key +Type: string +Description: Optional public key for the repository. + +Template: apt-setup/local7/key +Type: string +Description: Optional public key for the repository. + +Template: apt-setup/local8/key +Type: string +Description: Optional public key for the repository. + +Template: apt-setup/local9/key +Type: string +Description: Optional public key for the repository. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#348509: add support for local archives
On Tue, 17 Jan 2006, Timo Aaltonen wrote: I'll make another patch tomorrow. Ok, here's the script. Could something like this work? Note that there are more debconf-keys (three per entry). That would mean adding templates for all apt-setup/local[0-9]/{comment, repository, key}, which would add 30 templates? This also assumes that /tmp and apt-key are ready for abuse. t --- #!/bin/sh set -e . /usr/share/debconf/confmodule file="$1" for i in 0 1 2 3 4 5 6 7 8 9; do db_get apt-setup/local$i/comment comment="$RET" db_get apt-setup/local$i/repository repository="$RET" db_get apt-setup/local$i/key key="$RET" if [ -n $repository ]; then echo >> $file cat >> $file <
Bug#348509: add support for local archives
Timo Aaltonen wrote: > I could do that also, maybe section B.4.6 is the obvious place? There's a preseed.xml that documents preseeding, I don't know what section this corresponds to. > That's true, I'll look into it although at the moment this is a bit > unfamiliar business to me. But that's what documentation is for.. http://wiki.debian.org/SecureApt > Ok, I was under the impression that Templates are needed for all debconf > settings.. We do include debconf templates for all settings, but they don't need to have translatable Description fields (so lose the _) -- see shy jo signature.asc Description: Digital signature
Bug#348509: add support for local archives
On Tue, Jan 17, 2006 at 11:38:50PM +0200, Timo Aaltonen wrote: > On Tue, 17 Jan 2006, Joey Hess wrote: > >Timo Aaltonen wrote: > >>+Template: apt-setup/local > >>+Type: string > >>+_Description: Local archive(s) to be added in sources.list > > > >No need to localise this since it doesn't ask the question. > > Ok, I was under the impression that Templates are needed for all debconf > settings.. You need a template; you just don't need the _ at the start of Description, which tells po-debconf to localise that string. -- Colin Watson [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#348509: add support for local archives
On Tue, 17 Jan 2006, Joey Hess wrote: Timo Aaltonen wrote: It would be nice to have support for local archives in apt-setup. Here's a simple patch for that. Currently it supports only one repository because it doesn't (well, I don't) know how to parse the string into multiple entries. Maybe something like a ';' could be the delimiter? Well, maybe. Another way to do it would be to make it walk over apt-setup/local[0-9] and add the ones it finds. Yes, why not. Seems like a pretty good patch although we'll also have to document it in the installation manual. I could do that also, maybe section B.4.6 is the obvious place? (I must say, that the manual has come a _long_ way since last spring when I started playing around with d-i :) And thanks for ditching base-config!) What about apt key issues though, a local repo will not be signed by the Debian archive key, so apt will refuse to install packages from it unless a key is also somehow provided. That's true, I'll look into it although at the moment this is a bit unfamiliar business to me. But that's what documentation is for.. echo >> $file if [ -n $local ]; then Probably the echo should go inside the if block. yes, the next version will be better. +Template: apt-setup/local +Type: string +_Description: Local archive(s) to be added in sources.list No need to localise this since it doesn't ask the question. Ok, I was under the impression that Templates are needed for all debconf settings.. I'll make another patch tomorrow. t -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#348509: add support for local archives
Timo Aaltonen wrote: > It would be nice to have support for local archives in apt-setup. Here's a > simple patch for that. Currently it supports only one repository because > it doesn't (well, I don't) know how to parse the string into multiple > entries. Maybe something like a ';' could be the delimiter? Well, maybe. Another way to do it would be to make it walk over apt-setup/local[0-9] and add the ones it finds. Seems like a pretty good patch although we'll also have to document it in the installation manual. What about apt key issues though, a local repo will not be signed by the Debian archive key, so apt will refuse to install packages from it unless a key is also somehow provided. > echo >> $file > if [ -n $local ]; then Probably the echo should go inside the if block. > +Template: apt-setup/local > +Type: string > +_Description: Local archive(s) to be added in sources.list No need to localise this since it doesn't ask the question. -- see shy jo signature.asc Description: Digital signature
Bug#348509: add support for local archives
Package: apt-setup Version: 0.5 It would be nice to have support for local archives in apt-setup. Here's a simple patch for that. Currently it supports only one repository because it doesn't (well, I don't) know how to parse the string into multiple entries. Maybe something like a ';' could be the delimiter? debian-installer/packages/apt-setup/generators/95local: #!/bin/sh set -e . /usr/share/debconf/confmodule file="$1" db_get apt-setup/local local="$RET" echo >> $file if [ -n $local ]; then cat >> $file <--- debian/apt-mirror-setup.templates.orig 2006-01-17 14:13:33.531371000 +0200 +++ debian/apt-mirror-setup.templates 2006-01-17 14:18:25.212208000 +0200 @@ -35,3 +35,8 @@ network, or with the mirror. You can choose to retry the download, select a different mirror, or ignore the problem and continue without all the packages from this mirror. + +Template: apt-setup/local +Type: string +_Description: Local archive(s) to be added in sources.list + -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]