pbuilder-dist: Set different aptcache directories for Debian and Ubuntu.

This commit is contained in:
Benjamin Drung 2014-04-15 12:03:14 +02:00
parent b0209ce796
commit 12ee7e71e3
2 changed files with 16 additions and 1 deletions

4
debian/changelog vendored
View File

@ -9,6 +9,10 @@ ubuntu-dev-tools (0.153) UNRELEASED; urgency=medium
* check-mir: correctly parse dependencies with architecture specifications
(LP: #1149679).
[ Benjamin Drung ]
* pbuilder-dist:
- Set different aptcache directories for Debian and Ubuntu.
-- Stefano Rivera <stefanor@debian.org> Tue, 25 Feb 2014 22:45:05 +0200
ubuntu-dev-tools (0.152+nmu1) unstable; urgency=medium

View File

@ -287,6 +287,8 @@ class PbuilderDist(object):
if self.enable_proposed:
othermirrors.append('deb %s %s-proposed-updates %s'
% (mirror, self.target_distro, components))
aptcache = os.path.join(self.base, 'aptcache', 'debian')
else:
try:
dev_release = self.target_distro == UbuntuDistroInfo().devel()
@ -308,6 +310,8 @@ class PbuilderDist(object):
othermirrors.append('deb %s %s-proposed %s'
% (mirror, self.target_distro, components))
aptcache = os.path.join(self.base, 'aptcache', 'ubuntu')
if 'OTHERMIRROR' in os.environ:
othermirrors += os.environ['OTHERMIRROR'].split('|')
@ -336,7 +340,14 @@ class PbuilderDist(object):
'--keyring=/usr/share/keyrings/debian-archive-keyring.gpg',
]
arguments += ['--components', components]
arguments += ['--aptcache', aptcache, '--components', components]
if not os.path.isdir(aptcache):
try:
os.makedirs(aptcache)
except OSError:
Logger.error('Cannot create aptcache directory "%s"', aptcache)
sys.exit(1)
if self.build_architecture != self.system_architecture:
arguments += ['--debootstrapopts',