Skip to content
Snippets Groups Projects
Commit cae3cd81 authored by Simon McVittie's avatar Simon McVittie
Browse files

Merge commit '6f71c57d'

parents a52d33bb 6f71c57d
No related branches found
No related tags found
No related merge requests found
......@@ -82,7 +82,7 @@ def main():
if var in os.environ:
in_chroot.append('{}={}'.format(var, os.environ[var]))
options = [] # type: typing.List[str]
options = ['-q', '-oAcquire::Retries=3']
packages = [] # type: typing.List[str]
if args.debug:
......@@ -104,7 +104,9 @@ def main():
] + options + ['install'] + packages)
subprocess.check_call(in_chroot + [
'apt-get', 'clean',
'apt-get',
] + options + [
'clean',
])
......
......@@ -58,12 +58,15 @@ def main():
strip_source_version_suffix = re.compile(
'(?:' + args.strip_source_version_suffix + ')$')
options = ['-q', '-oAcquire::Retries=3']
subprocess.check_call(['cp', '-PRp', '/usr/var', '/'])
subprocess.check_call(['install', '-d', '/var/cache/apt/archives/partial'])
subprocess.check_call(['fakeroot', 'apt-get', 'update'])
subprocess.check_call(['fakeroot', 'apt-get', '-y', '--download-only',
'--no-install-recommends', 'install'] +
args.packages)
subprocess.check_call(['fakeroot', 'apt-get'] + options + ['update'])
subprocess.check_call(['fakeroot', 'apt-get'] + options
+ ['-y', '--download-only',
'--no-install-recommends', 'install']
+ args.packages)
for file in glob.glob("/var/cache/apt/archives/*.deb"):
debian_control = DebFile(file).control.debcontrol()
......@@ -81,8 +84,8 @@ def main():
assert source
assert version
subprocess.check_call([
'apt-get', '-y', '--download-only',
subprocess.check_call(['apt-get'] + options + [
'-y', '--download-only',
'-oAPT::Get::Only-Source=true', 'source',
'{}={}'.format(source, version),
], cwd=args.export)
......@@ -95,8 +98,8 @@ def main():
assert source
assert version
subprocess.check_call([
'apt-get', '-y', '--download-only',
subprocess.check_call(['apt-get' + options + [
'-y', '--download-only',
'-oAPT::Get::Only-Source=true', 'source',
'{}={}'.format(source, version),
], cwd=args.export)
......
......@@ -365,7 +365,7 @@ def main():
for spec in sorted(to_get):
logger.info('To download: %s', spec)
options = ['-y', '-m']
options = ['-y', '-m', '-q', '-oAcquire::Retries=3']
if args.debug:
options.append('-oDebug::pkgDepCache::AutoInstall=true')
......
......@@ -271,14 +271,19 @@ def main():
sources.add(s)
get_source.append(s.get_source)
options = ['-q', '-q', '-y', '--download-only']
options.append('-oAPT::Get::Only-Source=true')
options.append('-oAcquire::Retries=3')
try:
subprocess.check_call(in_chroot + [
'sh', '-euc',
'dir="$1"; shift; mkdir -p "$dir"; cd "$dir"; "$@"',
'sh', # argv[0]
'/src/files', # working directory
'apt-get', '-y', '--download-only', '-q', '-q',
'-oAPT::Get::Only-Source=true', 'source',
'apt-get'
] + options + [
'source',
] + get_source)
except subprocess.CalledProcessError:
logger.warning(
......@@ -292,8 +297,9 @@ def main():
'dir="$1"; shift; mkdir -p "$dir"; cd "$dir"; "$@"',
'sh', # argv[0]
'/src/files', # working directory
'apt-get', '-y', '--download-only', '-q', '-q',
'-oAPT::Get::Only-Source=true', 'source',
'apt-get',
] + options + [
'source',
s.get_source,
])
except subprocess.CalledProcessError:
......
......@@ -121,12 +121,12 @@ actions:
- action: run
label: apt update
chroot: true
command: 'apt-get -y -q update'
command: 'apt-get -y -q -oAcquire::Retries=3 update'
- action: run
label: apt dist-upgrade
chroot: true
command: 'echo; DEBIAN_FRONTEND=noninteractive apt-get -y -q dist-upgrade'
command: 'echo; DEBIAN_FRONTEND=noninteractive apt-get -y -q -oAcquire::Retries=3 dist-upgrade'
- action: run
label: write-manifest
......
......@@ -276,7 +276,7 @@ actions:
chroot: true
command: |
set -e
apt-get update || true
apt-get -q -oAcquire::Retries=3 update || true
- action: run
label: put-ldconfig-in-path
......
......@@ -107,10 +107,10 @@ if [ -n "${unwanted[*]}" ]; then
echo "- $p"
done
in_chroot apt-get -y purge "${unwanted[@]}"
in_chroot apt-get -q -y purge "${unwanted[@]}"
fi
in_chroot apt-get -y --purge autoremove
in_chroot apt-get -q -y --purge autoremove
echo "Packages installed before destroying Essential set:"
list_packages_ignore_arch | sed -e 's/^/- /'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment