Date: Friday, February 14, 2014 @ 03:41:59
  Author: allan
Revision: 205914

upgpkg: glibc 2.19-2

revert parallel locale generation - this can create corrupt locale-archive files

Modified:
  glibc/trunk/PKGBUILD
  glibc/trunk/glibc.install
  glibc/trunk/locale-gen

---------------+
 PKGBUILD      |    4 +--
 glibc.install |    2 -
 locale-gen    |   60 +++++++++++++++++++++-----------------------------------
 3 files changed, 26 insertions(+), 40 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2014-02-14 00:28:13 UTC (rev 205913)
+++ PKGBUILD    2014-02-14 02:41:59 UTC (rev 205914)
@@ -8,7 +8,7 @@
 
 pkgname=glibc
 pkgver=2.19
-pkgrel=1
+pkgrel=2
 pkgdesc="GNU C Library"
 arch=('i686' 'x86_64')
 url="http://www.gnu.org/software/libc";
@@ -29,7 +29,7 @@
          'SKIP'
          '7ca96c68a37f2a4ab91792bfa0160a24'
          '07ac979b6ab5eeb778d55f041529d623'
-         'b5fd017036fb91199ee76f670da8c15b')
+         '476e9113489f93b348b21e144b6a8fcf')
 
 prepare() {
   cd ${srcdir}/${pkgname}-${pkgver}

Modified: glibc.install
===================================================================
--- glibc.install       2014-02-14 00:28:13 UTC (rev 205913)
+++ glibc.install       2014-02-14 02:41:59 UTC (rev 205914)
@@ -4,7 +4,7 @@
 post_upgrade() {
   ldconfig -r .
   
-  if [[ $(vercmp 2.19 $2) = 1 ]]; then
+  if [[ $(vercmp 2.19-2 $2) = 1 ]]; then
     locale-gen
   fi
   

Modified: locale-gen
===================================================================
--- locale-gen  2014-02-14 00:28:13 UTC (rev 205913)
+++ locale-gen  2014-02-14 02:41:59 UTC (rev 205914)
@@ -4,53 +4,39 @@
 
 LOCALEGEN=/etc/locale.gen
 LOCALES=/usr/share/i18n/locales
-unset POSIXLY_CORRECT
+if [ -n "$POSIXLY_CORRECT" ]; then
+  unset POSIXLY_CORRECT
+fi
 
-[ -s "$LOCALEGEN" ] || exit 0
 
+[ -f $LOCALEGEN -a -s $LOCALEGEN ] || exit 0;
+
 # Remove all old locale dir and locale-archive before generating new
 # locale data.
-rm -rf /usr/lib/locale/*
+rm -rf /usr/lib/locale/* || true
 
 umask 022
 
-gen() {
-       local locale=$1
-       local charset=$2
-       local input=
-
-       if [ -z "$locale" ] || [ -z "$charset" ]; then
-               echo "error: Bad entry '$locale $charset'"
-               return
-       fi
-
-       printf '  %s.%s\n' "$(echo "$locale" | sed 's/\([^.\@]*\).*/\1/')" 
"$charset"
-
-       if [ -f "$LOCALES/$locale" ]; then
-               input=$locale
-       else
-               input=$(echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/')
-       fi
-
-       localedef -i "$input" -c -f "$charset" -A 
/usr/share/locale/locale.alias "$locale"
+is_entry_ok() {
+  if [ -n "$locale" -a -n "$charset" ] ; then
+    true
+  else
+    echo "error: Bad entry '$locale $charset'"
+    false
+  fi
 }
 
-maxjobs=$(grep -c processor /proc/cpuinfo 2>/dev/null || echo 1)
 echo "Generating locales..."
 while read locale charset; do \
-       case $locale in
-               \#*|'')
-                       continue
-                       ;;
-       esac
-       gen "$locale" "$charset" &
-
-       # keep no more than $maxjobs jobs in flight
-       while [ $(jobs | wc -l) -ge $maxjobs ]; do
-               sleep 0.25
-               jobs >/dev/null
-       done
+       case $locale in \#*) continue;; "") continue;; esac; \
+       is_entry_ok || continue
+       echo -n "  `echo $locale | sed 's/\([^.\@]*\).*/\1/'`"; \
+       echo -n ".$charset"; \
+       echo -n `echo $locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \
+       echo -n '...'; \
+        if [ -f $LOCALES/$locale ]; then input=$locale; else \
+        input=`echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; fi; \
+       localedef -i $input -c -f $charset -A /usr/share/locale/locale.alias 
$locale; \
+       echo ' done'; \
 done < $LOCALEGEN
-wait
-
 echo "Generation complete."

Reply via email to