From b04e6c6a5b5dac037959a2a59ab2a59e8c0c67b7 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 25 Jul 2018 22:20:19 -0400 Subject: fix locale, fix allowable error codes --- subprojects/freeamo/freeamo | 8 ++++++++ subprojects/freeamo/src/main_functions | 2 +- subprojects/freeamo/src/make-wiki | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/subprojects/freeamo/freeamo b/subprojects/freeamo/freeamo index 9ee84f3..ac4d7c7 100755 --- a/subprojects/freeamo/freeamo +++ b/subprojects/freeamo/freeamo @@ -15,6 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . + scriptsrc=$(readlink -f -- "${BASH_SOURCE[0]}") run_path=$(dirname "${scriptsrc}" || echo .) filename=$(basename "$0"); @@ -25,6 +26,13 @@ source "$run_path/freeamo.conf" source "$run_path/src/err" +# if you don't have this locale, add this to /etc/locale.gen: +# sv_SE.UTF-8 UTF-8 +# then run sudo locale-gen +# then open a new terminal. +export LC_NUMERIC=sv_SE.UTF-8 + + output_file_1="$run_path/build/index-search-pages.txt"; output_file_2="$run_path/build/index-search-pages--free-licenses.txt" diff --git a/subprojects/freeamo/src/main_functions b/subprojects/freeamo/src/main_functions index ad7c435..06ddad6 100644 --- a/subprojects/freeamo/src/main_functions +++ b/subprojects/freeamo/src/main_functions @@ -69,7 +69,7 @@ echo "####################" tmp__enGB=$(jq ".results[$entry].$locale_description" "$file" | sed "s|-||;" | jq -r .enGB ) # Use the first avalible if English is not avaliable - tmp=$(jq -r ".results[$entry].$locale_description[]" "$file" | head -n 1) + tmp=$(jq -r ".results[$entry].$locale_description[]" "$file" | head -n 1) || [[ $? == 141 ]] # jq causes superfluous 141 # David will work on this later # if [ "$tmp" == "" ]; then diff --git a/subprojects/freeamo/src/make-wiki b/subprojects/freeamo/src/make-wiki index b4de1a6..94761b4 100644 --- a/subprojects/freeamo/src/make-wiki +++ b/subprojects/freeamo/src/make-wiki @@ -115,7 +115,7 @@ while IFS= read -r table; do - github_true=$(echo "$homepage_url" | grep "github.com"); + github_true=$(echo "$homepage_url" | grep "github.com") ||: # ok if grep fails if [[ $github_true != "" ]]; then @@ -213,7 +213,7 @@ at https://addons.mozilla.org/en-US/firefox/addon/adblock-plus/ fi - echo "foo" # Must be here to work with pv + if ! $debug; then echo "foo"; fi # for pv done < "$output_file_2" # | pv__progress # End template -- cgit v1.2.3