Comply with the XDG Base Directory Specification

This commit is contained in:
Guido Cella
2020-05-10 07:01:31 +02:00
parent 780b7dd214
commit 3413d847c5
9 changed files with 21 additions and 26 deletions

Binary file not shown.

View File

@@ -6,7 +6,7 @@ unset SDCV_PAGER
have=`"$PATH_TO_SDCV" --data-dir /tmp/bugagaga -l | wc -l`
#do not count header
have=$(($have-1))
ndicts=`find "${HOME}"/.stardict/dic -name "*.ifo" -print | wc -l`
ndicts=`find "${XDG_DATA_HOME:-$HOME/.local/share}"/stardict/dic -name "*.ifo" -print | wc -l`
#ndicts=$(($ndicts+1))
if [ $have -ne $ndicts ]; then
ndicts=$(($ndicts-1))

View File

@@ -4,7 +4,7 @@ PATH_TO_SDCV="$1"
ndicts=`"$PATH_TO_SDCV" -l | wc -l`
ndicts=$(($ndicts-1))
ncom=`find /usr/share/stardict/dic -name "*.ifo" | wc -l`
nspe=`find "${HOME}"/.stardict/dic -name "*.ifo" | wc -l`
nspe=`find "${XDG_DATA_HOME:-$HOME/.local/share}"/stardict/dic -name "*.ifo" | wc -l`
nmy=$(($ncom+$nspe))
if [ $nmy -ne $ndicts ]; then

View File

@@ -5,8 +5,8 @@ set -e
PATH_TO_SDCV="$1"
TESTS_DIR="$2"
mkdir -p "${HOME}"/.stardict/dic
cp -R "${TESTS_DIR}/stardict-test_dict-2.4.2" "${HOME}"/.stardict/dic
mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}"/stardict/dic
cp -R "${TESTS_DIR}/stardict-test_dict-2.4.2" "${XDG_DATA_HOME:-$HOME/.local/share}"/stardict/dic
unset SDCV_PAGER
RES=`"$PATH_TO_SDCV" -n -u test_dict test | grep "test passed"`
@@ -15,6 +15,6 @@ if [ -z "$RES" ]; then
exit 1
fi
rm -fr "${HOME}"/.stardict/dic/stardict-test_dict-2.4.2
rm -fr "${XDG_DATA_HOME:-$HOME/.local/share}"/stardict/dic/stardict-test_dict-2.4.2
exit 0

View File

@@ -4,9 +4,8 @@ set -e
PATH_TO_SDCV="$1"
TESTS_DIR="$2"
mkdir -p "${HOME}"/.stardict/dic
cp -R "${TESTS_DIR}/rus-eng-stardict-2.4.2" "${HOME}"/.stardict/dic/
mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}"/stardict/dic
cp -R "${TESTS_DIR}/rus-eng-stardict-2.4.2" "${XDG_DATA_HOME:-$HOME/.local/share}"/stardict/dic/
unset SDCV_PAGER
export LANG=ru_RU.KOI8-R