From 2fc31ead13e0274216a377542afb39f0f687759d Mon Sep 17 00:00:00 2001 From: codehelp Date: Sat, 27 Jul 2013 14:53:05 +0000 Subject: [PATCH] Add option to specify the apt default release directly and change the manpage content to advise on how this further complicates the permutations of apt configuration. Add commands to direct apt at the apt.conf.d and preferences.d directories within the chroot. (Closes: #717886) git-svn-id: http://emdebian.org/svn/current@8462 563faec7-e20c-0410-992a-a66f704d0ccd --- debian/changelog | 10 ++++++++++ debian/control | 2 +- examples/full.conf | 2 ++ multistrap | 12 +++++++++--- pod/multistrap | 34 ++++++++++++++++++++++++++++++---- 5 files changed, 52 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 87baa29..0e01c99 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +multistrap (2.2.0) unstable; urgency=low + + * Add option to specify the apt default release directly and + change the manpage content to advise on how this further + complicates the permutations of apt configuration. Add + commands to direct apt at the apt.conf.d and preferences.d + directories within the chroot. (Closes: #717886) + + -- Neil Williams Sat, 27 Jul 2013 15:50:01 +0100 + multistrap (2.1.23) unstable; urgency=low * Carry changes from experimental into unstable. diff --git a/debian/control b/debian/control index 5f4b1e3..bbc6718 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,7 @@ Maintainer: Neil Williams Uploaders: Wookey Build-Depends: cdbs, debhelper (>= 7), po4a (>= 0.37.1) Build-Depends-Indep: intltool -Standards-Version: 3.9.3 +Standards-Version: 3.9.4 Homepage: http://www.emdebian.org/multistrap Vcs-Browser: http://www.emdebian.org/trac/browser/current/ Vcs-Svn: http://www.emdebian.org/svn/current/ diff --git a/examples/full.conf b/examples/full.conf index 1f8cb72..fbee13e 100644 --- a/examples/full.conf +++ b/examples/full.conf @@ -30,6 +30,8 @@ omitpreinst=false # apt preferences file # aptpreferences=pref.conf aptpreferences= +# explicitly set the APT::Default-Release (default is *) +aptdefaultrelease= # download the sources for the packages downloaded retainsources=false # allow Recommended packages to be seen as strict dependencies diff --git a/multistrap b/multistrap index 30dd404..d99b903 100755 --- a/multistrap +++ b/multistrap @@ -36,12 +36,13 @@ use vars qw/ $progname $ourversion $dstrap $extra @aptsources $explicit_suite $allow_recommends %omitdebsrc @dsclist @sectoutput %flatfile %important $addimportant @debconf $hookdir %hooks $warn_count $use_shortcut @foreignarches $olddpkg $ignorenative - %foreignpkgs $markauto /; + %foreignpkgs $markauto $default_release /; setlocale(LC_MESSAGES, ""); textdomain("multistrap"); $progname = basename($0); $ourversion = &our_version(); +$default_release = "*"; $unpack = "true"; %omitdebsrc=(); %foreignpkgs=(); @@ -338,8 +339,11 @@ $config_str .= " -o Apt::Get::Download-Only=true"; $config_str .= " -o Apt::Install-Recommends=false" if (not defined $allow_recommends); $config_str .= " -o Dir=$dir"; -$config_str .= " -o Dir::Etc=${dir}${etcdir} -o APT::Default-Release=*" - if (not defined $preffile); +$config_str .= " -o Dir::Etc=${dir}${etcdir}"; +$config_str .= " -o Dir::Etc::Parts=${dir}${etcdir}apt.conf.d/"; +$config_str .= " -o Dir::Etc::PreferencesParts=${dir}${etcdir}preferences.d/"; +$config_str .= " -o APT::Default-Release=$default_release"; +# if (not defined $preffile); if (defined $deflist) { $sourcesname = "sources.list.d/multistrap.sources.list"; $config_str .= " -o Dir::Etc::SourceList=${dir}${etcdir}$sourcesname"; @@ -1182,6 +1186,8 @@ sub cascade { ($keys{$section}{'explicitsuite'} eq "true")); $allow_recommends++ if ((defined $keys{$section}{'allowrecommends'}) and ($keys{$section}{'allowrecommends'} eq "true")); + $default_release = lc($keys{$section}{'aptdefaultrelease'}) + if (defined $keys{$section}{'aptdefaultrelease'}); my @p = split(' ', lc($keys{$section}{'debconfseed'})) if (defined $keys{$section}{'debconfseed'}); foreach my $f (@p) { diff --git a/pod/multistrap b/pod/multistrap index 196d3d2..b511fa5 100644 --- a/pod/multistrap +++ b/pod/multistrap @@ -129,6 +129,9 @@ http://wiki.debian.org/Multistrap http://www.emdebian.org/multistrap/ +C includes an example configuration file with a full list +of all supported config file options: F + =head1 Shortcuts In a similar manner to C, C supports referring @@ -553,10 +556,33 @@ to use typical Debian behaviour. =head1 Default release -If your system specifies a default-release for apt, this can cause -problems when trying to create a bootstrap which does not include -the default suite. To counter this, C sets a wildcard for -the Default Release within the bootstrap. See also: apt preferences. +C supports an option to explicitly set the default release +to use with apt: C. This determines which release apt +will use for the base system packages and is not the same as pinning +(which relates to the use of apt after installation). Multistrap sets +the default-release to the wildcard * unless a release is named in the +C field. Any release specified here must also be +defined in a stanza referenced in the bootstrap list or apt will fail. + +To install a specific version of a package from a newer release than +the one specified as default, C must also be set to true +if the package exists at any version in the default release. Also, any +packages upon which that package has a strict dependency (i.e. = rather +than >=) must also be explicitly added to the packages line in the +stanza for the desired version, even though that package does not need +to be listed to get it from the default release. This is typical apt +behaviour and is not a bug in multistrap. + +The combination of default release, explicit suite and apt preferences +can quickly become complex and bugs can be very hard to identify. +C always outputs the complete apt command line, so test +this command yourself (using the files written out by C) to +see what is going on. Remember that all dependency resolution and all +the logic to determine which version of a specific package gets installed +in your C chroot is entirely down to apt and all C +can do is pass files and command line options to apt. + +See also: apt preferences. =head1 Explicit suite specification