If locales-all package is installed skip locales generation
authorMichael Prokop <mika@grml.org>
Tue, 7 Mar 2017 16:08:38 +0000 (17:08 +0100)
committerMichael Prokop <mika@grml.org>
Tue, 7 Mar 2017 16:08:38 +0000 (17:08 +0100)
Otherwise the wrong (+ missing) locales might end up on the system
if locales-all is installed. If the ISO size doesn't matter then
this also speeds up the ISO generation process since locale-gen
doesn't need to be executed.

etc/grml/fai/config/scripts/GRMLBASE/25-locales

index 6dc4d66..277b684 100755 (executable)
@@ -42,13 +42,6 @@ if $ROOTCMD dpkg --list localepurge 2>&1 | grep -q '^ii' ; then
    $ROOTCMD dpkg-reconfigure -f noninteractive localepurge
 fi
 
    $ROOTCMD dpkg-reconfigure -f noninteractive localepurge
 fi
 
-if ! [ -x $target/usr/sbin/locale-gen ] ; then
-   echo 'Warning: locale-gen [package locales] not installed'
-else
-   echo "Running locale-gen"
-   $ROOTCMD locale-gen
-fi
-
 if ! [ -x $target/usr/sbin/localepurge ] ; then
   echo "Warning: localepurge not installed"
 else
 if ! [ -x $target/usr/sbin/localepurge ] ; then
   echo "Warning: localepurge not installed"
 else
@@ -56,5 +49,16 @@ else
   $ROOTCMD localepurge
 fi
 
   $ROOTCMD localepurge
 fi
 
+if $ROOTCMD dpkg-query -s locales-all >/dev/null 2>&1 ; then
+  echo "locales-all installed, skipping locales generation"
+else
+  if ! [ -x ${target}/usr/sbin/locale-gen ] ; then
+    echo 'Warning: locale-gen [package locales] not installed'
+  else
+    echo "Running locale-gen"
+    $ROOTCMD locale-gen
+  fi
+fi
+
 ## END OF FILE #################################################################
 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2
 ## END OF FILE #################################################################
 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2