[Lunar-commits] r26115 - moonbase/branches/crater/libs/glibc-new

Jannis Pohlmann jannis at lunar-linux.org
Mon Oct 8 02:31:10 CEST 2007


Author: jannis
Date: 2007-10-08 02:31:09 +0200 (Mon, 08 Oct 2007)
New Revision: 26115

Modified:
   moonbase/branches/crater/libs/glibc-new/CONFIGURE
Log:
Extract the whole localedata directory so we can also display locale descriptions.

Modified: moonbase/branches/crater/libs/glibc-new/CONFIGURE
===================================================================
--- moonbase/branches/crater/libs/glibc-new/CONFIGURE	2007-10-08 00:15:30 UTC (rev 26114)
+++ moonbase/branches/crater/libs/glibc-new/CONFIGURE	2007-10-08 00:31:09 UTC (rev 26115)
@@ -1,49 +1,49 @@
-LOCALE_FILE="/tmp/supported-locales"
+LOCALEDATA_DIR="/tmp/localedata"
+ORIGINAL_SUPPORTED="$LOCALEDATA_DIR/SUPPORTED"
+COPIED_SUPPORTED="/tmp/supported-locales"
+FILELIST_FILE="$LOCALEDATA_DIR-files"
 
 unpack_supported_locales() {
-  # Write the path of the supported locales file into another file (...)
-  echo "${SOURCE/.tar.bz2/}/localedata/SUPPORTED" > /tmp/supported-locales-file &&
+  # Write the path of the localedata archive path into a file
+  echo "${SOURCE/.tar.bz2/}/localedata" > $FILELIST_FILE &&
 
-  # Extract the supported locales file from the source tarball
-  tar -C /tmp                        \
-      -T /tmp/supported-locales-file \
-      --strip-components=2           \
+  # Extract the localedata directory from the source tarball
+  tar -C /tmp                    \
+      -T $FILELIST_FILE          \
+      --strip-components=1       \
       -xjf $SOURCE_CACHE/$SOURCE
 }
 
 cleanup_supported_locales() {
-  rm -f /tmp/supported-locales-file /tmp/SUPPORTED $LOCALE_FILE
+  rm -rf $LOCALEDATA_DIR $FILELIST_FILE $COPIED_SUPPORTED
 }
 
 make_locales_checklist() {
   # Copy and modify the supported locales file so we can treat it like 
   # a normal bash script
-  cp /tmp/SUPPORTED $LOCALE_FILE &&
-  sed -i -e 's/SUPPORTED-LOCALES=/SUPPORTED_LOCALES="/g' $LOCALE_FILE &&
-  echo '"' >> $LOCALE_FILE &&
+  cp $ORIGINAL_SUPPORTED $COPIED_SUPPORTED &&
+  sed -i -e 's/SUPPORTED-LOCALES=/SUPPORTED_LOCALES="/g' $COPIED_SUPPORTED &&
+  echo '"' >> $COPIED_SUPPORTED &&
   
   # Execute the modified supported locales file to get a list of 
   # supported variables in the $SUPPORTED_LOCALES variable
-  . $LOCALE_FILE &&
+  . $COPIED_SUPPORTED &&
   
   # For each locale, extract name, title and encoding information
   for line in $SUPPORTED_LOCALES; do
     locale=$(echo $line | sed -e 's:\/.*$::g')
 
-    ## This is a bit tricky and slow but it does the job
-    #if [[ -e /tmp/localedata/locales/${locale/.*/} ]]; then
-    #  title=$(cat /tmp/localedata/locales/${locale/.*/} | grep ^title)
-    #  title=$(echo $title | awk -F"\"" '{ $1 = ""; print }')
-    #  title=$(echo $title | sed -e 's/^[ \t]*//;s/[ \t]*$//')
-    #else
-    #  title=""
-    #fi
+    # This is a bit tricky and slow but it does the job
+    if [[ -e $LOCALEDATA_DIR/locales/${locale/.*/} ]]; then
+      title=$(cat $LOCALEDATA_DIR/locales/${locale/.*/} | grep ^title)
+      title=$(echo $title | awk -F"\"" '{ $1 = ""; print }')
+      title=$(echo $title | sed -e 's/^[ \t]*//;s/[ \t]*$//')
+    else
+      title=""
+    fi
     # Echo locale/encoding, title and status to be passed to the 
     # dialog checklist
-    #echo "\"$line\" \"$title\" \"off\" "
-
-    # Echo locale/encoding and status to be pased to the dialog checklist
-    echo "\"$line\" \"\" \"off\" "
+    echo "\"$line\" \"$title\" \"off\" "
   done
 }
 



More information about the Lunar-commits mailing list