From db8ba988a63e2b1ac7c45dee13b9e455b7adc45f Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Sep 14 2016 19:36:15 +0000 Subject: treecompose-post.sh: copy, don't move the locale archive Most processes, including bash, will have locale-archive mmap'ed. Renaming it to .tmpl will cause it to get truncated by build-locale-archive. We should make sure that it remains untouched so that bash doesn't die with SIGBUS. OTOH, build-locale-archive knows to unlink and create a new inode so as to not affect already mmap'ed versions. --- diff --git a/treecompose-post.sh b/treecompose-post.sh index b1cbbce..b1221c2 100755 --- a/treecompose-post.sh +++ b/treecompose-post.sh @@ -12,5 +12,5 @@ find /usr/lib/systemd/system/ -type f -exec sed -i -e '/^PrivateTmp=/d' -e '/^Pr KEEPLANG=en_US find /usr/share/locale -mindepth 1 -maxdepth 1 -type d -not -name "${KEEPLANG}" -exec rm -rf {} + localedef --list-archive | grep -a -v ^"${KEEPLANG}" | xargs localedef --delete-from-archive -mv -f /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl +cp -f /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl build-locale-archive