[PC-BSD Commits] r6453 - pcbsd/trunk/pc-sysinstall/backend

svn at pcbsd.org svn at pcbsd.org
Fri Mar 26 12:45:49 PDT 2010


Author: kris
Date: 2010-03-26 12:45:49 -0700 (Fri, 26 Mar 2010)
New Revision: 6453

Modified:
   pcbsd/trunk/pc-sysinstall/backend/functions-localize.sh
Log:

Added option to prune other l10n files from KDE4 during install



Modified: pcbsd/trunk/pc-sysinstall/backend/functions-localize.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions-localize.sh	2010-03-26 19:23:07 UTC (rev 6452)
+++ pcbsd/trunk/pc-sysinstall/backend/functions-localize.sh	2010-03-26 19:45:49 UTC (rev 6453)
@@ -139,6 +139,36 @@
 
 };
 
+#  Function which prunes other l10n files from the KDE install
+localize_prune_langs()
+{
+  get_value_from_cfg localizeLang
+  KEEPLANG="$VAL"
+  if [ -z "$KEEPLANG" ] ; then
+    KEEPLANG="en"
+  fi
+  export KEEPLANG 
+
+  echo_log "Pruning other l10n files, keeping ${KEEPLANG}"
+
+  # Create the script to do uninstalls
+  echo '#!/bin/sh
+
+  for i in `pkg_info | grep "kde-l10n" | cut -d " " -f 1`
+  do
+    echo "$i" | grep "${KEEPLANG}-kde"
+    if [ "$?" != "0" ] ; then
+      pkg_delete ${i}
+    fi
+  done
+  ' > ${FSMNT}/.pruneLangs.sh
+
+  chmod 755 ${FSMNT}/.pruneLangs.sh
+  chroot ${FSMNT} /.pruneLangs.sh >/dev/null 2>/dev/null
+  rm ${FSMNT}/.pruneLangs.sh
+
+};
+
 # Function which sets COUNTRY SETLANG and LOCALE based upon $1
 localize_get_codes()
 { 
@@ -396,6 +426,11 @@
     localize_x_keyboard "${KEYMOD}" "${KEYLAYOUT}" "${KEYVAR}"
   fi
 
+  # Check if we want to prunt any other KDE lang files to save some disk space
+  get_value_from_cfg localizePrune
+  if [ "${VAL}" = "yes" -o "${VAL}" = "YES" ] ; then
+    localize_prune_langs
+  fi
 
   # Update the login.conf db, even if we didn't localize, its a good idea to make sure its up2date
   run_chroot_cmd "/usr/bin/cap_mkdb /etc/login.conf" >/dev/null 2>/dev/null



More information about the Commits mailing list