From b300f3c047a606024db2098523c8fff70721c716 Mon Sep 17 00:00:00 2001 From: Einhard Leichtfuß Date: Sun, 23 Dec 2018 16:02:33 +0100 Subject: Use the provided sample.* files Do not longer rely on them being symlinked to the target directories. Also, fix small error in make_install.sh:main() ($1 -> $2). And add some comments. --- update.sh | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'update.sh') diff --git a/update.sh b/update.sh index 6e06e00..b78e062 100755 --- a/update.sh +++ b/update.sh @@ -29,10 +29,14 @@ # -ua: Update all that are out of date. # -uaf: Update all, even if they appear up to date. + script_path="$(realpath "$0")" script_dir="${script_path%/*}" + +## Some configuration. + # Long names table. typeset -A long long[fra]=French @@ -51,7 +55,7 @@ contrs[fra-eng-bin]=\ contrs[eng-fra-bin]=\ '# Contributor: Benjamin Vanderford '$'\n' -# prepare functions. +# prepare() functions. typeset -A prepare prepare[deu-fra]=\ 'prepare() @@ -65,9 +69,13 @@ prepare[deu-fra]=\ } ' +## End configuration + + . "${script_dir}/basic.sh" + function main { if [ "$#" -lt 2 ] @@ -107,18 +115,19 @@ function main } -# $1 source type: (normal|vcs) -# requires: $PWD == / +# Update PKGBUILD and .SRCINFO +# +# requires: $lang, $ext, $type, $ver, $convver to be set; +# $PWD == // +# function update { - src_type=$1 - echo "Updating ${lang}${ext} (${pkgver} -> ${convver})..." lang_a="${long[${lang%-*}]}" lang_b="${long[${lang#*-}]}" - input ../sample.PKGBUILD + input "${script_dir}/${type}/sample.PKGBUILD" replace '%LANG%' "$lang" replace '%LANG_A%' "$lang_a" @@ -141,11 +150,15 @@ function update } +# Check for updates for src / bin packages and optionally update them. +# # $1 type: (src|bin) # $2 suffix: (|-bin) # $3 platform: (src|dictd) # ${@:4} args: $@ +# # requires: $PWD == +# function handle_all { type="$1" @@ -153,7 +166,7 @@ function handle_all platform="$3" shift 3 - curl -sO https://freedict.org/freedict-database.json + curl -sO https://freedict.org/freedict-database.json || exit 1 cd "$type" || exit 1 @@ -195,10 +208,14 @@ function handle_all } +# Check for updates for VCS (svn) packages and optionally update them. +# # $1 type: (svn) # $2 suffix: (-svn) # ${@:3} args: $@ +# # requires: $PWD == +# function handle_all_vcs { type="$1" -- cgit v1.2.3