f.write("#!/bin/sh\n")
f.write("exit 101")
os.chmod(policyrcd, 0o755)
+
+ doc_paths = [
+ '/usr/share/locale',
+ '/usr/share/doc',
+ '/usr/share/man',
+ '/usr/share/groff',
+ '/usr/share/info',
+ '/usr/share/lintian',
+ '/usr/share/linda',
+ ]
if not args.with_docs:
- # Create dpkg.cfg to ingore documentation
+ # remove documentation installed by debootstrap
+ cmdline = ["rm", "-rf"] + doc_paths
+ run_workspace_command(args, workspace, *cmdline)
+ # Create dpkg.cfg to ingore documentation on new packages
dpkg_conf = os.path.join(workspace, "root/etc/dpkg/dpkg.cfg.d/01_nodoc")
with open(dpkg_conf, "w") as f:
- f.writelines([
- 'path-exclude /usr/share/locale/*\n',
- 'path-exclude /usr/share/doc/*\n',
- 'path-exclude /usr/share/man/*\n',
- 'path-exclude /usr/share/groff/*\n',
- 'path-exclude /usr/share/info/*\n',
- 'path-exclude /usr/share/lintian/*\n',
- 'path-exclude /usr/share/linda/*\n',
- ])
+ f.writelines(["path-exclude %s/*\n" % d for d in doc_paths])
cmdline = ["/usr/bin/apt-get", "--assume-yes", "--no-install-recommends", "install"] + extra_packages
run_workspace_command(args, workspace, network=True, env={'DEBIAN_FRONTEND': 'noninteractive', 'DEBCONF_NONINTERACTIVE_SEEN': 'true'}, *cmdline)