If the _install_langs macro is defined, rpm will only install locale
data corresponding to the locales in _install_langs. If Locale= is
set and macros.lang doesn't exist already, let's configure it ourselves
with _install_langs to save on disk space.
f.write("\n")
+ macros = state.pkgmngr / "usr/lib/rpm/macros.d"
+ macros.mkdir(parents=True, exist_ok=True)
+ if not (macros / "macros.lang").exists() and state.config.locale:
+ (macros / "macros.lang").write_text(f"%_install_langs {state.config.locale}")
+
rpmconfigdir = Path(run(["rpm", "--eval", "%{_rpmconfigdir}"], stdout=subprocess.PIPE).stdout.strip())
- (state.pkgmngr / "usr/lib").mkdir(parents=True, exist_ok=True)
copy_tree(state.config, rpmconfigdir, state.pkgmngr / "usr/lib/rpm", clobber=False)