Compare commits

..

No commits in common. "7d61b7c431c434ea330c82488ff8698e17a1cfb3" and "f54b515115150b2fede32fb10224f374b52a4567" have entirely different histories.

2 changed files with 65 additions and 46 deletions

View file

@ -229,6 +229,10 @@ Handle project workflows in a unified way:
* selected * selected
* available * available
* effective * effective
* factorize
* ca
* dns
* locales
* handle errors * handle errors
* packages * packages
* configure * configure

View file

@ -200,51 +200,62 @@ _spcd_txt_pick() {
# ╰───────────╯ # ╰───────────╯
spcd_ca() { spcd_ca() {
local grep="\(After\|Before\|Issuer\|Signature Algorithm\|Subject:\)"
local index name value local index name value
local root="${2}" local grep="\(After\|Before\|Issuer\|Signature Algorithm\|Subject:\)"
while true; do case "${1}" in
index=$((index + 1)) "list")
name="SPCD_CA_${index}" while true; do
eval "value=\"\${${name}}\"" index=$((index + 1))
[ -n "${value}" ] || break name="SPCD_CA_${index}"
case "${1}" in eval "value=\"\${${name}}\""
"list") [ -n "${value}" ] || break
echo "${name} =" echo "${name} ="
echo "${value}" | echo "${value}" |
openssl x509 -noout -text | openssl x509 -noout -text |
grep "${grep}" grep "${grep}"
;; done
"write") ;;
"write")
local root="${2}"
while true; do
index=$((index + 1))
name="SPCD_CA_${index}"
eval "value=\"\${${name}}\""
[ -n "${value}" ] || break
spcd_os_write "${root}/${index}.crt" "${value}" spcd_os_write "${root}/${index}.crt" "${value}"
;; done
*) ;; ;;
esac *) ;;
done esac
} }
spcd_dns() { spcd_dns() {
local index name text value local index name value
while true; do case "${1}" in
index=$((index + 1)) "list")
name="SPCD_DNS_${index}" while true; do
eval "value=\"\${${name}}\"" index=$((index + 1))
[ -n "${value}" ] || break name="SPCD_DNS_${index}"
case "${1}" in eval "value=\"\${${name}}\""
"list") [ -n "${value}" ] || break
spcd_os_printenv "${name}" spcd_os_printenv "${name}"
;; done
"write") ;;
"write")
local text
while true; do
index=$((index + 1))
name="SPCD_DNS_${index}"
eval "value=\"\${${name}}\""
[ -n "${value}" ] || break
text="${text}\ text="${text}\
nameserver ${value} nameserver ${value}
" "
;; done
*) ;;
esac
done
if [ "${1}" = "write" ]; then
spcd_os_write "/etc/resolv.conf" "${text}" spcd_os_write "/etc/resolv.conf" "${text}"
fi ;;
*) ;;
esac
} }
# ╭───────────┬───────╮ # ╭───────────┬───────╮
@ -411,31 +422,35 @@ spcd_txt_locales() {
set -- \ set -- \
"${SPCD_TXT_LOCALE_ENGLISH}" \ "${SPCD_TXT_LOCALE_ENGLISH}" \
"${SPCD_TXT_LOCALE_FRENCH}" "${SPCD_TXT_LOCALE_FRENCH}"
local language locale text local locale
for locale in "${@}"; do case "${1}" in
case "${1}" in "glibc-langpack-")
"glibc-langpack-") local language
for locale in "${@}"; do
language="$(echo "${locale}" | cut -d _ -f 1)" language="$(echo "${locale}" | cut -d _ -f 1)"
spcd_install_package "glibc-langpack-${language}" spcd_install_package "glibc-langpack-${language}"
;; done
"LANGUAGE") ;;
"LANGUAGE")
local text
for locale in "${@}"; do
if [ -n "${text}" ]; then if [ -n "${text}" ]; then
text="${text}:${locale}" text="${text}:${locale}"
else else
text="${locale}" text="${locale}"
fi fi
;; done
"locale.gen") export LANGUAGE="${text}"
;;
"locale.gen")
local text
for locale in "${@}"; do
text="${text}\ text="${text}\
${locale}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET} ${locale}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET}
" "
;; done
*) ;; spcd_os_write "/etc/locale.gen" "${text}"
esac ;;
done
case "${1}" in
"LANGUAGE") export LANGUAGE="${text}" ;;
"locale.gen") spcd_os_write "/etc/locale.gen" "${text}" ;;
*) ;; *) ;;
esac esac
} }