From 2fc6d9f3eeba6c108915a6a633c53494a3550729 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 28 Feb 2019 14:53:48 -0500 Subject: [PATCH] pacstrap: usie NoExtract to prune dead weight A docker container does not need tons of locales in order to do its job, nor does it need extensive (or any) documentation. With this change, a bare pacstrapped directory drops from 500MB to 390MB --- .gitignore | 1 + Makefile | 2 ++ pacman-conf.d-noextract.conf | 9 +++++++++ 3 files changed, 12 insertions(+) create mode 100644 pacman-conf.d-noextract.conf diff --git a/.gitignore b/.gitignore index a583ac7..e573ef4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.orig /.idea /archlinux.tar +rootfs/etc/pacman.conf diff --git a/Makefile b/Makefile index 8a5274a..8a85f42 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,8 @@ hooks: rootfs: hooks mkdir -vp $(BUILDDIR)/var/lib/pacman/ + cp /usr/share/devtools/pacman-extra.conf rootfs/etc/pacman.conf + cat pacman-conf.d-noextract.conf >> rootfs/etc/pacman.conf fakechroot -- fakeroot -- pacman -Sy -r $(BUILDDIR) \ --noconfirm --dbpath $(PWD)/$(BUILDDIR)/var/lib/pacman \ --config pacman.conf \ diff --git a/pacman-conf.d-noextract.conf b/pacman-conf.d-noextract.conf new file mode 100644 index 0000000..76b762b --- /dev/null +++ b/pacman-conf.d-noextract.conf @@ -0,0 +1,9 @@ +[options] +NoExtract = usr/share/help/* !usr/share/help/en* +NoExtract = usr/share/gtk-doc/html/* usr/share/doc/* +NoExtract = usr/share/locale/* usr/share/X11/locale/* usr/share/i18n/* +NoExtract = !*locale*/en*/* !usr/share/i18n/charmaps/UTF-8.gz !usr/share/*locale*/locale.* +NoExtract = !usr/share/*locales/en_?? !usr/share/*locales/i18n* !usr/share/*locales/iso* +NoExtract = !usr/share/*locales/trans* +NoExtract = usr/share/man/* usr/share/info/* +NoExtract = usr/share/vim/vim*/lang/*