Clean up output messages for translation.

Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
This commit is contained in:
Andrew Fyfe 2007-06-02 18:39:48 +01:00 committed by Dan McGee
parent 2fb2613ec1
commit 76fd85450e

View file

@ -224,9 +224,9 @@ get_downloadclient() {
# if we didn't find an agent, return an error # if we didn't find an agent, return an error
if [ -z "$agent" ]; then if [ -z "$agent" ]; then
error "$(gettext "There is no agent set up to handle %s URLs. Check makepkg.conf.")" "$proto" error "$(gettext "There is no agent set up to handle %s URLs. Check %s.")" "$proto" "$confdir/makepkg.conf"
error "$(gettext "Aborting...")" plain "$(gettext "Aborting...")"
exit 1 # $E_CONFIG_ERROR # TODO: error code exit 1 # $E_CONFIG_ERROR
fi fi
# ensure specified program is installed # ensure specified program is installed
@ -234,8 +234,8 @@ get_downloadclient() {
if [ ! -x "$program" ]; then if [ ! -x "$program" ]; then
local baseprog=$(basename $program) local baseprog=$(basename $program)
error "$(gettext "The download program %s is not installed.")" "$baseprog" error "$(gettext "The download program %s is not installed.")" "$baseprog"
error "$(gettext "Aborting...")" plain "$(gettext "Aborting...")"
exit 1 # $E_MISSING_PROGRAM # TODO: error code exit 1 # $E_MISSING_PROGRAM
fi fi
echo "$agent" echo "$agent"
@ -249,7 +249,7 @@ check_deps() {
if [ $ret -eq 1 ]; then #unresolved deps if [ $ret -eq 1 ]; then #unresolved deps
echo "$pmout" echo "$pmout"
elif [ $ret -ne 0 ]; then elif [ $ret -ne 0 ]; then
error "$(gettext "pacman returned a fatal error (%i): %s")" "$ret" "$pmout" error "$(gettext "Pacman returned a fatal error (%i): %s")" "$ret" "$pmout"
exit 1 exit 1
fi fi
} }
@ -292,7 +292,7 @@ handledeps() {
# install missing deps by building them from source. # install missing deps by building them from source.
# we look for each package name in $SRCROOT and build it. # we look for each package name in $SRCROOT and build it.
if [ "$SRCROOT" = "" ]; then if [ "$SRCROOT" = "" ]; then
error "$(gettext "Source root cannot be found - please make sure it is specified in makepkg.conf")" error "$(gettext "Source root cannot be found - please make sure it is specified in %s.")" "$confdir/makepkg.conf"
exit 1 # TODO: error code exit 1 # TODO: error code
fi fi
@ -399,13 +399,13 @@ download_sources() {
# find the client we should use for this URL # find the client we should use for this URL
local dlclient=$(get_downloadclient $netfile) || exit $? local dlclient=$(get_downloadclient $netfile) || exit $?
msg2 "$(gettext "Downloading %s")" "$file" msg2 "$(gettext "Downloading %s...")" "$file"
# fix flyspray bug #3289 # fix flyspray bug #3289
local ret=0 local ret=0
$dlclient "$netfile" || ret=$? $dlclient "$netfile" || ret=$?
if [ $ret -gt 0 ]; then if [ $ret -gt 0 ]; then
error "$(gettext "Failure while downloading %s")" "$file" error "$(gettext "Failure while downloading %s")" "$file"
msg "$(gettext "Aborting...")" plain "$(gettext "Aborting...")"
exit 1 exit 1
fi fi
@ -436,7 +436,7 @@ generate_checksums() {
esac esac
if [ ! $(type -p "${integ}sum") ]; then if [ ! $(type -p "${integ}sum") ]; then
error "$(gettext "Cannot fin the '%s' program.")" "${integ}sum" error "$(gettext "Cannot find the '%s' program.")" "${integ}sum"
exit 1 # $E_MISSING_PROGRAM exit 1 # $E_MISSING_PROGRAM
fi fi
@ -477,13 +477,13 @@ check_checksums() {
esac esac
if [ ! $(type -p "${integ}sum") ]; then if [ ! $(type -p "${integ}sum") ]; then
error "$(gettext "Cannot find the %s program.")" "${integ}sum" error "$(gettext "Cannot find the '%s' program.")" "${integ}sum"
exit 1 # $E_MISSING_PROGRAM exit 1 # $E_MISSING_PROGRAM
fi fi
local integrity_sums=($(eval echo \${${integ}sums[@]})) local integrity_sums=($(eval echo \${${integ}sums[@]}))
if [ ${#integrity_sums[@]} -eq ${#source[@]} ]; then if [ ${#integrity_sums[@]} -eq ${#source[@]} ]; then
msg "$(gettext "Validating source files with %s")" "${integ}sums" msg "$(gettext "Validating source files with %s...")" "${integ}sums"
local errors=0 local errors=0
local idx=0 local idx=0
local file local file
@ -553,7 +553,7 @@ extract_sources() {
# unzip will return a 1 as a warning, it is not an error # unzip will return a 1 as a warning, it is not an error
if [ $unziphack -ne 1 -o $ret -ne 1 ]; then if [ $unziphack -ne 1 -o $ret -ne 1 ]; then
error "$(gettext "Failed to extract %s")" "$file" error "$(gettext "Failed to extract %s")" "$file"
msg "$(gettext "Aborting...")" plain "$(gettext "Aborting...")"
exit 1 exit 1
fi fi
fi fi
@ -624,9 +624,10 @@ run_build() {
fi fi
if [ $ret -gt 0 ]; then if [ $ret -gt 0 ]; then
error "$(gettext "Build Failed. Aborting...")" error "$(gettext "Build Failed.")"
plain "$(gettext "Aborting...")"
remove_deps remove_deps
exit 2 # $E_BUILD_FAILED # TODO: error code exit 2 # $E_BUILD_FAILED
fi fi
} }
@ -641,7 +642,7 @@ tidy_install() {
fi fi
if [ -d usr/share/man ]; then if [ -d usr/share/man ]; then
msg2 "$(gettext "Moving usr/share/man files to usr/man")" msg2 "$(gettext "Moving usr/share/man files to usr/man...")"
mkdir -p usr/man mkdir -p usr/man
cp -a usr/share/man/* usr/man/ cp -a usr/share/man/* usr/man/
rm -rf usr/share/man rm -rf usr/share/man
@ -666,7 +667,7 @@ tidy_install() {
if [ "$(check_option strip)" = "y" ]; then if [ "$(check_option strip)" = "y" ]; then
msg "$(gettext "Stripping debugging symbols from binaries and libraries...")" msg2 "$(gettext "Stripping debugging symbols from binaries and libraries...")"
for file in $(find {,*/}{bin,lib,sbin} -type f 2>/dev/null || true); do for file in $(find {,*/}{bin,lib,sbin} -type f 2>/dev/null || true); do
case "$(file -biz "$file")" in case "$(file -biz "$file")" in
*application/x-sharedlib*) # Libraries *application/x-sharedlib*) # Libraries
@ -690,8 +691,9 @@ tidy_install() {
create_package() { create_package() {
if [ ! -d "$pkgdir" ]; then if [ ! -d "$pkgdir" ]; then
error "$(gettext "Missing pkg/ directory, aborting...")" error "$(gettext "Missing pkg/ directory.")"
exit 1 # $E_MISSING_PKGDIR # TODO: error code plain "$(gettext "Aborting...")"
exit 1 # $E_MISSING_PKGDIR
fi fi
cd "$pkgdir" cd "$pkgdir"
@ -751,7 +753,7 @@ create_package() {
# warn if license array is not present or empty # warn if license array is not present or empty
if [ "$license" = "" ]; then if [ "$license" = "" ]; then
warning "$(gettext "Please add a license line to your %s!")" "$BUILDSCRIPT" warning "$(gettext "Please add a license line to your %s!")" "$BUILDSCRIPT"
plain "$(gettext "example for GPL'ed software: license=('GPL').")" plain "$(gettext "Example for GPL'ed software: license=('GPL').")"
fi fi
local comp_files local comp_files
@ -759,14 +761,14 @@ create_package() {
# check for an install script # check for an install script
# TODO: should we include ${pkgname}.install if it exists and $install is unset? # TODO: should we include ${pkgname}.install if it exists and $install is unset?
if [ "$install" != "" ]; then if [ "$install" != "" ]; then
msg2 "$(gettext "Copying install script...")" msg2 "$(gettext "Adding install script...")"
cp "$startdir/$install" .INSTALL cp "$startdir/$install" .INSTALL
comp_files="$comp_files .INSTALL" comp_files="$comp_files .INSTALL"
fi fi
# do we have a changelog? # do we have a changelog?
if [ -f "$startdir/ChangeLog" ]; then if [ -f "$startdir/ChangeLog" ]; then
msg2 "$(gettext "Copying package changelog")" msg2 "$(gettext "Adding package changelog...")"
cp "$startdir/ChangeLog" .CHANGELOG cp "$startdir/ChangeLog" .CHANGELOG
comp_files="$comp_files .CHANGELOG" comp_files="$comp_files .CHANGELOG"
fi fi
@ -832,11 +834,11 @@ create_srcpackage() {
cd "$startdir" cd "$startdir"
msg "$(gettext "Creating source package...")" msg "$(gettext "Creating source package...")"
local comp_files="PKGBUILD" local comp_files="PKGBUILD"
msg2 "$(gettext "Adding PKGBUILD")" msg2 "$(gettext "Adding %s...")" "PKGBUILD"
if [ "$install" != "" ]; then if [ "$install" != "" ]; then
if [ -f $install ]; then if [ -f $install ]; then
msg2 "$(gettext "Adding install script")" msg2 "$(gettext "Adding install script...")"
comp_files="$comp_files $install" comp_files="$comp_files $install"
else else
error "$(gettext "Install script %s not found.")" "$install" error "$(gettext "Install script %s not found.")" "$install"
@ -846,7 +848,7 @@ create_srcpackage() {
local i local i
for i in ${source[@]}; do for i in ${source[@]}; do
if [ -f $i ]; then if [ -f $i ]; then
msg2 "$(gettext "Adding %s")" "$i" msg2 "$(gettext "Adding %s...")" "$i"
comp_files="$comp_files $i" comp_files="$comp_files $i"
fi fi
done done
@ -928,8 +930,9 @@ _SRCDEST=${SRCDEST}
if [ -r "$confdir/makepkg.conf" ]; then if [ -r "$confdir/makepkg.conf" ]; then
source "$confdir/makepkg.conf" source "$confdir/makepkg.conf"
else else
error "$(gettext "%s not found. cannot continue")" "$confdir/makepkg.conf" error "$(gettext "%s not found.")" "$confdir/makepkg.conf"
exit 1 # $E_CONFIG_ERROR # TODO: error codes plain "$(gettext "Aborting...")"
exit 1 # $E_CONFIG_ERROR
fi fi
# Source user-specific makepkg.conf overrides # Source user-specific makepkg.conf overrides
@ -976,6 +979,12 @@ while [ "$#" -ne "0" ]; do
--repackage) REPKG=1 ;; --repackage) REPKG=1 ;;
--log) LOGGING=1 ;; --log) LOGGING=1 ;;
--source) SOURCEONLY=1 ;; --source) SOURCEONLY=1 ;;
# BEGIN DEPRECATED
--usesudo)
warning "$(gettext "Sudo is used by default now. The --usesudo option is deprecated!")" ;;
# END DEPRECATED
--help) --help)
usage usage
exit 0 #E_OK exit 0 #E_OK
@ -989,7 +998,7 @@ while [ "$#" -ne "0" ]; do
exit 1 #E_INVALID_OPTION exit 1 #E_INVALID_OPTION
;; ;;
-*) -*)
while getopts "bcCdefFghiLmop:rRsS-" opt; do while getopts "bcCdefFghiLmop:rRsSV-" opt; do
case $opt in case $opt in
b) DEP_SRC=1 ;; b) DEP_SRC=1 ;;
c) CLEANUP=1 ;; c) CLEANUP=1 ;;
@ -1007,6 +1016,11 @@ while [ "$#" -ne "0" ]; do
r) RMDEPS=1 ;; r) RMDEPS=1 ;;
R) REPKG=1 ;; R) REPKG=1 ;;
s) DEP_BIN=1 ;; s) DEP_BIN=1 ;;
# BEGIN DEPRECATED
S)
warning "$(gettext "Sudo is used by default now. The --usesudo option is deprecated!")" ;;
# END DEPRECATED
h) h)
usage usage
exit 0 #E_OK exit 0 #E_OK
@ -1082,8 +1096,8 @@ if [ "$INFAKEROOT" = "0" ]; then
exit 1 # $E_USER_ABORT exit 1 # $E_USER_ABORT
elif [ "$(check_buildenv fakeroot)" = "y" ]; then elif [ "$(check_buildenv fakeroot)" = "y" ]; then
if [ ! $(type -p fakeroot) ]; then if [ ! $(type -p fakeroot) ]; then
error "$(gettext "fakeroot must be installed if using the 'fakeroot' option")" error "$(gettext "Fakeroot must be installed if using the 'fakeroot' option")"
plain "$(gettext "in the BUILDENV array in makepkg.conf.")" plain "$(gettext "in the BUILDENV array in %s.")" "$confdir/makepkg.conf"
exit 1 exit 1
fi fi
else else
@ -1130,19 +1144,19 @@ source $BUILDSCRIPT
# check for no-no's in the build script # check for no-no's in the build script
if [ -z "$pkgver" ]; then if [ -z "$pkgver" ]; then
error "$(gettext "pkgver is not allowed to be empty.")" error "$(gettext "%s is not allowed to be empty.")" "pkgver"
exit 1 exit 1
fi fi
if [ -z "$pkgrel" ]; then if [ -z "$pkgrel" ]; then
error "$(gettext "pkgrel is not allowed to be empty.")" error "$(gettext "%s is not allowed to be empty.")" "pkgrel"
exit 1 exit 1
fi fi
if [ $(echo "$pkgver" | grep '-') ]; then if [ $(echo "$pkgver" | grep '-') ]; then
error "$(gettext "pkgver is not allowed to contain hyphens.")" error "$(gettext "%s is not allowed to contain hyphens.")" "pkgver"
exit 1 exit 1
fi fi
if [ $(echo "$pkgrel" | grep '-') ]; then if [ $(echo "$pkgrel" | grep '-') ]; then
error "$(gettext "pkgrel is not allowed to contain hyphens.")" error "$(gettext "%s is not allowed to contain hyphens.")" "pkgrel"
exit 1 exit 1
fi fi
if ! in_array $CARCH ${arch[@]}; then if ! in_array $CARCH ${arch[@]}; then
@ -1153,18 +1167,18 @@ if ! in_array $CARCH ${arch[@]}; then
fi fi
if [ "$install" -a ! -f "$install" ]; then if [ "$install" -a ! -f "$install" ]; then
error "$(gettext "install scriptlet (%s) does not exist.")" "$install" error "$(gettext "Install scriptlet (%s) does not exist.")" "$install"
exit 1 exit 1
fi fi
if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" \ if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" \
-a "$FORCE" = "0" -a "$GENINTEG" = "0" -a "$SOURCEONLY" = "0" ]; then -a "$FORCE" = "0" -a "$GENINTEG" = "0" -a "$SOURCEONLY" = "0" ]; then
if [ "$INSTALL" = "1" ]; then if [ "$INSTALL" = "1" ]; then
warning "$(gettext "a package has already been built, installing existing package.")" warning "$(gettext "A package has already been built, installing existing package...")"
install_package install_package
exit $? exit $?
else else
error "$(gettext "a package has already been built. (use -f to overwrite)")" error "$(gettext "A package has already been built. (use -f to overwrite)")"
exit 1 exit 1
fi fi
fi fi
@ -1195,7 +1209,7 @@ fi
if [ "$SOURCEONLY" = "1" ]; then if [ "$SOURCEONLY" = "1" ]; then
if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}${SRCEXT}" \ if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}${SRCEXT}" \
-a "$FORCE" = "0" ]; then -a "$FORCE" = "0" ]; then
error "$(gettext "a package has already been built. (use -f to overwrite)")" error "$(gettext "A package has already been built. (use -f to overwrite)")"
exit 1 exit 1
fi fi
create_srcpackage create_srcpackage
@ -1206,7 +1220,7 @@ fi
# fix flyspray bug #5973 # fix flyspray bug #5973
if [ "$NODEPS" = "1" -o "$GENINTEG" = "1" -o "$NOBUILD" = "1" -o "$REPKG" = "1" ]; then if [ "$NODEPS" = "1" -o "$GENINTEG" = "1" -o "$NOBUILD" = "1" -o "$REPKG" = "1" ]; then
if [ "$NODEPS" = "1" ]; then if [ "$NODEPS" = "1" ]; then
warning "$(gettext "skipping dependency checks")" warning "$(gettext "Skipping dependency checks.")"
fi fi
# skip printing a warning message for the others: geninteg, nobuild, repkg # skip printing a warning message for the others: geninteg, nobuild, repkg
elif [ $(type -p pacman) ]; then elif [ $(type -p pacman) ]; then
@ -1220,7 +1234,7 @@ elif [ $(type -p pacman) ]; then
resolve_deps ${makedepends[@]} || deperr=1 resolve_deps ${makedepends[@]} || deperr=1
if [ $deperr -eq 1 ]; then if [ $deperr -eq 1 ]; then
error "$(gettext "could not resolve all dependencies.")" error "$(gettext "Could not resolve all dependencies.")"
exit 1 exit 1
fi fi
else else