www-el-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[www-el-commits] www-el/__make__ obsolete-remove comp-format fun...


From: Georgios Zarkadas
Subject: [www-el-commits] www-el/__make__ obsolete-remove comp-format fun...
Date: Sun, 03 May 2015 19:42:59 +0000

CVSROOT:        /cvsroot/www-el
Module name:    www-el
Changes by:     Georgios Zarkadas <gzarkadas>   15/05/03 19:42:59

Modified files:
        __make__       : obsolete-remove 
Added files:
        __make__       : comp-format functions.sh 

Log message:
        switched to common library

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/www-el/__make__/obsolete-remove?cvsroot=www-el&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/www-el/__make__/comp-format?cvsroot=www-el&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/www-el/__make__/functions.sh?cvsroot=www-el&rev=1.1

Patches:
Index: obsolete-remove
===================================================================
RCS file: /cvsroot/www-el/www-el/__make__/obsolete-remove,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- obsolete-remove     24 Apr 2015 13:30:52 -0000      1.2
+++ obsolete-remove     3 May 2015 19:42:59 -0000       1.3
@@ -15,14 +15,35 @@
 # with this program; if not, write to the "Free Software Foundation, Inc.,
 # 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA"
 
+#### Import Library ####
+
+LIBMAIN=$(dirname "$0")
+LIBMAIN="${LIBMAIN}/functions.sh"
+if [ ! -f "${LIBMAIN}" ]
+then
+    echo "Error: library does not exist or is not a file;" \
+      "check installation." >&2
+    exit 1
+fi
+if [ ! -r "${LIBMAIN}" ]
+then
+    echo "Error: library is not readable; check permissions," \
+      "installation." >&2
+    exit 1
+fi
+. "${LIBMAIN}"
+if [ $? -ne 0 ] 
+then
+    echo "Error at library sourcing; check installation." >&2
+    exit 2
+fi
+
 #### Variables ####
 
 PROGRAM='obsolete-remove'
 VERSION='0.1.0'
 SHORTDESC='Clean po files from obsolete translations.'
 CR_YEARS='2012, 2015'
-CR_NAME='Georgios M. Zarkadas'
-CR_MAIL='<gz at member.fsf.org>'
 
 ARGSDESC='[options] FILE1 [FILE2 [...]]
 Remove obsolete translations from FILE1 FILE2 ... optionally appending them,
@@ -42,108 +63,16 @@
 Duplicate translations are merged at the store; you can manually review them
 later. Thus, the store remains a valid po file to be used as a compendium.'
 
-LICENSE='
-License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
-This is free software: you are free to change and redistribute it.
-There is NO WARRANTY, to the extent permitted by law.'
-
-# Show help screen.
-#
-show_help ()
-{
-    cat <<- EOF
-       usage: ${PROGRAM} ${ARGSDESC}
-       ${OPTSDESC}
-       ${OPTSFOOTER}
-       Report ${PROGRAM} bugs to ${CR_MAIL}.
-       EOF
-    exit 0
-}
-
-# Show version information.
-#
-show_version ()
-{
-    cat <<- EOF
-       ${PROGRAM} ver. ${VERSION} - ${SHORTDESC}
-       Copyright (C) ${CR_YEARS} ${CR_NAME} ${CR_MAIL}.${LICENSE}
-       EOF
-    exit 0
-}
-
-# Note on error codes: getopt may return 1-4 and 5 is reserved by us for
-# internal errors in options/arguments handling. Thus calls to error inside
-# the code should start from 6.
-
-EMSG_INT_OPTION=\
-"Internal error: not recognized option"
-EMSG_INT_ARGNUM=\
-"Internal error: wrong number of arguments"
-
-EMSG_CHK_ALOS=\
-"check disk space, quotas and permissions."
-EMSG_CHK_FULL=\
-"check disk space, quotas, permissions and source file format."
-EMSG_CHK_AWKFILE=\
-"check awk install and source file format."
-EMSG_CHK_AWKFULL=\
-"check awk install, disk space, quotas, permissions and source file format."
-EMSG_CHK_STRFULL=\
-"check disk space, quotas, permissions and store's file format."
-
-EMSG_STR_NOPATH=\
-'Error: wrong path of store file, or intermediate directories do not exist;
-check the path and create missing directories.'
-EMSG_STR_ISADIR=\
-'Error: the specified store exists and is a directory; please use a regular
-file for this option.'
-EMSG_STR_NOFILE=\
-"Error: only regular files are allowed to be used as stores."
-EMSG_STR_UNREAD=\
-'Error: the specified store exists and is not readable; please either change
-its permissions or use another one and retry.'
-EMSG_STR_UNWRIT=\
-'Error: the specified store exists and is not writable; please either change
-its permissions or use another one and retry.'
-
-# Print an error message to stderr and exit with error code.
-# Args: #1={errcode|-}, #2,[#3,[...]]=message
-#
-error ()
-{
-    if [ "X${2}" = "X" ]
-    then
-        echo "Undocumented error; please" \
-          "file a bug report to ${CR_MAIL}." >&2
-        exit 100
-    fi
-    local errcode=${1}
-    shift
-    if [ "X${errcode}" = "X-" ]
-    then
-        errcode=1
-    fi
-    cat <<- EOF >&2
-       address@hidden
-       EOF
-    exit ${errcode}
-}
-
-# Create a temporary file or exit with an error.
-# Args: what tempfile accepts
-#
-tempfile_or_die ()
-{
-    tempfile "$@" || error 6 \
-      "Error at creating temporary file; ${EMSG_CHK_ALOS}"
-}
+#### Functions ####
 
 # Initialises a po catalog (putting the 1st entry).
 # Args: #1=catalog-to-init
 #
 init_store()
 {
-    [ $# -eq 1 ] || error 7 "${EMSG_INT_ARGNUM} to init_store"
+    [ $# -eq 1 ] \
+      || error 7 "${EMSG_INT_ARGNUM}" "\nLocation: init_store"
+
     local store="${1}"
 
     cat <<- EOF >"${store}"
@@ -171,7 +100,8 @@
 #
 append_to_store ()
 {
-    [ $# -eq 2 ] || error 7 "${EMSG_INT_ARGNUM} to append_to_store"
+    [ $# -eq 2 ] \
+      || error 7 "${EMSG_INT_ARGNUM}" "\nLocation: append_to_store"
 
     local source="${1}"
     local store="${2}"
@@ -189,34 +119,9 @@
     fi
 }
 
-QUIET=0
 STORE=''
 NEW_STORE=0
 HAVEOBS=0
-DELAYED_MSG=''
-
-# Print a message to stdout, if not in quiet mode.
-# Args: [#1,[#2,[#3,[...]]]]=message
-#
-print_msg ()
-{
-    if [ ${QUIET} -eq 0 ]
-    then
-        echo "$@"
-    fi
-}
-
-# Print the delayed message to stdout, if not in quiet mode, and reset it.
-# Args: none
-#
-print_delayed_msg ()
-{
-    if [ ${QUIET} -eq 0 ] && [ "X${DELAYED_MSG}" != "X" ]
-    then
-        echo "${DELAYED_MSG}"
-        DELAYED_MSG=''
-    fi
-}
 
 #### MAIN ####
 
@@ -241,16 +146,12 @@
         shift
         ;;
     -s|--store)
-        if ! STORE=$(realpath "${2}" 2>/dev/null)
-        then
-            error 5 "${EMSG_STR_NOPATH}"
-        fi
+        assert_path_exists "${2}"
         if [ -e "${STORE}" ]
         then
-            [ -d "${STORE}" ] && error 5 "${EMSG_STR_ISADIR}"
-            [ -f "${STORE}" ] || error 5 "${EMSG_STR_NOFILE}"
-            [ -r "${STORE}" ] || error 5 "${EMSG_STR_UNREAD}"
-            [ -w "${STORE}" ] || error 5 "${EMSG_STR_UNWRIT}"
+            assert_is_file "${2}"
+            assert_is_readable "${2}"
+            assert_is_writable "${2}"
         else
             NEW_STORE=1
         fi
@@ -269,7 +170,8 @@
         break
         ;;
     *)
-        error 5 "${EMSG_INT_OPTION} '${1}'."
+        errmsg=$(printf "${EMSG_INT_OPTION}" "${1}")
+        error 5 "${errmsg}"
         ;;
     esac
 done
@@ -284,9 +186,10 @@
 fi
 
 # Make a backup of STORE at the beggining, only if there are obsolete messages.
-# Obsolete messages are cleared and appended to STORE. If the process fails 
later
-# (for example, at the msguniq step), then new obsolete messages are preserved 
at
-# STORE or STORE~ while there is also a backup of the old file as STORE.bak.
+# Obsolete messages are cleared and appended to STORE. If the process fails
+# later (for example, at the msguniq step), then new obsolete messages are
+# preserved at STORE or STORE~ while there is also a backup of the old file as
+# STORE.bak.
 
 for file in "$@"
 do

Index: comp-format
===================================================================
RCS file: comp-format
diff -N comp-format
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ comp-format 3 May 2015 19:42:58 -0000       1.1
@@ -0,0 +1,215 @@
+#!/bin/sh
+
+# Format translations, optionally replacing messages from compendia.
+# Copyright (C) 2015 Georgios M. Zarkadas <address@hidden>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 3 of the License, or (at your option)
+# any later version.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the "Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA"
+
+#### Import Library ####
+
+LIBMAIN=$(dirname "$0")
+LIBMAIN="${LIBMAIN}/functions.sh"
+if [ ! -f "${LIBMAIN}" ]
+then
+    echo "Error: library does not exist or is not a file;" \
+      "check installation." >&2
+    exit 1
+fi
+if [ ! -r "${LIBMAIN}" ]
+then
+    echo "Error: library is not readable; check permissions," \
+      "installation." >&2
+    exit 1
+fi
+. "${LIBMAIN}"
+if [ $? -ne 0 ] 
+then
+    echo "Error at library sourcing; check installation." >&2
+    exit 2
+fi
+
+#### Variables ####
+
+PROGRAM='comp-format'
+VERSION='0.1.0'
+SHORTDESC='Format translations, optionally replacing messages from compendia.'
+CR_YEARS='2015'
+
+ARGSDESC='[options] FILE1 [FILE2 [...]]
+Format translations FILE1 FILE2 [...] optionally replacing messages with those
+of the compendia supplied as options.'
+
+# always keep the 1st line empty in the strings below
+
+OPTSDESC='
+  -C, --compendium=FILE   additional library of message translations,
+                          may be specified more than once
+  -q, --quiet             suppress informative output to the basics 
+      --help              display this help screen and exit
+      --version           output version information and exit'
+
+OPTSFOOTER='
+Compendia are applied with the same order they are provided in the command
+line; the first occurence of a message has precedence.'
+
+
+#### MAIN ####
+
+CMDLINE=$(getopt \
+  -o 'C:q' \
+  -l 'compendium:,quiet' \
+  -l help,version -n "${PROGRAM}" -- "$@")
+ERRCODE=$?
+if [ ${ERRCODE} -ne 0 ]
+then
+    exit ${ERRCODE}
+fi
+eval set -- "${CMDLINE}"
+
+# process options
+
+COMPENDIA=''
+
+while true
+do
+    case ${1} in
+    -C|--compendium)
+        assert_is_existent "${2}"
+        assert_is_file "${2}"
+        assert_is_readable "${2}"
+        # must escape special characters, else expansion inside
+        # the processing loop will result in error
+        COMP=$(echo "${2}" | sed 's/[][(){} &!?;]/\\&/g')
+        COMPENDIA="${COMPENDIA} ${COMP}"
+        shift 2
+        ;;
+    -q|--quiet)
+        QUIET=1
+        shift
+        ;;
+    --help)
+        show_help
+        shift
+        ;;
+    --version)
+        show_version
+        shift
+        ;;
+    --)
+        shift
+        break
+        ;;
+    *)
+        errmsg=$(printf "${EMSG_INT_OPTION}" "${1}")
+        error 5 "${errmsg}"
+        ;;
+    esac
+done
+
+# process arguments
+
+print_msg "Formating translations..."
+
+if [ "X${COMPENDIA}" = "X" ]
+then
+    for file in "$@"
+    do
+        mlen=$(grep -vE '^[[:space:]]*#' "${file}" | wc --max-line-length)
+        if [ ${mlen} -le 80 ]
+        then
+            continue
+        fi
+        tmpfile=$(tempfile_or_die)
+        if ! msgcat --output-file="${tmpfile}" "${file}"
+        then
+            rm --force "${tmpfile}"
+            error 14 \
+              "Error at msgcat-ing '${file}'; check format of translation." 
+        fi
+        if ! mv --backup "${tmpfile}" "${file}"
+        then
+            rm --force "${tmpfile}"
+            error 11 \
+              "Error at replacing '${file}' with its formatted version;" \
+              "${EMSG_CHK_ALOS}"
+        fi
+        print_msg "  ${file}"
+    done
+else
+    # In order to preserve the translation's header and the relative ordering
+    # of the messages inside the translation we need to convolute the process
+    # a bit: (a) isolate the header, (b) make an untranslated copy (c) call:
+    # msgcat --use-first <header> <empty> <compendia> <original>
+    # As a final step we call:  msgcomm <processed> <original> , in order to
+    # remove extraneous messages from the compendia that do not exist in the
+    # original.
+
+    for file in "$@"
+    do
+        headerfile=$(tempfile_or_die)
+        if ! awk '
+          BEGIN {
+            RS="";FS="\n";ORS="\n\n";OFS=FS
+          }
+          NR==1 {
+            print
+          }' <"${file}" >"${headerfile}"
+        then
+            rm --force "${headerfile}"
+            error 12 \
+              "Error at extracting header of '${file}'; ${EMSG_CHK_AWKFULL}"
+        fi
+        emptyfile=$(tempfile_or_die)
+        if ! msgfilter --input="${file}" \
+          --output-file="${emptyfile}" sed -z 's/^.*$//'
+        then
+            rm --force "${headerfile}" "${emptyfile}"
+            error 13 \
+              "Error at msgfilter-ing '${file}'; check format" \
+              "of translation."
+        fi
+        tmpfile=$(tempfile_or_die)
+
+        # The emptyfile header will result in a warning; discard &2.
+
+        if ! msgcat --use-first --output-file="${tmpfile}" \
+          "${headerfile}" "${emptyfile}" ${COMPENDIA} "${file}" 2>/dev/null
+        then
+            rm --force "${headerfile}" "${emptyfile}" "${tmpfile}"
+            error 14 \
+              "Error at msgcat-ing '${file}'; check format of translation" \
+              "and compendia."
+        fi
+        rm --force "${headerfile}"
+
+        # Reuse emptyfile; processed file must be first,
+        # else changes to comments will be discarded.
+
+        if ! msgcomm --output-file="${emptyfile}" "${tmpfile}" "${file}"
+        then
+            rm --force "${emptyfile}" "${tmpfile}"
+            error 13 \
+              "Error at msgcomm-ing '${file}' ; check format" \
+              "of translation."
+        fi
+        rm --force "${tmpfile}"
+        if ! mv --backup "${emptyfile}" "${file}"
+        then
+            rm --force "${emptyfile}"
+            error 11 \
+              "Error at replacing '${file}' with its formatted version;" \
+              "${EMSG_CHK_ALOS}"
+        fi
+        print_msg "  ${file}"
+    done
+fi

Index: functions.sh
===================================================================
RCS file: functions.sh
diff -N functions.sh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ functions.sh        3 May 2015 19:42:58 -0000       1.1
@@ -0,0 +1,250 @@
+# Library for GNUN makefile related programs.
+# Copyright (C) 2012, 2015 Georgios M. Zarkadas <address@hidden>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 3 of the License, or (at your option)
+# any later version.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the "Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA"
+
+#### Variables ####
+
+# Identity, description & copyright related; used in --help --version
+
+PROGRAM=''
+VERSION=''
+SHORTDESC=''
+CR_YEARS=''
+CR_NAME='Georgios M. Zarkadas'
+CR_MAIL='<gz at member.fsf.org>'
+
+ARGSDESC=''
+OPTSDESC=''
+OPTSFOOTER=''
+LICENSE='
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.'
+
+# Error messages
+
+EMSG_INT_BUGRPT="please file a bug report to ${CR_MAIL}."
+EMSG_INT_ASSERT="Assertion with empty test; ${EMSG_INT_BUGRPT}"
+EMSG_INT_ERROR="Error with empty message; ${EMSG_INT_BUGRPT}"
+EMSG_INT_WARNING="Warning with empty message; ${EMSG_INT_BUGRPT}"
+EMSG_INT_OPTION=\
+"Internal error: '%s' is not recognized as an option; ${EMSG_INT_BUGRPT}"
+EMSG_INT_ARGNUM=\
+"Internal error: wrong number of arguments; ${EMSG_INT_BUGRPT}"
+
+EMSG_CHK_ALOS="check disk space, quotas and permissions."
+EMSG_CHK_FULL=\
+"check disk space, quotas, permissions and source file format."
+EMSG_CHK_AWKFILE="check awk install and source file format."
+EMSG_CHK_AWKFULL=\
+"check awk install, disk space, quotas, permissions and source file format."
+EMSG_CHK_STRFULL=\
+"check disk space, quotas, permissions and store's file format."
+
+EMSG_FSO_NOPATH="Error: '%s' path does not exist."
+EMSG_FSO_MISSED="Error: '%s' does not exist."
+EMSG_FSO_ISADIR="Error: '%s' is a directory; please use a regular file."
+EMSG_FSO_NOTDIR="Error: '%s' is not a directory; please use a directory."
+EMSG_FSO_NOFILE="Error: '%s' is not a file; please use a regular file."
+EMSG_FSO_UNREAD="Error: '%s' is not readable; check permissions."
+EMSG_FSO_UNWRIT="Error: '%s' is not writable; check permissions."
+
+QUIET=0
+DELAYED_MSG=''
+
+#### Functions ####
+
+# Show help screen.
+#
+show_help ()
+{
+    cat <<- EOF
+       usage: ${PROGRAM} ${ARGSDESC}
+       ${OPTSDESC}
+       ${OPTSFOOTER}
+       Report ${PROGRAM} bugs to ${CR_MAIL}.
+       EOF
+    exit 0
+}
+
+# Show version information.
+#
+show_version ()
+{
+    cat <<- EOF
+       ${PROGRAM} ver. ${VERSION} - ${SHORTDESC}
+       Copyright (C) ${CR_YEARS} ${CR_NAME} ${CR_MAIL}.${LICENSE}
+       EOF
+    exit 0
+}
+
+# Print an error message to stderr and exit with error code.
+# Args: #1={errcode|-}, #2,[#3,[...]]=message
+#
+error ()
+{
+    if [ $# -lt 2 ]
+    then
+        echo "${EMSG_INT_ERROR}" >&2
+        exit 100
+    fi
+    local errcode=${1}
+    shift
+    if [ "X${errcode}" = "X-" ]
+    then
+        errcode=1
+    fi
+    echo "$@"
+    exit ${errcode}
+}
+
+# Print a warning message to stderr.
+# Args: #1,[#2,[...]]=message
+#
+warn ()
+{
+    if [ $# -eq 0 ]
+    then
+        echo "${EMSG_INT_WARNING}" >&2
+    else
+        echo "$@" >&2
+    fi
+}
+
+# Create a temporary file or exit with an error.
+# Args: what tempfile accepts
+#
+tempfile_or_die ()
+{
+    tempfile "$@" || error 6 \
+      "Error at creating temporary file; ${EMSG_CHK_ALOS}"
+}
+
+# Print a message to stdout, if not in quiet mode.
+# Args: [#1,[#2,[#3,[...]]]]=message
+#
+print_msg ()
+{
+    if [ ${QUIET} -eq 0 ]
+    then
+        echo "$@"
+    fi
+}
+
+# Print the delayed message to stdout, if not in quiet mode, and reset it.
+# Args: none
+#
+print_delayed_msg ()
+{
+    if [ ${QUIET} -eq 0 ] && [ "X${DELAYED_MSG}" != "X" ]
+    then
+        echo "${DELAYED_MSG}"
+        DELAYED_MSG=''
+    fi
+}
+
+# The following functions check for the specified condition and exit with
+# error if the condition is not met.
+# Args: #1=file object
+
+assert_path_exists () # basename is not checked; only the dirname
+{
+    if [ $# -eq 0 ] || [ "X${1}" = "X" ] || [ "X${1}" = "X*" ]
+    then
+        error 100 "${EMSG_INT_ASSERT}"
+    fi
+    if ! realpath "${1}" >/dev/null 2>&1
+    then
+        local errmsg=$(printf "${EMSG_FSO_NOPATH}" "${1}")
+        error 5 "${errmsg}"
+    fi
+}
+
+assert_is_existent ()
+{
+    if [ $# -eq 0 ] || [ "X${1}" = "X" ] || [ "X${1}" = "X*" ]
+    then
+        error 100 "${EMSG_INT_ASSERT}"
+    fi
+    if [ ! -e "${1}" ]
+    then
+        local errmsg=$(printf "${EMSG_FSO_MISSED}" "${1}")
+        error 5 "${errmsg}"
+    fi
+}
+
+assert_is_notadir ()
+{
+    if [ $# -eq 0 ] || [ "X${1}" = "X" ] || [ "X${1}" = "X*" ]
+    then
+        error 100 "${EMSG_INT_ASSERT}"
+    fi
+    if [ -d "${1}" ]
+    then
+        local errmsg=$(printf "${EMSG_FSO_ISADIR}" "${1}")
+        error 5 "${errmsg}"
+    fi
+}
+
+assert_is_directory ()
+{
+    if [ $# -eq 0 ] || [ "X${1}" = "X" ] || [ "X${1}" = "X*" ]
+    then
+        error 100 "${EMSG_INT_ASSERT}"
+    fi
+    if [ ! -d "${1}" ]
+    then
+        local errmsg=$(printf "${EMSG_FSO_NOTDIR}" "${1}")
+        error 5 "${errmsg}"
+    fi
+}
+
+assert_is_file ()
+{
+    if [ $# -eq 0 ] || [ "X${1}" = "X" ] || [ "X${1}" = "X*" ]
+    then
+        error 100 "${EMSG_INT_ASSERT}"
+    fi
+    if [ ! -f "${1}" ]
+    then
+        local errmsg=$(printf "${EMSG_FSO_NOFILE}" "${1}")
+        error 5 "${errmsg}"
+    fi
+}
+
+assert_is_readable ()
+{
+    if [ $# -eq 0 ] || [ "X${1}" = "X" ] || [ "X${1}" = "X*" ]
+    then
+        error 100 "${EMSG_INT_ASSERT}"
+    fi
+    if [ ! -r "${1}" ]
+    then
+        local errmsg=$(printf "${EMSG_FSO_UNREAD}" "${1}")
+        error 5 "${errmsg}"
+    fi
+}
+
+assert_is_writeable ()
+{
+    if [ $# -eq 0 ] || [ "X${1}" = "X" ] || [ "X${1}" = "X*" ]
+    then
+        error 100 "${EMSG_INT_ASSERT}"
+    fi
+    if [ ! -r "${1}" ]
+    then
+        local errmsg=$(printf "${EMSG_FSO_UNWRIT}" "${1}")
+        error 5 "${errmsg}"
+    fi
+}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]