From a40bd1d55b4fb68b04f59229e4e04a989b159f7b Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Thu, 28 Sep 2017 09:38:23 -0400 Subject: [PATCH] Explain why unminimization script is a bit complicated --- live-build/auto/build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/live-build/auto/build b/live-build/auto/build index 81305a51..a97dd2f1 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -75,8 +75,13 @@ if [ -f /etc/dpkg/dpkg.cfg.d/excludes ] || [ -f /etc/dpkg/dpkg.cfg.d/excludes.dp apt-get upgrade echo "Restoring system documentation..." echo "Reinstalling packages with files in /usr/share/man/ ..." + # Reinstallation takes place in two steps because a single dpkg --verified + # command generates very long parameter list for "xargs dpkg -S" and may go + # over ARG_MAX. Since many packages have man pages the second download + # handles a much smaller amount of packages. dpkg -S /usr/share/man/ |sed 's|, |\n|g;s|: [^:]*$||' | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y echo "Reinstalling packages with system documentation in /usr/share/doc/ .." + # This step processes the packages which still have missing documentation dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {print $2}' | sed 's|/[^/]*$||' | sort |uniq \ | xargs dpkg -S | sed 's|, |\n|g;s|: [^:]*$||' | uniq | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y if dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {exit 1}'; then