diff options
author | bwarken <bwarken> | 2006-10-01 12:27:01 +0000 |
---|---|---|
committer | bwarken <bwarken> | 2006-10-01 12:27:01 +0000 |
commit | a23b279f65b440b4478057df21b86ac4ba02fb73 (patch) | |
tree | 439ce2d575053f258e8862567a6cec730f21c820 /contrib/groffer | |
parent | 7d86956528ba4e07ff99e64941c4aa61480a601f (diff) | |
download | groff-a23b279f65b440b4478057df21b86ac4ba02fb73.tar.gz |
Update groffer 0.9.28
Diffstat (limited to 'contrib/groffer')
-rw-r--r-- | contrib/groffer/ChangeLog | 25 | ||||
-rw-r--r-- | contrib/groffer/groffer.sh | 47 | ||||
-rw-r--r-- | contrib/groffer/groffer2.sh | 124 | ||||
-rw-r--r-- | contrib/groffer/version.sh | 4 |
4 files changed, 122 insertions, 78 deletions
diff --git a/contrib/groffer/ChangeLog b/contrib/groffer/ChangeLog index a3467ad5..c264d03d 100644 --- a/contrib/groffer/ChangeLog +++ b/contrib/groffer/ChangeLog @@ -1,3 +1,21 @@ +2006-10-01 Bernd Warken + ________________________________________________________________ + * release of groffer 0.9.28 + + * groffer.sh: + - Change all directories to end with `/'. + - In the state before the run of `make', make the script runnable + from each directory using $0 and `pwd'. + + * groffer2.sh: + - main_init(): Change the umask to 0077 to allow only access for + the file owner for the temporary files. This is done for security + reasons. + - version(): Put the whole output under `<<EOF'. + - usage(): Add information on filespec arguments. + - main_do_fileargs(): Rewrite the handling of filespec + parameters. Fix filespec man:name.section. + 2006-09-26 Bernd Warken ________________________________________________________________ * release of groffer 0.9.27 @@ -2038,3 +2056,10 @@ This file is part of `groffer', which is part of the `groff' project. + + + Emacs settings + + Local Variables: + mode: change-log + End: diff --git a/contrib/groffer/groffer.sh b/contrib/groffer/groffer.sh index ad5ade05..0975f5e0 100644 --- a/contrib/groffer/groffer.sh +++ b/contrib/groffer/groffer.sh @@ -9,7 +9,7 @@ # Free Software Foundation, Inc. # Written by Bernd Warken -# Last update: 14 Aug 2006 +# Last update: 1 Oct 2006 # This file is part of `groffer', which is part of `groff'. @@ -72,22 +72,50 @@ export _AT_LIBDIR_AT; export _GROFFER_LIBDIR; case "${_BEFORE_MAKE}" in yes) - _AT_BINDIR_AT='.'; + self="$0"; + case "${self}" in + /*) :; ;; + *) + curdir="$(pwd)"; + case "${curdir}" in + */) + self="${curdir}${self}"; + ;; + *) + self="${curdir}/${self}"; + ;; + esac; + ;; + esac; + groffer_shell_dir="$(dirname ${self})"; + case "${groffer_shell_dir}" in + */) :; ;; + *) groffer_shell_dir="${groffer_shell_dir}/"; + esac; _AT_G_AT=''; - _AT_LIBDIR_AT=''; - _GROFFER_LIBDIR='.'; + _AT_BINDIR_AT="${groffer_shell_dir}"; + _AT_LIBDIR_AT="${groffer_shell_dir}"; + _GROFFER_LIBDIR="${_AT_LIBDIR_AT}"; ;; no) - _AT_BINDIR_AT='@BINDIR@'; _AT_G_AT='@g@'; + _AT_BINDIR_AT='@BINDIR@'; + case "${_AT_BINDIR_AT}" in + */) :; ;; + *) _AT_BINDIR_AT="${_AT_BINDIR_AT}/"; + esac; _AT_LIBDIR_AT='@libdir@'; - _GROFFER_LIBDIR="${_AT_LIBDIR_AT}"'/groff/groffer'; + case "${_AT_LIBDIR_AT}" in + */) :; ;; + *) _AT_LIBDIR_AT="${_AT_LIBDIR_AT}/"; + esac; + _GROFFER_LIBDIR="${_AT_LIBDIR_AT}"'groff/groffer/'; ;; esac; -if test -f "${_GROFFER_LIBDIR}"/version.sh +if test -f "${_GROFFER_LIBDIR}"'version.sh' then - . "${_GROFFER_LIBDIR}"/version.sh; + . "${_GROFFER_LIBDIR}"'version.sh'; fi; export _GROFF_VERSION; @@ -101,13 +129,12 @@ no) esac; export _GROFFER2_SH; # file name of the script that follows up -_GROFFER2_SH="${_GROFFER_LIBDIR}"/groffer2.sh; +_GROFFER2_SH="${_GROFFER_LIBDIR}"'groffer2.sh'; export _GROFFER_SH; # file name of this shell script case "$0" in *groffer*) _GROFFER_SH="$0"; - # was: _GROFFER_SH="${_AT_BINDIR_AT}/groffer"; ;; *) echo 'The groffer script should be started directly.' >&2 diff --git a/contrib/groffer/groffer2.sh b/contrib/groffer/groffer2.sh index a51cddd0..86c4703e 100644 --- a/contrib/groffer/groffer2.sh +++ b/contrib/groffer/groffer2.sh @@ -12,7 +12,7 @@ # Free Software Foundation, Inc. # Written by Bernd Warken -# Last update: 26 Sep 2006 +# Last update: 1 Oct 2006 # This file is part of `groffer', which is part of `groff'. @@ -4600,11 +4600,15 @@ on-the-fly with all formats that gzip can handle. "filespec" is one of "filename" name of a readable file "-" for standard input + "man:name(n)" man page "name" in section "n" "man:name.n" man page "name" in section "n" "man:name" man page "name" in first section found + "name(n)" man page "name" in section "n" "name.n" man page "name" in section "n" + "n name" man page "name" in section "n" "name" man page "name" in first section found -and some more (see groffer(1) for details). +where `section' is a single character out of [1-9on], optionally followed +by some more letters that are called the `extension'. -h --help print this usage message. -Q --source output as roff source. @@ -4689,11 +4693,11 @@ EOF version() { func_check version = 0 "$@"; - echo1 "groffer ${_PROGRAM_VERSION} of ${_LAST_UPDATE}"; - echo1 "is part of groff version ${_GROFF_VERSION}"; y="$(echo "${_LAST_UPDATE}" | sed -e 's/^.* //')"; - echo1 "Copyright (C) $y Free Software Foundation, Inc." cat <<EOF +groffer ${_PROGRAM_VERSION} of ${_LAST_UPDATE} (shell version) +is part of groff version ${_GROFF_VERSION}. +Copyright (C) $y Free Software Foundation, Inc. GNU groff and groffer come with ABSOLUTELY NO WARRANTY. You may redistribute copies of groff and its subprograms under the terms of the GNU General Public License. @@ -5149,7 +5153,7 @@ main_init() trap_set; # create temporary directory - umask 0022; + umask 0077; _TMP_DIR=''; for d in "${GROFF_TMPDIR}" "${TMPDIR}" "${TMP}" "${TEMP}" \ "${TEMPDIR}" "${HOME}"'/tmp' '/tmp' "${HOME}" '.' @@ -6385,9 +6389,11 @@ main_do_fileargs() fi; fi; ;; - # now it must be a man page pattern esac; ### main_do_fileargs() + + # now it must be a man page pattern + if obj _MACRO_PKG is_not_empty && obj _MACRO_PKG is_not_equal '-man' then echo2 "${mdfa_filespec} is not a file, man pages are ignored "\ @@ -6411,80 +6417,64 @@ main_do_fileargs() man_setup; _FILESPEC_IS_MAN='yes'; - # check whether filespec is a man page - if obj mdfa_filespec man_is_man - then - obj mdfa_filespec man_get; - continue; - fi; - # test filespec with `man:...' or `...(...)' on man page mdfa_name=''; mdfa_section=''; mdfa_ext=''; + + mdfa_names="${mdfa_filespec}"; case "${mdfa_filespec}" in - *\(*\)) - mdfa_section="$(obj mdfa_filespec echo1 | \ - sed -e 's/^[^(]*(\(.\).*)$/\1/')"; - if list_has_not _MAN_AUTO_SEC_LIST "${mdfa_section}" - then - echo2 "${mdfa_section} in ${mdfa_filespec} is not a man page section." - continue; - fi; - mdfa_name="$(obj mdfa_filespec echo1 | \ - sed -e 's/^\([^(]*\)(.*)$/\1/')"; - if obj mdfa_name is_empty - then - echo2 "${mdfa_filespec} ${mdfa_errmsg}"; - continue; - fi; - mdfa_ext="$(obj mdfa_filespec echo1 | \ - sed -e 's/^[^(]*(.\(.*\))$/\1/')"; - if man_is_man "${mdfa_name}" "${mdfa_section}" "${mdfa_ext}" + man:*) + mdfa_names="${mdfa_names} "\ +"$(obj mdfa_filespec echo1 | sed -e 's/^man://')"; + ;; + esac; + + mdfa_continue='no'; + for i in ${mdfa_names} + do + mdfa_i=$i; + if obj mdfa_i man_is_man then - man_get "${mdfa_name}" "${mdfa_section}" "${mdfa_ext}"; - continue; + obj mdfa_i man_get; + mdfa_continue='yes'; + break; fi; -### main_do_fileargs() - case "${mdfa_name}" in - man:*) - mdfa_name="$(obj mdfa_name echo1 | sed -e 's/^man://')"; + case "${mdfa_i}" in + *\(${_MAN_AUTO_SEC_CHARS}*\)) + mdfa_section="$(obj mdfa_i echo1 | sed -e 's/^[^(]*(\(.\).*)$/\1/')"; + mdfa_name="$(obj mdfa_i echo1 | sed -e 's/^\([^(]*\)(.*)$/\1/')"; + mdfa_ext="$(obj mdfa_i echo1 | sed -e 's/^[^(]*(.\(.*\))$/\1/')"; if man_is_man "${mdfa_name}" "${mdfa_section}" "${mdfa_ext}" then man_get "${mdfa_name}" "${mdfa_section}" "${mdfa_ext}"; - continue; + mdfa_continue='yes'; + break; fi; ;; - esac; - echo2 "${mdfa_filespec} ${mdfa_errmsg}"; - continue; + *.${_MAN_AUTO_SEC_CHARS}*) + mdfa_name="$(obj mdfa_i echo1 | \ + sed -e 's/^\(.*\)\.'"${_MAN_AUTO_SEC_CHARS}"'.*$/\1/')"; + mdfa_section="$(obj mdfa_i echo1 | \ + sed -e 's/^.*\.\('"${_MAN_AUTO_SEC_CHARS}"'\).*$/\1/')"; + mdfa_ext="$(obj mdfa_i echo1 | \ + sed -e 's/^.*\.'"${_MAN_AUTO_SEC_CHARS}"'\(.*\)$/\1/')"; + if man_is_man "${mdfa_name}" "${mdfa_section}" "${mdfa_ext}" + then + man_get "${mdfa_name}" "${mdfa_section}" "${mdfa_ext}"; + mdfa_continue='yes'; + break; + fi; ;; - man:*) - mdfa_name="$(obj mdfa_filespec echo1 | sed -e 's/^man://')"; - if man_is_man "${mdfa_name}" - then - man_get "${mdfa_name}"; - continue; - fi; - echo2 "${mdfa_name} ${mdfa_errmsg}"; + esac; + done; + + if obj mdfa_continue is_yes + then continue; - ;; - *.${_MAN_AUTO_SEC_CHARS}*) - mdfa_name="$(obj mdfa_filespec echo1 | \ - sed -e 's/^\(.*\)\.'"${_MAN_AUTO_SEC_CHARS}"'.*$/\1/')"; - mdfa_section="$(obj mdfa_filespec echo1 | \ - sed -e 's/^.*\.\('"${_MAN_AUTO_SEC_CHARS}"'\).*$/\1/')"; - mdfa_ext="$(obj mdfa_filespec echo1 | \ - sed -e 's/^.*\.'"${_MAN_AUTO_SEC_CHARS}"'\(.*\)$/\1/')"; - if man_is_man "${mdfa_name}" "${mdfa_section}" "${mdfa_ext}" - then - man_get "${mdfa_name}" "${mdfa_section}" "${mdfa_ext}"; - continue; - fi; - ;; - esac; -### main_do_fileargs() + fi; +### main_do_fileargs() # check on "s name", where "s" is a section with or without an extension if is_not_empty "$1" then @@ -6522,7 +6512,9 @@ main_do_fileargs() obj _TMP_STDIN rm_file_with_debug; eval ${_UNSET} mdfa_filespec; + eval ${_UNSET} mdfa_i; eval ${_UNSET} mdfa_name; + eval ${_UNSET} mdfa_names; eval "${return_ok}"; } # main_do_fileargs() diff --git a/contrib/groffer/version.sh b/contrib/groffer/version.sh index faf64854..08f5a897 100644 --- a/contrib/groffer/version.sh +++ b/contrib/groffer/version.sh @@ -32,8 +32,8 @@ export _PROGRAM_VERSION; export _LAST_UPDATE; -_PROGRAM_VERSION='0.9.27'; -_LAST_UPDATE='26 Sep 2006'; +_PROGRAM_VERSION='0.9.28'; +_LAST_UPDATE='1 Oct 2006'; # this setting of the groff version is only used before make is run, # otherwise @VERSION@ will set it, see groffer.sh. |