tst-gettext2: make setup more robust
diff mbox

Message ID 1407162830-7944-1-git-send-email-vapier@gentoo.org
State Accepted, archived
Headers show

Commit Message

Mike Frysinger Aug. 4, 2014, 2:33 p.m. UTC
This test should be more robust about setting up its lang dirs.
I had two completely different systems (ia64 & x86_64) get wedged
in a way where the test just kept FAILing on me due to some of the
files missing.  This probably wasn't a big deal until the recent
commit which made checking of the locale dirs more robust (for
security reasons).
---
 intl/tst-gettext2.sh | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

Comments

Roland McGrath Aug. 6, 2014, 9:20 p.m. UTC | #1
That would look OK if it had a ChangeLog entry.
Mike Frysinger Aug. 6, 2014, 11:20 p.m. UTC | #2
On Wed 06 Aug 2014 14:20:02 Roland McGrath wrote:
> That would look OK if it had a ChangeLog entry.

i had one but forgot to commit amend before sending:
2014-08-04  Mike Frysinger  <vapier@gentoo.org>
    
	* intl/tst-gettext2.sh: Check every lang file for creation.
-mike

Patch
diff mbox

diff --git a/intl/tst-gettext2.sh b/intl/tst-gettext2.sh
index b4d203d..3bac6c9 100644
--- a/intl/tst-gettext2.sh
+++ b/intl/tst-gettext2.sh
@@ -28,27 +28,23 @@  objpfx=$5
 # Generate the test data.
 mkdir -p ${objpfx}domaindir
 # Create the locale directories.
-test -d ${objpfx}domaindir/lang1 || {
-  mkdir ${objpfx}domaindir/lang1
-  for f in ADDRESS COLLATE CTYPE IDENTIFICATION MEASUREMENT MONETARY NAME NUMERIC PAPER TELEPHONE TIME; do
+mkdir -p \
+  ${objpfx}domaindir/lang1/LC_MESSAGES \
+  ${objpfx}domaindir/lang2/LC_MESSAGES
+
+for f in ADDRESS COLLATE CTYPE IDENTIFICATION MEASUREMENT MONETARY NAME NUMERIC PAPER TELEPHONE TIME; do
+  [ -e ${objpfx}domaindir/lang1/LC_$f ] ||
     cp ${common_objpfx}localedata/de_DE.ISO-8859-1/LC_$f \
        ${objpfx}domaindir/lang1
-  done
-}
-test -d ${objpfx}domaindir/lang2 || {
-  mkdir ${objpfx}domaindir/lang2
-  for f in ADDRESS COLLATE CTYPE IDENTIFICATION MEASUREMENT MONETARY NAME NUMERIC PAPER TELEPHONE TIME; do
+  [ -e ${objpfx}domaindir/lang2/LC_$f ] ||
     cp ${common_objpfx}localedata/de_DE.ISO-8859-1/LC_$f \
        ${objpfx}domaindir/lang2
-  done
-}
-test -d ${objpfx}domaindir/lang1/LC_MESSAGES || {
-  mkdir ${objpfx}domaindir/lang1/LC_MESSAGES
+done
+test -e ${objpfx}domaindir/lang1/LC_MESSAGES/SYS_LC_MESSAGES || {
   cp ${common_objpfx}localedata/de_DE.ISO-8859-1/LC_MESSAGES/SYS_LC_MESSAGES \
      ${objpfx}domaindir/lang1/LC_MESSAGES
 }
-test -d ${objpfx}domaindir/lang2/LC_MESSAGES || {
-  mkdir ${objpfx}domaindir/lang2/LC_MESSAGES
+test -e ${objpfx}domaindir/lang2/LC_MESSAGES/SYS_LC_MESSAGES || {
   cp ${common_objpfx}localedata/de_DE.ISO-8859-1/LC_MESSAGES/SYS_LC_MESSAGES \
      ${objpfx}domaindir/lang2/LC_MESSAGES
 }