If locales-all package is installed skip locales generation
[grml-live.git] / 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
 
-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
@@ -56,5 +49,16 @@ else
   $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