From 5b9833151caa6c601278a188a3c335a56bc529b1 Mon Sep 17 00:00:00 2001 From: Einhard Leichtfuß Date: Sun, 23 Dec 2018 18:31:05 +0100 Subject: plit off user-config.sh --- TODO | 1 + basic.sh | 3 +- config.default.sh | 92 -------------------------------------------------- general-config.sh | 89 ++++++++++++++++++++++++++++++++++++++++++++++++ user-config.default.sh | 9 +++++ 5 files changed, 101 insertions(+), 93 deletions(-) delete mode 100644 config.default.sh create mode 100644 general-config.sh create mode 100644 user-config.default.sh diff --git a/TODO b/TODO index 84528b1..712ff59 100644 --- a/TODO +++ b/TODO @@ -14,6 +14,7 @@ TODO file for aur-fd-scripts * Set up directory structure if not existing. * [consider] Notify on checksum change (should not happen unless version numbers change). +* Add $basedir in user-config.default.sh [NON-FUNCTIONAL] * Be consistent in quoting. diff --git a/basic.sh b/basic.sh index 91c49cd..5dc475f 100644 --- a/basic.sh +++ b/basic.sh @@ -29,7 +29,8 @@ script_path="$(realpath "$0")" script_dir="${script_path%/*}" -. "${script_dir}/config.sh" || exit 1 +. "${script_dir}/general-config.sh" || exit 1 +. "${script_dir}/user-config.sh" || exit 1 function init diff --git a/config.default.sh b/config.default.sh deleted file mode 100644 index 276f912..0000000 --- a/config.default.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright 2018 Einhard Leichtfuß -# -# config.default.sh - default configuration options; -# copy this file to config.sh and modify to your liking. -# -# This file is part of aur-fd-scripts -# -# aur-fd-scripts is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# aur-fd-scripts is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with aur-fd-scripts. If not, see . -# - - -# The maintainer to be listed in the PKGBUILD. -maintainer="Your Name " - - -# Dictionaries in the VCS tree, GPL2 assumed. -typeset -a vcs_langs -vcs_langs=( - deu-eng eng-deu - fra-eng eng-fra - spa-eng eng-spa - ) - -typeset -a wikdict_langs -wikdict_langs=( - fra-deu deu-fra - ) - -typeset -a langs -langs=( ${vcs_langs[@]} ${wikdict_langs[@]} ) - - -# Long names table. -typeset -A long -long[fra]=French -long[deu]=German -long[eng]=English -long[spa]=Spanish - - -# Contributors for some specific PKGBUILDs (indexed by $lang$ext). -typeset -A contrs -contrs[deu-eng-bin]=\ -'# Contributor: akane '$'\n' -contrs[eng-deu-bin]=\ -'# Contributor: akane '$'\n' -contrs[fra-eng-bin]=\ -'# Contributor: Benjamin Vanderford '$'\n' -contrs[eng-fra-bin]=\ -'# Contributor: Benjamin Vanderford '$'\n' - -# Licenses (indexed by $lang) -typeset -A licenses -for lang in ${vcs_langs[@]} -do - licenses[$lang]="'GPL'" -done - -for lang in ${wikdict_langs[@]} -do - licenses[$lang]="'CCPL:by-sa' 'FDL'" -done - - -# prepare() functions (indexed by $lang$ext). -typeset -A prepare - -# Does not work for deu-fra-bin, since the index file must stay in sync. -prepare[deu-fra]=\ -'prepare() -{ - cd $_lang - sed -Ei \ - -e '"'"'s/(10)(10)(100\>)(\s+\(10)(Googol.*(1|Eins) mit einem Googol Nullen)/\1^(\2^\3)\4^\5/'"'"' \ - -e '"'"'s/(10)([1-9][0-9]*)(.*(1|Eins) mit \2 Nullen)/\1\^\2\3/'"'"' \ - -e '"'"'s/(die Zahl 10)(60)/\1^\2/'"'"' \ - ${_lang}.tei -} -' diff --git a/general-config.sh b/general-config.sh new file mode 100644 index 0000000..43b10b3 --- /dev/null +++ b/general-config.sh @@ -0,0 +1,89 @@ +#!/usr/bin/env bash +# +# Copyright 2018 Einhard Leichtfuß +# +# general-config.sh - general configuration options +# +# This file is part of aur-fd-scripts +# +# aur-fd-scripts is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# aur-fd-scripts is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with aur-fd-scripts. If not, see . +# + + +# Dictionaries in the VCS tree, GPL2 assumed. +typeset -a vcs_langs +vcs_langs=( + deu-eng eng-deu + fra-eng eng-fra + spa-eng eng-spa + ) + +# Dictionaries imported from WikDict, hence Wiktionary. +# Dual licensed: CC-BY-SA, GNU FDL (1.1 or later). +typeset -a wikdict_langs +wikdict_langs=( + fra-deu deu-fra + ) + +typeset -a langs +langs=( ${vcs_langs[@]} ${wikdict_langs[@]} ) + + +# Long names table. +typeset -A long +long[fra]=French +long[deu]=German +long[eng]=English +long[spa]=Spanish + + +# Contributors for some specific PKGBUILDs (indexed by $lang$ext). +typeset -A contrs +contrs[deu-eng-bin]=\ +'# Contributor: akane '$'\n' +contrs[eng-deu-bin]=\ +'# Contributor: akane '$'\n' +contrs[fra-eng-bin]=\ +'# Contributor: Benjamin Vanderford '$'\n' +contrs[eng-fra-bin]=\ +'# Contributor: Benjamin Vanderford '$'\n' + +# Licenses (indexed by $lang) +typeset -A licenses +for lang in ${vcs_langs[@]} +do + licenses[$lang]="'GPL'" +done + +for lang in ${wikdict_langs[@]} +do + licenses[$lang]="'CCPL:by-sa' 'FDL'" +done + + +# prepare() functions (indexed by $lang$ext). +typeset -A prepare + +# Does not work for deu-fra-bin, since the index file must stay in sync. +prepare[deu-fra]=\ +'prepare() +{ + cd $_lang + sed -Ei \ + -e '"'"'s/(10)(10)(100\>)(\s+\(10)(Googol.*(1|Eins) mit einem Googol Nullen)/\1^(\2^\3)\4^\5/'"'"' \ + -e '"'"'s/(10)([1-9][0-9]*)(.*(1|Eins) mit \2 Nullen)/\1\^\2\3/'"'"' \ + -e '"'"'s/(die Zahl 10)(60)/\1^\2/'"'"' \ + ${_lang}.tei +} +' diff --git a/user-config.default.sh b/user-config.default.sh new file mode 100644 index 0000000..4675afb --- /dev/null +++ b/user-config.default.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# +# user-config.default.sh - user configuration options; +# copy this file to user-config.sh and modify to +# your liking. +# + +# The maintainer to be listed in the PKGBUILD. +maintainer="Your Name " -- cgit v1.2.3