[Lunar-commits] r26114 - moonbase/branches/crater/libs/glibc-new
Jannis Pohlmann
jannis at lunar-linux.org
Mon Oct 8 02:15:30 CEST 2007
Author: jannis
Date: 2007-10-08 02:15:30 +0200 (Mon, 08 Oct 2007)
New Revision: 26114
Modified:
moonbase/branches/crater/libs/glibc-new/CONFIGURE
Log:
Unpack and modify localedata/SUPPORTED without having to unpack the full tarball
Modified: moonbase/branches/crater/libs/glibc-new/CONFIGURE
===================================================================
--- moonbase/branches/crater/libs/glibc-new/CONFIGURE 2007-10-07 23:18:49 UTC (rev 26113)
+++ moonbase/branches/crater/libs/glibc-new/CONFIGURE 2007-10-08 00:15:30 UTC (rev 26114)
@@ -1,32 +1,49 @@
-LOCALE_FILE="$SOURCE_DIRECTORY/supported-locales"
+LOCALE_FILE="/tmp/supported-locales"
+unpack_supported_locales() {
+ # Write the path of the supported locales file into another file (...)
+ echo "${SOURCE/.tar.bz2/}/localedata/SUPPORTED" > /tmp/supported-locales-file &&
+
+ # Extract the supported locales file from the source tarball
+ tar -C /tmp \
+ -T /tmp/supported-locales-file \
+ --strip-components=2 \
+ -xjf $SOURCE_CACHE/$SOURCE
+}
+
+cleanup_supported_locales() {
+ rm -f /tmp/supported-locales-file /tmp/SUPPORTED $LOCALE_FILE
+}
+
make_locales_checklist() {
# Copy and modify the supported locales file so we can treat it like
# a normal bash script
- cp $SOURCE_DIRECTORY/localedata/SUPPORTED $LOCALE_FILE &&
+ cp /tmp/SUPPORTED $LOCALE_FILE &&
sed -i -e 's/SUPPORTED-LOCALES=/SUPPORTED_LOCALES="/g' $LOCALE_FILE &&
echo '"' >> $LOCALE_FILE &&
# Execute the modified supported locales file to get a list of
# supported variables in the $SUPPORTED_LOCALES variable
- . locales &&
+ . $LOCALE_FILE &&
# 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 $SOURCE_DIRECTORY/localedata/locales/${locale/.*/} ]]; then
- title=$(cat $SOURCE_DIRECTORY/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 /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
# Echo locale/encoding, title and status to be passed to the
# dialog checklist
- echo "\"$line\" \"$title\" \"off\" "
+ #echo "\"$line\" \"$title\" \"off\" "
+
+ # Echo locale/encoding and status to be pased to the dialog checklist
+ echo "\"$line\" \"\" \"off\" "
done
}
@@ -49,12 +66,14 @@
fi
if query "Would you like to select locales? (if not selected, all locales will be installed)" y; then
+ unpack_supported_locales
GLIBC_LOCALES=`select_locales`
- TEMP=`grep -v "GLIBC_LOCALES=" $MODULE_CONFIG`
-
+ TEMP=`grep -v "GLIBC_LOCALES=" $MODULE_CONFIG`
echo "$TEMP" > $MODULE_CONFIG
echo "GLIBC_LOCALES=\"$GLIBC_LOCALES\"" >> $MODULE_CONFIG
+
+ cleanup_supported_locales
fi
echo "OPTS=\"\$OPTS $OPTS\"" >> $MODULE_CONFIG
More information about the Lunar-commits
mailing list