Re: How to forbid apt to use sources.list.d

2014-11-03 Thread Paul Wise
On Tue, Nov 4, 2014 at 3:23 AM, Andreas Tille wrote:

 it seems apt-get recently changed its behaviour which affects
 blends-dev.  Blends-dev defines a certain configured sources.list file
 which is set in $aptsources.  Apt is called with the following options:
...
 I wonder whether this is a bug^Wfeature in apt and how I can force
 apt to ignore this dir.

The apt.conf(5) manual page makes it fairly clear that setting the
APT_CONFIG environment variable is the only way to properly separate
apt/dpkg from the system dpkg/apt configuration and data. For examples
of how to do this, please see chdist from devscripts and the Debian
derivatives census code, some references:

https://anonscm.debian.org/cgit/collab-maint/devscripts.git/tree/scripts/chdist.pl#n244
https://anonscm.debian.org/cgit/dex/census.git/tree/etc/apt.conf
https://anonscm.debian.org/cgit/dex/census.git/tree/Makefile

-- 
bye,
pabs

https://wiki.debian.org/PaulWise


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/CAKTje6FSKjNXNu-RcTkWmduUzQ=je1bETX9g=mv-wkh-8nf...@mail.gmail.com



Re: How to forbid apt to use sources.list.d

2014-11-03 Thread David Kalnischkies
On Mon, Nov 03, 2014 at 08:23:31PM +0100, Andreas Tille wrote:
 it seems apt-get recently changed its behaviour which affects
 blends-dev.  Blends-dev defines a certain configured sources.list file
 which is set in $aptsources.  Apt is called with the following options:
 
my @aptopts = (Dir::Etc::sourcelist=$aptsources,
Dir::State=$aptdir/state,
Dir::Cache=$aptdir/cache,
Dir::State::Status=/dev/null,
Debug::NoLocking=true,
APT::Get::AllowUnauthenticated=true);
 
 This worked fine until last week when I generated metapackages
 successfully.  Today I realised that non-free, experimental etc is
 included and realised that this is due to the fact that apt is accessing
 the files I have kept in /etc/apt/sources.list.d on my computer.  After
 renaming this dir blends-dev worked as usual.

No, it didn't stop working recently, it never worked – you just didn't
notice until now. The reason is simply that you are not telling apt to
not use the partial directory, so it does use it… and that hasn't changed
recently (or at all). Have you added preference files recently maybe?
(which is another file/directory you are not overriding)

apt-config dump gives you a head start on config knobs to tweak, which
also mentions the one responsible for the sources.list fragments directory:
Dir::Etc::sourceparts.

Apart from what Paul said so that you can actually use an entirely
different config, you have properly better luck with setting Dir
and creating some directories inside it instead of trying to override
every subdirectory with Dir::whatever (while apt supports autocreation
of directories it is using, it doesn't do it if too much is missing:
e.g. /var/cache/ isn't created, but apt/archives/partial is).
Oh, and while at it stop using AllowUnauthenticated please.


You can look at test/integration/framework in the apt sources for another
example of how apt and dpkg can be instructed to work inside a temporary
directory (Note that e.g. dpkg does some checks based on the installed
version it can find for itself in the status file, which in turn will
influence the behavior of apt. MultiArch support is a prime example, so
depending on what you are doing, /dev/null might not be enough…).


Best regards

David Kalnischkies


signature.asc
Description: Digital signature