summarylogtreecommitdiffstats
path: root/localepurge.config.diff
diff options
context:
space:
mode:
authorHyacinthe Cartiaux2014-01-15 00:19:44 +0100
committerHyacinthe Cartiaux2015-06-09 10:22:36 +0200
commit9ea1abfc3cee25c321301b7e944afc371ba8323f (patch)
tree354e04febc91fac5a48d8aa9ee64b39702a2c3af /localepurge.config.diff
parent78ae30d3e5db1cd5e0ca1e1995e392a0d397683a (diff)
downloadaur-9ea1abfc3cee25c321301b7e944afc371ba8323f.tar.gz
[localepurge] Update to 0.7.3.1
Diffstat (limited to 'localepurge.config.diff')
-rw-r--r--localepurge.config.diff170
1 files changed, 170 insertions, 0 deletions
diff --git a/localepurge.config.diff b/localepurge.config.diff
new file mode 100644
index 00000000000..adbf2ae871a
--- /dev/null
+++ b/localepurge.config.diff
@@ -0,0 +1,170 @@
+--- ../localepurge-orig/debian/localepurge.config 2013-09-20 14:01:46.000000000 +0200
++++ localepurge.config 2013-09-21 15:31:10.574338160 +0200
+@@ -2,36 +2,22 @@
+
+ set -e
+
+-. /usr/share/debconf/confmodule
+-
+ # first get all possible locales and create a full list of locale values:
+
+-CONFIG_FILE="/etc/locale.nopurge"
+-TEMPFILE=$(tempfile).$$
++#TEMPFILE=$(tempfile).$$ ## tempfile command is part of debianutils package
++TEMPFILE=$(mktemp).$$
+ LOCALELIST=/var/cache/localepurge/localelist
+
+-conf_has_key() {
+- local key="$1"
+-
+- if [ -f "$CONFIG_FILE" ] && fgrep --quiet --line-regexp \
+- "$key" "$CONFIG_FILE"; then
+- echo "true"
+- else
+- echo "false"
+- fi
+-}
+-
+-
+ # for the purpose of presenting a ready made preselection at the very first
+ # configuration, include already configured locales from locales package:
+
+-LOCALEGEN=$(tempfile).locale.gen
++LOCALEGEN=$(mktemp).locale.gen
+ touch "$LOCALEGEN"
+
+ if [ -f /etc/locale.gen ]; then
+ grep ^[a-z] /etc/locale.gen | cut -d" " -f1 > "$LOCALEGEN"
+ # add double character locale names from underscore variations
+- # for later preselection:
++ # for later preselection:
+ cut -d"_" -f1 "$LOCALEGEN" | sort -u >> "$LOCALEGEN"
+ fi
+
+@@ -47,9 +33,8 @@
+
+ # include locales supported by the locales package:
+
+-if [ -f /usr/share/i18n/SUPPORTED ]; then
+- grep ^[a-z] /usr/share/i18n/SUPPORTED | cut -d' ' -f1 | sort -u >> "$TEMPFILE"
+-fi
++find /usr/share/locale -maxdepth 1 -type d -name "*" -printf "%f\n" | grep "^[a-z]" | cut -d" " -f1 | sort -u >> "$TEMPFILE"
++#find /usr/share/i18n/locales -maxdepth 1 -type f -name "*" -printf "%f\n" | grep "^[a-z]" | cut -d" " -f1 | sort -u >> "$TEMPFILE"
+
+ # include locales from our previous localelist if it already exists:
+
+@@ -60,8 +45,7 @@
+ # include locales from newly added locales:
+ NEWLOCALELIST="$LOCALELIST"-new
+
+-if [ -f "$NEWLOCALELIST" ] && \
+- [ $(ps w -p "$PPID" | grep -c dpkg-reconfigure) = "1" ]; then
++if [ -f "$NEWLOCALELIST" ]; then
+ cat "$NEWLOCALELIST" >> "$TEMPFILE"
+ rm -f "$NEWLOCALELIST"
+ fi
+@@ -74,102 +58,14 @@
+
+ if [ ! -f "$LOCALELIST" ]; then
+ if [ ! -d /var/cache/localepurge ]; then
+- mkdir -m 755 /var/cache/localepurge
++ mkdir -m 755 /var/cache/localepurge
+ fi
+ sort -u "$TEMPFILE" > "$LOCALELIST"
+- else
++else
+ mv "$LOCALELIST" "$LOCALELIST"-old
+ sort -u "$TEMPFILE" > "$LOCALELIST"
+ fi
+
+-# finally sort and create full list of all collected locale names
+-
+-LOCALES=$(sort -u "$TEMPFILE" | tr '\n' ' ' \
+- | sed 's/\ /,\ /g' | sed 's/,\ $//g')
+-
+-if [ -f "$CONFIG_FILE" ] ; then
+- # Update the debconf database
+- PRESELECT="$(grep --extended-regexp '^[[:lower:]][[:lower:]]' \
+- "$CONFIG_FILE" | tr '\n' ' ' | sed 's/\ /,\ /g' | \
+- sed 's/,\ $//g')"
+- db_set localepurge/nopurge "$PRESELECT"
+-
+- db_set localepurge/use-dpkg-feature "$(conf_has_key USE_DPKG)"
+- db_set localepurge/mandelete "$(conf_has_key MANDELETE)"
+- db_set localepurge/dontbothernew "$(conf_has_key DONTBOTHERNEWLOCALE)"
+- db_set localepurge/showfreedspace "$(conf_has_key SHOWFREEDSPACE)"
+- db_set localepurge/quickndirtycalc "$(conf_has_key QUICKNDIRTYCALC)"
+- db_set localepurge/verbose "$(conf_has_key VERBOSE)"
+-
+-else
+-
+- # sort and create preselection values from "$LOCALEGEN"
+-
+- PRESELECT=$(sort -u "$LOCALEGEN" | tr '\n' ' ' \
+- | sed 's/\ /,\ /g' | sed 's/,\ $//g')
+-fi
+-
+ # deleting temporary files not needed anymore:
+
+ rm -f "$TEMPFILE" "$LOCALEGEN"
+-
+-#############################################################
+-# now that all locale data is in place let debconf take over:
+-
+-db_subst localepurge/nopurge locales "$LOCALES"
+-
+-# uncomment for debugging:
+-#echo "$LOCALES" > /tmp/locales.list
+-
+-db_get localepurge/nopurge
+-if [ "$RET" = "" ] && [ "$RET" != "PURGE_ALL" ] \
+- || [ "$RET" = "NEEDSCONFIGFIRST" ]; then
+- db_set localepurge/nopurge "$PRESELECT"
+- db_fset localepurge/nopurge seen false
+- # uncomment for debugging:
+- #echo "$PRESELECT" > /tmp/preselect.list
+-fi
+-
+-db_input high localepurge/nopurge || true
+-db_go
+-
+-db_get localepurge/nopurge
+-if [ "$RET" = "" ] || [ "$RET" = "PURGE_ALL" ]; then
+- db_input high localepurge/none_selected || true
+- db_go
+-
+- db_get localepurge/none_selected
+- if [ "$RET" = "false" ]; then
+- db_input high localepurge/remove_no || true
+- db_go
+- fi
+-fi
+-
+-db_input high localepurge/use-dpkg-feature || true
+-db_go
+-if [ "$RET" = "" -o "$RET" = "true" ] ; then
+- USE_DPKG=yes
+-else
+- USE_DPKG=no
+-fi
+-
+-db_input medium localepurge/mandelete || true
+-db_go
+-
+-if [ "$USE_DPKG" = "xno" ] ; then
+- # Features incompatible with the dpkg approach.
+- db_input medium localepurge/dontbothernew || true
+- db_go
+-
+- db_input low localepurge/showfreedspace || true
+- db_go
+-
+- db_get localepurge/showfreedspace
+- if [ "$RET" = "true" ]; then
+- db_input low localepurge/quickndirtycalc || true
+- db_go
+- fi
+-
+- db_input low localepurge/verbose || true
+- db_go
+-fi