OSDN Git Service

[update] : Added locale gen
authorhayao <shun819.mail@gmail.com>
Sat, 27 Jun 2020 13:14:05 +0000 (22:14 +0900)
committerhayao <shun819.mail@gmail.com>
Sat, 27 Jun 2020 13:14:05 +0000 (22:14 +0900)
channels/lxde/airootfs.any/root/customize_airootfs_lxde.sh
channels/plasma/airootfs.any/root/customize_airootfs_plasma.sh
channels/releng/airootfs.any/root/customize_airootfs.sh
channels/share/airootfs.any/root/customize_airootfs.sh
channels/xfce/airootfs.any/root/customize_airootfs_xfce.sh

index a193fd7..2f2a34a 100755 (executable)
@@ -23,6 +23,7 @@ install_dir="alter"
 usershell="/bin/bash"
 debug=false
 timezone="UTC"
+localegen="en_US\\.UTF-8\\"
 
 
 # Parse arguments
@@ -40,7 +41,7 @@ while getopts 'p:bt:k:rxu:o:i:s:da:g:z:' arg; do
         d) debug=true ;;
         x) debug=true; set -xv ;;
         a) arch="${OPTARG}" ;;
-        g) language="${OPTARG}" ;;
+        g) localegen="${OPTARG/./\\.}\\" ;;
         z) timezone="${OPTARG}" ;;
     esac
 done
index 8e73e90..79ad8fc 100755 (executable)
@@ -16,6 +16,7 @@ install_dir="alter"
 usershell="/bin/bash"
 debug=false
 timezone="UTC"
+localegen="en_US\\.UTF-8\\"
 
 
 # Parse arguments
@@ -33,7 +34,7 @@ while getopts 'p:bt:k:rxu:o:i:s:da:g:z:' arg; do
         d) debug=true ;;
         x) debug=true; set -xv ;;
         a) arch="${OPTARG}" ;;
-        g) language="${OPTARG}" ;;
+        g) localegen="${OPTARG/./\\.}\\" ;;
         z) timezone="${OPTARG}" ;;
     esac
 done
index 9f7508b..a58c54d 100755 (executable)
@@ -23,6 +23,7 @@ install_dir="alter"
 usershell="/bin/bash"
 debug=false
 timezone="UTC"
+localegen="en_US\\.UTF-8\\"
 
 
 # Parse arguments
@@ -40,7 +41,7 @@ while getopts 'p:bt:k:rxu:o:i:s:da:g:z:' arg; do
         d) debug=true ;;
         x) debug=true; set -xv ;;
         a) arch="${OPTARG}" ;;
-        g) language="${OPTARG}" ;;
+        g) localegen="${OPTARG/./\\.}\\" ;;
         z) timezone="${OPTARG}" ;;
     esac
 done
index cc8e199..0294623 100755 (executable)
@@ -23,6 +23,7 @@ install_dir="alter"
 usershell="/bin/bash"
 debug=false
 timezone="UTC"
+localegen="en_US\\.UTF-8\\"
 
 
 # Parse arguments
@@ -40,7 +41,7 @@ while getopts 'p:bt:k:rxu:o:i:s:da:g:z:' arg; do
         d) debug=true ;;
         x) debug=true; set -xv ;;
         a) arch="${OPTARG}" ;;
-        g) language="${OPTARG}" ;;
+        g) localegen="${OPTARG/./\\.}\\" ;;
         z) timezone="${OPTARG}" ;;
     esac
 done
@@ -78,8 +79,8 @@ function remove () {
 
 # Enable and generate languages.
 sed -i 's/#\(en_US\.UTF-8\)/\1/' /etc/locale.gen
-if [[ "${language}" = "ja" ]]; then
-    sed -i 's/#\(ja_JP\.UTF-8\)/\1/' /etc/locale.gen
+if [[ ! "${localegen}" == "en_US\\.UTF-8\\" ]]; then
+    sed -i "s/#\(${localegen})/\1/" /etc/locale.gen
 fi
 locale-gen
 
index 130fbb3..eef4f40 100755 (executable)
@@ -23,6 +23,7 @@ install_dir="alter"
 usershell="/bin/bash"
 debug=false
 timezone="UTC"
+localegen="en_US\\.UTF-8\\"
 
 
 # Parse arguments
@@ -40,7 +41,7 @@ while getopts 'p:bt:k:rxu:o:i:s:da:g:z:' arg; do
         d) debug=true ;;
         x) debug=true; set -xv ;;
         a) arch="${OPTARG}" ;;
-        g) language="${OPTARG}" ;;
+        g) localegen="${OPTARG/./\\.}\\" ;;
         z) timezone="${OPTARG}" ;;
     esac
 done