darcs

Patch 768 be a little smarter about finding a latin9 locale for ...

Title be a little smarter about finding a latin9 locale for ...
Superseder Nosy List kowey, simon
Related Issues
Status accepted Assigned To
Milestone

Created on 2012-03-30.18:03:28 by simon, last changed 2012-04-20.21:44:47 by darcswatch. Tracked on DarcsWatch.

Files
File name Status Uploaded Type Edit Remove
be-a-little-smarter-about-finding-a-latin9-locale-for-shell-tests.dpatch simon, 2012-03-30.18:03:28 text/x-darcs-patch
find-latin9-locale-on-os-x-too.dpatch mndrix, 2012-04-20.20:27:01 application/x-darcs-patch
patch-preview.txt mndrix, 2012-04-20.20:27:01 text/x-darcs-patch
unnamed simon, 2012-03-30.18:03:28
unnamed mndrix, 2012-04-20.20:27:01
See mailing list archives for discussion on individual patches.
Messages
msg15431 (view) Author: simon Date: 2012-03-30.18:03:28
1 patch for repository http://darcs.net:

Fri Mar 30 10:50:32 PDT 2012  Simon Michael <simon@joyful.com>
  * be a little smarter about finding a latin9 locale for shell tests
  Grep locale -a output for "iso885915" rather than "@euro", and give a more
  helpful test skipped message (if that is ever displayed, I'm not sure)
Attachments
msg15434 (view) Author: ganesh Date: 2012-03-30.22:02:02
on my machine, I get the following, which suggests that there is an 
actual difference between the two. But from my limited understanding 
from a quick Google, it does seem iso885915 is what's really wanted to 
get Latin 9, so this change seems sensible anyway.


ganesh@urchin:~/temp$ locale -a | grep @euro
br_FR@euro
br_FR.iso885915@euro
ca_ES@euro
ca_ES.iso885915@euro
de_AT@euro
de_AT.iso885915@euro
de_BE@euro
de_BE.iso885915@euro
de_DE@euro
de_DE.iso885915@euro
de_LU@euro
de_LU.iso885915@euro
en_IE@euro
en_IE.iso885915@euro
es_ES@euro
es_ES.iso885915@euro
eu_ES@euro
eu_ES.iso885915@euro
eu_FR@euro
eu_FR.iso885915@euro
fi_FI@euro
fi_FI.iso885915@euro
fr_BE@euro
fr_BE.iso885915@euro
fr_FR@euro
fr_FR.iso885915@euro
fr_LU@euro
fr_LU.iso885915@euro
ga_IE@euro
ga_IE.iso885915@euro
gl_ES@euro
gl_ES.iso885915@euro
it_IT@euro
it_IT.iso885915@euro
nl_BE@euro
nl_BE.iso885915@euro
nl_NL@euro
nl_NL.iso885915@euro
pt_PT@euro
pt_PT.iso885915@euro
sv_FI@euro
sv_FI.iso885915@euro
wa_BE@euro
wa_BE.iso885915@euro
msg15499 (view) Author: darcswatch Date: 2012-04-01.16:04:53
This patch bundle (with 1 patches) was just applied to the repository http://darcs.net/screened.
This message was brought to you by DarcsWatch
http://darcswatch.nomeata.de/repo_http:__darcs.net_screened.html#bundle-1633a6c31ea6b3b2d6683055c5b9d0b4be9e4dab
msg15501 (view) Author: ganesh Date: 2012-04-01.17:14:38
Looks like the locale -a output varies rather a lot!
I think I saw iso8859-15 on kowey's machine, for example. Eric - could you 
update this patch with the output from your machine?
msg15503 (view) Author: simon Date: 2012-04-01.17:31:47
Perhaps " egrep -i '8859-?15' " would be an improvement, assuming egrep is 
the most compatible way to do regexp grepping.
msg15509 (view) Author: thorkilnaur Date: 2012-04-01.22:08:16
With

> $ uname -a
> Darwin thorkil-naurs-intel-mac-mini.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-
1228.15.4~1/RELEASE_I386 i386
> $ locale -a
> af_ZA
> af_ZA.ISO8859-1
> af_ZA.ISO8859-15
> af_ZA.UTF-8
> am_ET
> am_ET.UTF-8
> be_BY
> be_BY.CP1131
> be_BY.CP1251
> be_BY.ISO8859-5
> be_BY.UTF-8
> bg_BG
> bg_BG.CP1251
> bg_BG.UTF-8
> ca_ES
> ca_ES.ISO8859-1
> ca_ES.ISO8859-15
> ca_ES.UTF-8
> cs_CZ
> cs_CZ.ISO8859-2
> cs_CZ.UTF-8
> da_DK
> da_DK.ISO8859-1
> da_DK.ISO8859-15
> da_DK.UTF-8
> de_AT
> de_AT.ISO8859-1
> de_AT.ISO8859-15
> de_AT.UTF-8
> de_CH
> de_CH.ISO8859-1
> de_CH.ISO8859-15
> de_CH.UTF-8
> de_DE
> de_DE.ISO8859-1
> de_DE.ISO8859-15
> de_DE.UTF-8
> el_GR
> el_GR.ISO8859-7
> el_GR.UTF-8
> en_AU
> en_AU.ISO8859-1
> en_AU.ISO8859-15
> en_AU.US-ASCII
> en_AU.UTF-8
> en_CA
> en_CA.ISO8859-1
> en_CA.ISO8859-15
> en_CA.US-ASCII
> en_CA.UTF-8
> en_GB
> en_GB.ISO8859-1
> en_GB.ISO8859-15
> en_GB.US-ASCII
> en_GB.UTF-8
> en_IE
> en_IE.UTF-8
> en_NZ
> en_NZ.ISO8859-1
> en_NZ.ISO8859-15
> en_NZ.US-ASCII
> en_NZ.UTF-8
> en_US
> en_US.ISO8859-1
> en_US.ISO8859-15
> en_US.US-ASCII
> en_US.UTF-8
> es_ES
> es_ES.ISO8859-1
> es_ES.ISO8859-15
> es_ES.UTF-8
> et_EE
> et_EE.ISO8859-15
> et_EE.UTF-8
> eu_ES
> eu_ES.ISO8859-1
> eu_ES.ISO8859-15
> eu_ES.UTF-8
> fi_FI
> fi_FI.ISO8859-1
> fi_FI.ISO8859-15
> fi_FI.UTF-8
> fr_BE
> fr_BE.ISO8859-1
> fr_BE.ISO8859-15
> fr_BE.UTF-8
> fr_CA
> fr_CA.ISO8859-1
> fr_CA.ISO8859-15
> fr_CA.UTF-8
> fr_CH
> fr_CH.ISO8859-1
> fr_CH.ISO8859-15
> fr_CH.UTF-8
> fr_FR
> fr_FR.ISO8859-1
> fr_FR.ISO8859-15
> fr_FR.UTF-8
> he_IL
> he_IL.UTF-8
> hi_IN.ISCII-DEV
> hr_HR
> hr_HR.ISO8859-2
> hr_HR.UTF-8
> hu_HU
> hu_HU.ISO8859-2
> hu_HU.UTF-8
> hy_AM
> hy_AM.ARMSCII-8
> hy_AM.UTF-8
> is_IS
> is_IS.ISO8859-1
> is_IS.ISO8859-15
> is_IS.UTF-8
> it_CH
> it_CH.ISO8859-1
> it_CH.ISO8859-15
> it_CH.UTF-8
> it_IT
> it_IT.ISO8859-1
> it_IT.ISO8859-15
> it_IT.UTF-8
> ja_JP
> ja_JP.eucJP
> ja_JP.SJIS
> ja_JP.UTF-8
> kk_KZ
> kk_KZ.PT154
> kk_KZ.UTF-8
> ko_KR
> ko_KR.CP949
> ko_KR.eucKR
> ko_KR.UTF-8
> lt_LT
> lt_LT.ISO8859-13
> lt_LT.ISO8859-4
> lt_LT.UTF-8
> nl_BE
> nl_BE.ISO8859-1
> nl_BE.ISO8859-15
> nl_BE.UTF-8
> nl_NL
> nl_NL.ISO8859-1
> nl_NL.ISO8859-15
> nl_NL.UTF-8
> no_NO
> no_NO.ISO8859-1
> no_NO.ISO8859-15
> no_NO.UTF-8
> pl_PL
> pl_PL.ISO8859-2
> pl_PL.UTF-8
> pt_BR
> pt_BR.ISO8859-1
> pt_BR.UTF-8
> pt_PT
> pt_PT.ISO8859-1
> pt_PT.ISO8859-15
> pt_PT.UTF-8
> ro_RO
> ro_RO.ISO8859-2
> ro_RO.UTF-8
> ru_RU
> ru_RU.CP1251
> ru_RU.CP866
> ru_RU.ISO8859-5
> ru_RU.KOI8-R
> ru_RU.UTF-8
> sk_SK
> sk_SK.ISO8859-2
> sk_SK.UTF-8
> sl_SI
> sl_SI.ISO8859-2
> sl_SI.UTF-8
> sr_YU
> sr_YU.ISO8859-2
> sr_YU.ISO8859-5
> sr_YU.UTF-8
> sv_SE
> sv_SE.ISO8859-1
> sv_SE.ISO8859-15
> sv_SE.UTF-8
> tr_TR
> tr_TR.ISO8859-9
> tr_TR.UTF-8
> uk_UA
> uk_UA.ISO8859-5
> uk_UA.KOI8-U
> uk_UA.UTF-8
> zh_CN
> zh_CN.eucCN
> zh_CN.GB18030
> zh_CN.GB2312
> zh_CN.GBK
> zh_CN.UTF-8
> zh_HK
> zh_HK.Big5HKSCS
> zh_HK.UTF-8
> zh_TW
> zh_TW.Big5
> zh_TW.UTF-8
> C
> POSIX
> $ 

the present screened darcs fails its utf8.sh test, both Darcs2 and Hashed, when built with both

> $ ghc --version
> The Glorious Glasgow Haskell Compilation System, version 7.0.4

and

> $ ghc --version
> The Glorious Glasgow Haskell Compilation System, version 7.4.1

The failure looks like this:

$ ./dist/build/darcs-test/darcs-test --darcs `pwd`/dist/build/darcs/darcs --network=no --shell=yes --unit=no -t utf8
utf8.sh (Darcs2): [Failed]
| 
| # Helper function: do a darcs changes --xml and grep the result for the first
| # argument. If it is not found, exit with status 1. Otherwise, continue. The
| # second argument is a text that describes what we're grepping for.
| # If a third argument is given, it is used as the value for a --last option for
| # darcs changes.
| grep_changes () {
|     if [ -z "$3" ]; then
|             last=""
|     else
|             last="--last $3"
|     fi
| 
|     darcs changes $last --xml > changes.xml
|     if grep "$1" changes.xml ; then
|         echo "$2 OK"
|     else
|         echo "$2 not UTF-8-encoded!"
|         exit 1
|     fi
| }
| 
| 
| # This file is encoded in ISO-8859-15 aka latin9. It was crafted with a hex editor.
| # Please leave it this way :-)
| switch_to_latin9_locale
| + switch_to_latin9_locale
| + which locale
| /usr/bin/locale
| locale -a | grep -i iso885915 | head -n 1
| ++ locale -a
| ++ grep -i iso885915
| ++ head -n 1
| + latin9_locale=
| + no_latin9_locale_warning
| + echo 'no ISO 8859-15 locale found, skipping test'
| + echo 'try (eg): sudo locale-gen en_US.ISO-8859-15'
| + exit 200
| + test -n ''
| no ISO 8859-15 locale found, skipping test
| try (eg): sudo locale-gen en_US.ISO-8859-15
| + no_latin9_locale_warning
| + echo 'no ISO 8859-15 locale found, skipping test'
| + echo 'try (eg): sudo locale-gen en_US.ISO-8859-15'
| + exit 200
| no ISO 8859-15 locale found, skipping test
| try (eg): sudo locale-gen en_US.ISO-8859-15
| + echo 'Using locale '
| + export LC_ALL=
| + LC_ALL=
| Using locale 
| locale charmap
| ++ locale charmap
| + echo 'character encoding is now '
| 
| rm -rf temp1
| + rm -rf temp1
| character encoding is now 
| mkdir temp1
| + mkdir temp1
| cd temp1
| + cd temp1
| 
| darcs init
| + darcs init
| 
| # Test recording non-UTF-8-encoded non-latin1 ("funny") metadata from
| # interactive input
| 
| echo 'Selbstverst?ndlich ?berraschend' > something.txt
| + echo 'Selbstverst?ndlich ?berraschend'
| darcs add something.txt
| + darcs add something.txt
| 
| echo 'l33tking?0r@example.org' > interaction_script.txt
| + echo $'l33tking\2700r@example.org'
| echo y >> interaction_script.txt
| + echo y
| echo y >> interaction_script.txt
| + echo y
| echo y >> interaction_script.txt
| + echo y
| echo '?uroh4xx0rz' >> interaction_script.txt
| + echo $'\244uroh4xx0rz'
| echo n >> interaction_script.txt
| + echo n
| 
| unset DARCSEMAIL
| + unset DARCSEMAIL
| unset DARCS_TESTING_PREFS_DIR
| + unset DARCS_TESTING_PREFS_DIR
| unset EMAIL
| + unset EMAIL
| set
| + set
| darcs record -i < interaction_script.txt
| + darcs record -i
| BASH=/bin/bash
| BASH_ARGC=()
| BASH_ARGV=()
| BASH_LINENO=([0]="0")
| BASH_SOURCE=([0]="test")
| BASH_VERSINFO=([0]="3" [1]="2" [2]="17" [3]="1" [4]="release" [5]="i386-apple-darwin9.0")
| BASH_VERSION='3.2.17(1)-release'
| CPATH=/opt/local/include:
| DARCS=/Users/thorkilnaur/tn/darcsDarcsRepository/screened/dist/build/darcs/darcs
| DARCS_DONT_COLOR=1
| DARCS_DONT_ESCAPE_ANYTHING=1
| DIRSTACK=()
| EUID=501
| GROUPS=()
| HOME=/tmp/tmpThreadId532769
| HOSTNAME=thorkil-naurs-intel-mac-mini.local
| HOSTTYPE=i386
| IFS=$' \t\n'
| LC_ALL=
| LIBRARY_PATH=/opt/local/lib:
| LOGNAME=thorkilnaur
| MACHTYPE=i386-apple-darwin9.0
| MAIL=/var/mail/thorkilnaur
| MANPATH=/usr/share/man:/usr/local/share/man:/usr/X11/man
| OLDPWD=/private/tmp/tmpThreadId532769
| OPTERR=1
| OPTIND=1
| OSTYPE=darwin9.0
| PATH=/Users/thorkilnaur/tn/darcsDarcsRepository/screened/dist/build/darcs:/Users/thorkilnaur/tn/install/ghc-
7.0.4/bin:/Users/thorkilnaur/tn/install/ghc-7.4.1/bin:/Users/thorkilnaur/tn/install/ghc-7.0.4/bin:/Users/thorkilnaur/tn/install/ghc-
7.4.1/bin:/Users/thorkilnaur/tn/install/GHCBuilderClient-20111226_1104/bin:/Users/thorkilnaur/tn/install/hscolour-
1.10.1/bin:/Users/thorkilnaur/tn/install/happy-1.18.6/bin:/Users/thorkilnaur/tn/install/alex-
3.0.1/bin:/Users/thorkilnaur/tn/install/haddock-0.9/bin:/Users/thorkilnaur/tn/install/darcs-
2.5.2/bin:/Users/thorkilnaur/tn/install/ghc-
6.12.3/bin:/opt/local/bin:/opt/local/sbin:/Users/thorkilnaur/tn/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
| PIPESTATUS=([0]="0")
| PPID=32769
| PS4='+ '
| PWD=/private/tmp/tmpThreadId532769/temp1
| SHELL=/bin/bash
| SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:pipefail:verbose:xtrace
| SHLVL=2
| SSH_CLIENT='10.0.1.27 52119 22'
| SSH_CONNECTION='10.0.1.27 52119 10.0.1.31 22'
| SSH_TTY=/dev/ttys007
| TERM=xterm-color
| TESTBIN=/Users/thorkilnaur/tn/darcsDarcsRepository/screened/tests/bin
| TESTDATA=/Users/thorkilnaur/tn/darcsDarcsRepository/screened/tests/data
| UID=501
| USER=thorkilnaur
| _=EMAIL
| format=darcs-2
| latin9_locale=
| abort_windows () 
| { 
|     if echo $OS | grep -i windows; then
|         echo This test does not work on Windows;
|         exit 200;
|     fi
| }
| finish_http () 
| { 
|     test -e "$1/light.pid" && kill `cat "$1/light.pid"` || true
| }
| grep_changes () 
| { 
|     if [ -z "$3" ]; then
|         last="";
|     else
|         last="--last $3";
|     fi;
|     darcs changes $last --xml > changes.xml;
|     if grep "$1" changes.xml; then
|         echo "$2 OK";
|     else
|         echo "$2 not UTF-8-encoded!";
|         exit 1;
|     fi
| }
| no_latin9_locale_warning () 
| { 
|     echo "no ISO 8859-15 locale found, skipping test";
|     echo "try (eg): sudo locale-gen en_US.ISO-8859-15"
| }
| not () 
| { 
|     "$@" && exit 1 || :
| }
| pwd () 
| { 
|     ghc --make -o hspwd "$TESTBIN/hspwd.hs" > /dev/null;
|     "./hspwd"
| }
| serve_http () 
| { 
|     cat > light.conf  <<EOF
|     server.document-root       = "$PWD"
|     server.errorlog            = "/dev/null"
|     server.port                = 23032 ## FIXME
|     server.bind                = "localhost"
|     server.pid-file            = "$PWD/light.pid"
| EOF
| 
|     trap "finish_http \"$PWD\"" EXIT;
|     lighttpd -f light.conf || exit 200;
|     ps `cat light.pid` > /dev/null 2>&1 || exit 200;
|     baseurl="http://localhost:23032"
| }
| skip-formats () 
| { 
|     for f in "$@";
|     do
|         grep $f $HOME/.darcs/defaults && exit 200 || true;
|     done
| }
| switch_to_latin9_locale () 
| { 
|     if ! which locale; then
|         echo "no locale command, skipping test";
|         exit 200;
|     fi;
|     latin9_locale=`locale -a | grep -i iso885915 | head -n 1` || ( no_latin9_locale_warning;
|     exit 200 );
|     test -n "$latin9_locale" || ( no_latin9_locale_warning;
|     exit 200 );
|     echo "Using locale $latin9_locale";
|     export LC_ALL=$latin9_locale;
|     echo "character encoding is now `locale charmap`"
| }
| switch_to_utf8_locale () 
| { 
|     if ! which locale; then
|         echo "no locale command";
|         exit 200;
|     fi;
|     utf8_locale=`locale -a | grep .utf8 | head -n 1` || exit 200;
|     test -n "$utf8_locale" || exit 200;
|     echo "Using locale $utf8_locale";
|     export LC_ALL=$utf8_locale;
|     echo "character encoding is now `locale charmap`"
| }
| Each patch is attributed to its author, usually by email address (for
| example, `Fred Bloggs <fred@example.net>').  Darcs could not determine
| your email address, so you will be prompted for it.
| 
| Your address will be stored in _darcs/prefs/author.
| It will be used for all patches recorded in this repository.
| If you move that file to ~/.darcs/author, it will be used for patches
| you record in ALL repositories.
| What is your email address? addfile ./something.txt
| Shall I record this change? (1/2)  [ynW...], or ? for more options: hunk ./something.txt 1
| +Selbstverst?ndlich ?berraschend
| Shall I record this change? (2/2)  [ynW...], or ? for more options: Do you want to record these changes? [Yglqk...], or ? for more 
options: What is the patch name? Do you want to add a long comment? [yn]Finished recording patch '?uroh4xx0rz'
| grep_changes 'l33tkingž0r@example.org' 'patch author from interactive prompt'
| + grep_changes $'l33tking\305\2760r@example.org' 'patch author from interactive prompt'
| + '[' -z '' ']'
| + last=
| + darcs changes --xml
| + grep $'l33tking\305\2760r@example.org' changes.xml
| + echo 'patch author from interactive prompt not UTF-8-encoded!'
| + exit 1
| patch author from interactive prompt not UTF-8-encoded!

Best regards
Thorkil
msg15587 (view) Author: mndrix Date: 2012-04-20.20:27:01
1 patch for repository http://darcs.net/screened:

This patch fixes the test failure described in msg15509

Fri Apr 20 14:24:08 MDT 2012  Michael Hendricks <michael@ndrix.org>
  * Find latin9 locale on OS X too
  
  Most Linux systems describe latin9 as "iso885915".  OS X
  describes it with "ISO8859-15".  The new regex catches both.
Attachments
msg15591 (view) Author: mndrix Date: 2012-04-20.21:39:16
OK
msg15592 (view) Author: darcswatch Date: 2012-04-20.21:44:47
This patch bundle (with 1 patches) was just applied to the repository http://darcs.net/reviewed.
This message was brought to you by DarcsWatch
http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-1633a6c31ea6b3b2d6683055c5b9d0b4be9e4dab
History
Date User Action Args
2012-03-30 18:03:28simoncreate
2012-03-30 18:06:09darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-1633a6c31ea6b3b2d6683055c5b9d0b4be9e4dab
2012-03-30 22:02:02ganeshsetmessages: + msg15434
2012-04-01 16:04:53darcswatchsetstatus: needs-screening -> needs-review
messages: + msg15499
2012-04-01 17:14:38ganeshsetnosy: + kowey
messages: + msg15501
2012-04-01 17:31:47simonsetmessages: + msg15503
2012-04-01 22:08:17thorkilnaursetmessages: + msg15509
2012-04-20 20:27:01mndrixsetfiles: + patch-preview.txt, find-latin9-locale-on-os-x-too.dpatch, unnamed
messages: + msg15587
2012-04-20 21:39:16mndrixsetstatus: needs-review -> accepted
messages: + msg15591
2012-04-20 21:44:47darcswatchsetmessages: + msg15592