diff options
author | Pavel Raiskup <praiskup@redhat.com> | 2014-10-17 13:32:11 +0200 |
---|---|---|
committer | Pavel Raiskup <praiskup@redhat.com> | 2014-10-17 13:36:37 +0200 |
commit | ae43df7956e3f346fa5b28f5f2f19c418d52733c (patch) | |
tree | fee18cf4c1166076b0aea8e1047bb85eeaedbe8e | |
parent | cfbbf52a744d0ce7ebcca49702924c6df7d6428c (diff) | |
download | postgresql-setup-tests-ae43df7956e3f346fa5b28f5f2f19c418d52733c.tar.gz postgresql-setup-tests-ae43df7956e3f346fa5b28f5f2f19c418d52733c.tar.xz postgresql-setup-tests-ae43df7956e3f346fa5b28f5f2f19c418d52733c.zip |
gen-data/tasks: new task 'locale-utf-typo'
In F20+ we should be able to deal with upgrades where user (or
system itself) changed the system locale like from 'en_US.utf8' to
'en_US.UTF-8' (which is just a syntax change). Data generated by
this task should help testing this.
* gen-data/tasks/templates/locale-change.sh: Add new template for
locale related data-generation.
* gen-data/tasks/locale-cz/run.sh: Reuse template ^^.
* gen-data/tasks/locale-utf-typo/run.sh: New file for
'en_US.UTF-8' to 'en_US.utf8' switch. Reuse template ^^.
-rw-r--r-- | gen-data/tasks/locale-cz/run.sh | 19 | ||||
-rw-r--r-- | gen-data/tasks/locale-utf-typo/run.sh | 5 | ||||
-rw-r--r-- | gen-data/tasks/templates/locale-change.sh | 16 |
3 files changed, 24 insertions, 16 deletions
diff --git a/gen-data/tasks/locale-cz/run.sh b/gen-data/tasks/locale-cz/run.sh index 12f0a48..1788557 100644 --- a/gen-data/tasks/locale-cz/run.sh +++ b/gen-data/tasks/locale-cz/run.sh @@ -1,18 +1,5 @@ -export task_name="cz-locale" +export task_name="locale-cz" -hook_start() -{ - export CHECK_LOCALE=0 - ___old_locale="$(cat /etc/locale.conf)" - echo "LANG=cs_CZ.UTF-8" > /etc/locale.conf -} +export ___new_locale="LANG=cs_CZ.utf8" -hook_end() -{ - echo "$___old_locale" > /etc/locale.conf -} - -run() -{ - create_pagila -} +. ./tasks/templates/locale-change.sh diff --git a/gen-data/tasks/locale-utf-typo/run.sh b/gen-data/tasks/locale-utf-typo/run.sh new file mode 100644 index 0000000..9004a88 --- /dev/null +++ b/gen-data/tasks/locale-utf-typo/run.sh @@ -0,0 +1,5 @@ +export task_name="locale-utf-typo" + +export ___new_locale="LANG=en_US.utf8" + +. ./tasks/templates/locale-change.sh diff --git a/gen-data/tasks/templates/locale-change.sh b/gen-data/tasks/templates/locale-change.sh new file mode 100644 index 0000000..8f7964f --- /dev/null +++ b/gen-data/tasks/templates/locale-change.sh @@ -0,0 +1,16 @@ +hook_start() +{ + export CHECK_LOCALE=0 + ___old_locale="$(cat /etc/locale.conf)" + echo "$___new_locale" > /etc/locale.conf +} + +hook_end() +{ + echo "$___old_locale" > /etc/locale.conf +} + +run() +{ + create_pagila +} |