Browse Source

Make locale installation more robust

signals
Gavin Howard 3 years ago
parent
commit
d31b568d25
Signed by untrusted user who does not match committer: gavin
GPG Key ID: C08038BDF280D33E
  1. 23
      locale_install.sh

23
locale_install.sh

@ -32,6 +32,18 @@ usage() {
exit 1
}
gencatfile() {
local loc="$1"
shift
local file="$1"
shift
mkdir -p $(dirname "$loc")
gencat "$loc" "$file" > /dev/null 2>&1
}
script="$0"
scriptdir=$(dirname "$script")
@ -61,13 +73,11 @@ for file in $locales_dir/*.msg; do
continue
fi
mkdir -p $(dirname "$loc")
if [ -L "$file" ]; then
continue
fi
gencat "$loc" "$file" > /dev/null 2>&1
gencatfile "$loc" "$file"
done
@ -84,9 +94,14 @@ for file in $locales_dir/*.msg; do
mkdir -p $(dirname "$loc")
if [ -L "$file" ]; then
link=$(readlink "$file")
locale=$(basename "$link" .msg)
linksrc="$(gen_nlspath "$nlspath" "$locale" "$main_exec")"
linksrc=$(gen_nlspath "$nlspath" "$locale" "$main_exec")
if [ ! -f "$linksrc" ];
gencatfile "$linksrc" "$link"
fi
ln "$linksrc" "$loc"
fi

Loading…
Cancel
Save