Browse Source

Make locale symlinks work on Arch

signals
Gavin Howard 3 years ago
parent
commit
08727ac94a
Signed by untrusted user who does not match committer: gavin
GPG Key ID: C08038BDF280D33E
  1. 4
      Makefile.in
  2. 17
      locale_install.sh
  3. 11
      locale_uninstall.sh

4
Makefile.in

@ -292,7 +292,7 @@ clean_tests: clean clean_config
@$(RM) -f $(DC_HELP_GCDA) $(DC_HELP_GCNO)
install_locales:
$(LOCALE_INSTALL) $(DESTDIR)$(NLSPATH) $(MAIN_EXEC)
$(LOCALE_INSTALL) $(NLSPATH) $(MAIN_EXEC) $(DESTDIR)
install_bc_manpage:
$(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(BC_MANPAGE) $(DESTDIR)$(MAN1DIR)/$(BC_MANPAGE_NAME)
@ -304,7 +304,7 @@ install:%%INSTALL_LOCALES_PREREQS%%%%INSTALL_PREREQS%%
$(INSTALL) $(DESTDIR)$(BINDIR) "$(EXEC_SUFFIX)"
uninstall_locales:
$(LOCALE_UNINSTALL) $(DESTDIR)$(NLSPATH) $(MAIN_EXEC)
$(LOCALE_UNINSTALL) $(NLSPATH) $(MAIN_EXEC) $(DESTDIR)
uninstall_bc_manpage:
$(RM) -f $(DESTDIR)$(MAN1DIR)/$(BC_MANPAGE_NAME)

17
locale_install.sh

@ -28,7 +28,7 @@
#
usage() {
printf "usage: %s NLSPATH main_exec\n" "$0" 1>&2
printf "usage: %s NLSPATH main_exec [DESTDIR]\n" "$0" 1>&2
exit 1
}
@ -57,7 +57,14 @@ shift
main_exec="$1"
shift
"$scriptdir/locale_uninstall.sh" "$nlspath" "$main_exec"
if [ "$#" -ge 1 ]; then
destdir="$1"
shift
else
destdir=""
fi
"$scriptdir/locale_uninstall.sh" "$nlspath" "$main_exec" "$destdir"
locales_dir="$scriptdir/locales"
@ -66,7 +73,7 @@ locales=$(locale -a)
for file in $locales_dir/*.msg; do
locale=$(basename "$file" ".msg")
loc=$(gen_nlspath "$nlspath" "$locale" "$main_exec")
loc=$(gen_nlspath "$destdir/$nlspath" "$locale" "$main_exec")
if [ ! -z "${locales##*$locale*}" ]; then
continue
@ -83,7 +90,7 @@ done
for file in $locales_dir/*.msg; do
locale=$(basename "$file" ".msg")
loc=$(gen_nlspath "$nlspath" "$locale" "$main_exec")
loc=$(gen_nlspath "$destdir/$nlspath" "$locale" "$main_exec")
if [ ! -z "${locales##*$locale*}" ]; then
continue
@ -98,7 +105,7 @@ for file in $locales_dir/*.msg; do
linksrc=$(gen_nlspath "$nlspath" "$locale" "$main_exec")
if [ ! -f "$linksrc" ]; then
gencatfile "$linksrc" "$link"
gencatfile "$destdir/$linksrc" "$link"
fi
ln -s "$linksrc" "$loc"

11
locale_uninstall.sh

@ -28,7 +28,7 @@
#
usage() {
printf "usage: %s NLSPATH main_exec\n" "$0" 1>&2
printf "usage: %s NLSPATH main_exec [DESTDIR]\n" "$0" 1>&2
exit 1
}
@ -47,11 +47,18 @@ shift
main_exec="$1"
shift
if [ "$#" -ge 1 ]; then
destdir="$1"
shift
else
destdir=""
fi
# I do something clever here. I am replacing the locale spot with
# a wildcard, which should make it search all locale directories.
# This way, we can delete catalogs for locales that we had to install
# because they are symlinks.
locales=$(gen_nlspath "$nlspath" "*" "$main_exec")
locales=$(gen_nlspath "$destdir/$nlspath" "*" "$main_exec")
for l in $locales; do
rm -f "$l"

Loading…
Cancel
Save