From 81834071c7e1479d6612eb686043bb0d534e08fb Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Thu, 19 Nov 2020 03:15:12 +0100 Subject: [PATCH] Import the newer scripts from DeforaOS configure --- po/gettext.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/po/gettext.sh b/po/gettext.sh index 5bb7c9b..d1b91a2 100755 --- a/po/gettext.sh +++ b/po/gettext.sh @@ -1,6 +1,6 @@ #!/bin/sh #$Id$ -#Copyright (c) 2010-2015 Pierre Pronchery +#Copyright (c) 2010-2020 Pierre Pronchery # #Redistribution and use in source and binary forms, with or without #modification, are permitted provided that the following conditions are met: @@ -25,8 +25,8 @@ #variables +CONFIGSH="${0%/gettext.sh}/../config.sh" PREFIX="/usr/local" -[ -f "../config.sh" ] && . "../config.sh" LOCALEDIR="$PREFIX/share/locale" POTFILES="POTFILES" PROGNAME="gettext.sh" @@ -40,6 +40,8 @@ MSGMERGE="msgmerge" RM="rm -f" XGETTEXT="xgettext --force-po" +[ -f "$CONFIGSH" ] && . "$CONFIGSH" + #functions #debug @@ -112,7 +114,7 @@ _gettext_pot() clean=0 install=0 uninstall=0 -while getopts "ciuP:" name; do +while getopts "ciO:uP:" name; do case "$name" in c) clean=1 @@ -121,6 +123,9 @@ while getopts "ciuP:" name; do uninstall=0 install=1 ;; + O) + export "${OPTARG%%=*}"="${OPTARG#*=}" + ;; u) install=0 uninstall=1 @@ -135,7 +140,7 @@ while getopts "ciuP:" name; do esac done shift $(($OPTIND - 1)) -if [ $# -eq 0 ]; then +if [ $# -lt 1 ]; then _usage exit $? fi