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

Re: Modifying /etc/apt/sources.list in postinst ; determining the suite in postinst

On ti, 2007-04-03 at 16:28 +0100, Neil Williams wrote:
> To install a cross-building toolchain, apt/aptitude needs to be told
> about the Emdebian [2] toolchain repository [3]. Currently, that is done
> by the emsetup program in emdebian-tools but I'm wondering if it is
> better done in postinst. The question then is: how to determine the
> suite (only unstable, testing, sid, etch and lenny are supported by
> Emdebian) from postinst (using Perl)? I'm currently parsing a call to
> 'apt-cache policy' within emsetup but is that OK to call in postinst?

With regards to Debian Policy, you need to read section 10.7. Basically,
since sources.list is a configuration file belonging to apt, your
package may only edit it in postinst if apt provides commands for doing
so. I don't think apt does that, but I could be wrong.

With regards to the life of a sysadmin, don't do it. Changing
sources.list will surprise a lot of people, and can cause bad things to
happen, for example higher network bills because the wrong mirror is
used. Provide a README.Debian that tells what needs to be done, and
possibly provide a command to do it easily.

It's 1978! Things should be round by now -- Michael Kelso (That 70's

Reply to: