From: Daan De Meyer Date: Sun, 3 Dec 2023 10:04:38 +0000 (+0100) Subject: Implement WithDocs= for apt X-Git-Tag: v20~114^2~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f42394cc4a74148c5beb3dec2b7894a0c44277ab;p=thirdparty%2Fmkosi.git Implement WithDocs= for apt --- diff --git a/mkosi/installer/apt.py b/mkosi/installer/apt.py index 4a5157af6..7e0e2bffd 100644 --- a/mkosi/installer/apt.py +++ b/mkosi/installer/apt.py @@ -66,7 +66,7 @@ def apt_cmd(state: MkosiState, command: str) -> list[PathString]: trustedkeys_dir = state.pkgmngr / "etc/apt/trusted.gpg.d" trustedkeys_dir = trustedkeys_dir if trustedkeys_dir.exists() else "/usr/share/keyrings" - return [ + cmdline: list[PathString] = [ "env", f"APT_CONFIG={state.workspace / 'apt.conf'}", "DEBIAN_FRONTEND=noninteractive", @@ -99,6 +99,17 @@ def apt_cmd(state: MkosiState, command: str) -> list[PathString]: "-o", "pkgCacheGen::ForceEssential=,", ] + if not state.config.with_docs: + cmdline += [ + "-o", "DPkg::Options::=--path-exclude=/usr/share/doc/*", + "-o", "DPkg::Options::=--path-include=/usr/share/doc/*/copyright", + "-o", "DPkg::Options::=--path-exclude=/usr/share/man/*", + "-o", "DPkg::Options::=--path-exclude=/usr/share/groff/*", + "-o", "DPkg::Options::=--path-exclude=/usr/share/info/*", + ] + + return cmdline + def invoke_apt( state: MkosiState,