--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: Add a mechanism for reparenting *all* file/directory names.
- From: Daniel Burrows <dburrows@debian.org>
- Date: Sat, 15 Dec 2007 15:42:01 -0800
- Message-id: <20071215234201.GA20725@alpaca>
Package: apt
Version: 0.7.10
Severity: wishlist
Tags: patch
There are times when it would be nice to be able to force apt to use
a different directory tree for everything. Setting "Dir" to a new
location won't work, because absolute paths in the Dir hierarchy will
override this. I propose creating a new option, "RootDir", that changes
the root under which filenames in the Dir hierarchy are placed. This
effectively means that the new directory is prepended to all filenames
returned by FindFile.
The attached patch adds support for RootDir to apt and documents it.
Daniel
-- Package-specific info:
-- (/etc/apt/preferences present, but not submitted) --
-- (/etc/apt/sources.list present, but not submitted) --
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.22-3-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages apt depends on:
ii debian-archive-keyring 2007.07.31 GnuPG archive keys of the Debian a
ii libc6 2.7-4 GNU C Library: Shared libraries
ii libgcc1 1:4.3-20071130-1 GCC support library
ii libstdc++6 4.3-20071130-1 The GNU Standard C++ Library v3
apt recommends no packages.
-- no debconf information
=== modified file 'apt-pkg/contrib/configuration.cc'
--- apt-pkg/contrib/configuration.cc 2007-08-28 08:11:13 +0000
+++ apt-pkg/contrib/configuration.cc 2007-12-15 23:20:34 +0000
@@ -173,6 +173,11 @@
*/
string Configuration::FindFile(const char *Name,const char *Default) const
{
+ const Item *RootItem = Lookup("RootDir");
+ std::string rootDir = (RootItem == 0) ? "" : RootItem->Value;
+ if(rootDir.size() > 0 && rootDir[rootDir.size() - 1] != '/')
+ rootDir.push_back('/');
+
const Item *Itm = Lookup(Name);
if (Itm == 0 || Itm->Value.empty() == true)
{
@@ -204,7 +209,7 @@
Itm = Itm->Parent;
}
- return val;
+ return rootDir + val;
}
/*}}}*/
// Configuration::FindDir - Find a directory name /*{{{*/
=== modified file 'debian/changelog'
--- debian/changelog 2007-12-15 12:54:34 +0000
+++ debian/changelog 2007-12-15 22:43:33 +0000
@@ -38,6 +38,11 @@
- support lzma data members
* ftparchive/multicompress.cc:
- support lzma output
+
+ [ Daniel Burrows ]
+ * apt-pkg/contrib/configuration.cc:
+ - if RootDir is set, then FindFile and FindDir will return paths
+ relative to the directory stored in RootDir.
-- Otavio Salvador <otavio@ossystems.com.br> Sat, 08 Dec 2007 12:13:58 -0200
=== modified file 'doc/apt.conf.5.xml'
--- doc/apt.conf.5.xml 2007-12-15 21:20:01 +0000
+++ doc/apt.conf.5.xml 2007-12-15 22:35:53 +0000
@@ -295,6 +295,19 @@
<literal>dpkg</literal>, <literal>apt-get</literal> <literal>dpkg-source</literal>
<literal>dpkg-buildpackage</literal> and <literal>apt-cache</literal> specify the location
of the respective programs.</para>
+
+ <para>
+ The configuration item <literal>RootDir</literal> has a special
+ meaning. If set, all paths in <literal>Dir::</literal> will be
+ relative to <literal>RootDir</literal>, <emphasis>even paths that
+ are specified absolutely</emphasis>. So, for instance, if
+ <literal>RootDir</literal> is set to
+ <filename>/tmp/staging</filename> and
+ <literal>Dir::State::status</literal> is set to
+ <filename>/var/lib/dpkg/status</filename>, then the status file
+ will be looked up in
+ <filename>/tmp/staging/var/lib/dpkg/status</filename>.
+ </para>
</refsect1>
<refsect1><title>APT in DSelect</title>
--- End Message ---
--- Begin Message ---
Source: apt
Source-Version: 0.7.10
We believe that the bug you reported is fixed in the latest version of
apt, which is due to be installed in the Debian FTP archive:
apt-doc_0.7.10_all.deb
to pool/main/a/apt/apt-doc_0.7.10_all.deb
apt-transport-https_0.7.10_i386.deb
to pool/main/a/apt/apt-transport-https_0.7.10_i386.deb
apt-utils_0.7.10_i386.deb
to pool/main/a/apt/apt-utils_0.7.10_i386.deb
apt_0.7.10.dsc
to pool/main/a/apt/apt_0.7.10.dsc
apt_0.7.10.tar.gz
to pool/main/a/apt/apt_0.7.10.tar.gz
apt_0.7.10_i386.deb
to pool/main/a/apt/apt_0.7.10_i386.deb
libapt-pkg-dev_0.7.10_i386.deb
to pool/main/a/apt/libapt-pkg-dev_0.7.10_i386.deb
libapt-pkg-doc_0.7.10_all.deb
to pool/main/a/apt/libapt-pkg-doc_0.7.10_all.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 456457@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Michael Vogt <mvo@debian.org> (supplier of updated apt package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.7
Date: Mon, 07 Jan 2008 21:40:47 +0100
Source: apt
Binary: apt-utils libapt-pkg-doc libapt-pkg-dev apt-transport-https apt-doc apt
Architecture: source all i386
Version: 0.7.10
Distribution: unstable
Urgency: low
Maintainer: APT Development Team <deity@lists.debian.org>
Changed-By: Michael Vogt <mvo@debian.org>
Description:
apt - Advanced front-end for dpkg
apt-doc - Documentation for APT
apt-transport-https - APT https transport
apt-utils - APT utility programs
libapt-pkg-dev - Development files for APT's libapt-pkg and libapt-inst
libapt-pkg-doc - Documentation for APT development
Closes: 219034 260825 430207 438136 438545 443286 448316 451328 452858 452862 453088 453774 454561 456457 456909 457917 458039 458966 459013
Changes:
apt (0.7.10) unstable; urgency=low
.
[ Otavio Salvador ]
* Applied patch from Mike O'Connor <stew@vireo.org> to add a manpage to
apt-mark, closes: #430207.
* Applied patch from Andrei Popescu <andreimpopescu@gmail.com> to add a
note about some frontends in apt.8 manpage, closes: #438545.
* Applied patch from Aurelien Jarno <aurel32@debian.org> to avoid CPU
getting crazy when /dev/null is redirected to stdin (which breaks
buildds), closes: #452858.
* Applied patch from Aurelien Jarno <aurel32@debian.org> to fix building
with newest dpkg-shlibdeps changing the packaging building order and a
patch from Robert Millan <rmh@aybabtu.com> to fix parallel building,
closes: #452862.
* Applied patch from Alexander Winston <alexander.winston@comcast.net>
to use 'min' as symbol for minute, closes: #219034.
* Applied patch from Amos Waterland <apw@us.ibm.com> to allow apt to
work properly in initramfs, closes: #448316.
* Applied patch from Robert Millan <rmh@aybabtu.com> to make apt-key and
apt-get to ignore time conflicts, closes: #451328.
* Applied patch from Peter Eisentraut <peter_e@gmx.net> to fix a
grammatical error ("manual installed" -> "manually installed"),
closes: #438136.
* Fix cron.daily job to not call fail if apt isn't installed, closes:
#443286.
* Fix compilation warnings in apt-pkg/cdrom.cc and
apt-pkg/contrib/configuration.cc.
* Fix typo in debian/copyright file ("licened" instead of "licensed"),
closes: #458966.
.
[ Program translations ]
- Basque updated. Closes: #453088
- Vietnamese updated. Closes: #453774, #459013
- Japanese updated. Closes: #456909
- Simplified Chinese updated. Closes: #458039
- French updated.
- Norwegian Bokmål updated. Closes: #457917
.
[ Michael Vogt ]
* debian/rules
- fix https install location
* debian/apt.conf.daily:
- print warning if the cache can not be locked (closes: #454561),
thanks to Bastian Kleineidam
* methods/gpgv.cc:
- remove cruft code that caused timestamp/I-M-S issues
* ftparchive/contents.cc:
- fix error output
* apt-pkg/acquire-item.{cc,h}:
- make the authentication download code more robust against
servers/proxies with broken If-Range implementations
* apt-pkg/packagemanager.{cc,h}:
- propergate the Immediate flag to make hitting the
"E: Internal Error, Could not perform immediate configuration (2)"
harder
* debian/control:
- build against libdb-dev (instead of libdb4.4-dev)
* merged the apt--DoListUpdate branch, this provides a common interface
for "apt-get update" like operations for the frontends and also provides
hooks to run stuff in APT::Update::{Pre,Post}-Invoke
.
[ Chris Cheney ]
* ftparchive/contents.cc:
- support lzma data members
* ftparchive/multicompress.cc:
- support lzma output
.
[ Daniel Burrows ]
* apt-pkg/contrib/configuration.cc:
- if RootDir is set, then FindFile and FindDir will return paths
relative to the directory stored in RootDir, closes: #456457.
.
[ Christian Perrier ]
* Fix wording for "After unpacking...". Thanks to Michael Gilbert
for the patch. Closes: #260825
Files:
6d914947720089a1d41b5a429de6849a 941 admin important apt_0.7.10.dsc
c998cb87cd47d91dfb14a7633e8d0239 1935991 admin important apt_0.7.10.tar.gz
bdbc3b729f28d21816c6ca1ed54fcb8e 94058 doc optional apt-doc_0.7.10_all.deb
47ce48f900f1780b5bc42ceb05542398 118496 doc optional libapt-pkg-doc_0.7.10_all.deb
f3de5d981a4f928daf7860f406d1e7b7 1598306 admin important apt_0.7.10_i386.deb
ae366c06435d1981e46a9d125d4e16e7 103080 libdevel optional libapt-pkg-dev_0.7.10_i386.deb
3a2b0fbb597f55e6ebc2bd99a12ce927 190032 admin important apt-utils_0.7.10_i386.deb
054c186bad0b5a0e29d42c659df7f139 53188 admin optional apt-transport-https_0.7.10_i386.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFHgpp2liSD4VZixzQRAmRCAJ9BtF1MmtCJoTW4xSDQDKUbwQTfRACdGxYa
m7wQlkgjwiGiTeYOd38QT2Q=
=bjSD
-----END PGP SIGNATURE-----
--- End Message ---