Import newer scripts upstream

This commit is contained in:
Pierre Pronchery 2016-02-20 02:04:46 +01:00
parent 0676585bda
commit 92da2df9d9
2 changed files with 14 additions and 7 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
#$Id$ #$Id$
#Copyright (c) 2012-2014 Pierre Pronchery <khorben@defora.org> #Copyright (c) 2012-2015 Pierre Pronchery <khorben@defora.org>
# #
#Redistribution and use in source and binary forms, with or without #Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are met: #modification, are permitted provided that the following conditions are met:
@ -42,7 +42,7 @@ XSLTPROC="xsltproc --nonet --xinclude"
#debug #debug
_debug() _debug()
{ {
echo "$@" 1>&2 echo "$@" 1>&3
"$@" "$@"
} }
@ -151,6 +151,7 @@ fi
[ -z "$DATADIR" ] && DATADIR="$PREFIX/share" [ -z "$DATADIR" ] && DATADIR="$PREFIX/share"
[ -z "$MANDIR" ] && MANDIR="$DATADIR/man" [ -z "$MANDIR" ] && MANDIR="$DATADIR/man"
exec 3>&1
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
target="$1" target="$1"
shift shift
@ -194,7 +195,11 @@ while [ $# -gt 0 ]; do
#install #install
if [ "$install" -eq 1 ]; then if [ "$install" -eq 1 ]; then
source="${target#$OBJDIR}" source="${target#$OBJDIR}"
$DEBUG $MKDIR -- "$instdir" || exit 2 dirname=
if [ "${source%/*}" != "$source" ]; then
dirname="/${source%/*}"
fi
$DEBUG $MKDIR -- "$instdir$dirname" || exit 2
$DEBUG $INSTALL "$target" "$instdir/$source" || exit 2 $DEBUG $INSTALL "$target" "$instdir/$source" || exit 2
continue continue
fi fi

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
#$Id$ #$Id$
#Copyright (c) 2010-2014 Pierre Pronchery <khorben@defora.org> #Copyright (c) 2010-2015 Pierre Pronchery <khorben@defora.org>
# #
#Redistribution and use in source and binary forms, with or without #Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are met: #modification, are permitted provided that the following conditions are met:
@ -29,6 +29,7 @@ PREFIX="/usr/local"
[ -f "../config.sh" ] && . "../config.sh" [ -f "../config.sh" ] && . "../config.sh"
LOCALEDIR="$PREFIX/share/locale" LOCALEDIR="$PREFIX/share/locale"
POTFILES="POTFILES" POTFILES="POTFILES"
PROGNAME="gettext.sh"
#executables #executables
DEBUG="_debug" DEBUG="_debug"
INSTALL="install -m 0644" INSTALL="install -m 0644"
@ -44,7 +45,7 @@ XGETTEXT="xgettext --force-po"
#debug #debug
_debug() _debug()
{ {
echo "$@" 1>&2 echo "$@" 1>&3
"$@" "$@"
} }
@ -52,7 +53,7 @@ _debug()
#error #error
_error() _error()
{ {
echo "gettext.sh: $@" 1>&2 echo "$PROGNAME: $@" 1>&2
return 2 return 2
} }
@ -60,7 +61,7 @@ _error()
#usage #usage
_usage() _usage()
{ {
echo "Usage: gettext.sh [-c|-i|-u][-P prefix] target..." 1>&2 echo "Usage: $PROGNAME [-c|-i|-u][-P prefix] target..." 1>&2
return 1 return 1
} }
@ -146,6 +147,7 @@ if [ -z "$PACKAGE" ]; then
fi fi
LOCALEDIR="$PREFIX/share/locale" LOCALEDIR="$PREFIX/share/locale"
exec 3>&1
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
target="$1" target="$1"
source="${target#$OBJDIR}" source="${target#$OBJDIR}"