Hello community,
here is the log from the commit of package enscript for openSUSE:Factory
checked in at Fri Feb 27 16:12:10 CET 2009.
--------
--- enscript/enscript.changes 2009-02-26 16:09:19.000000000 +0100
+++ /mounts/work_src_done/STABLE/enscript/enscript.changes 2009-02-27 13:12:44.512001593 +0100
@@ -1,0 +2,5 @@
+Fri Feb 27 13:12:12 CET 2009 - werner@suse.de
+
+- Make sure that titles including white spaces will be printed
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ enscript.spec ++++++
--- /var/tmp/diff_new_pack.i18845/_old 2009-02-27 16:11:59.000000000 +0100
+++ /var/tmp/diff_new_pack.i18845/_new 2009-02-27 16:11:59.000000000 +0100
@@ -26,7 +26,7 @@
PreReq: %install_info_prereq
AutoReqProv: on
Version: 1.6.4
-Release: 154
+Release: 155
Summary: An ASCII to PostScript(tm) Converter
Source: enscript-%{version}.tar.bz2
Source1: enscript-gs-font.map
@@ -123,6 +123,8 @@
%doc %{_infodir}/%{name}.info.gz
%changelog
+* Fri Feb 27 2009 werner@suse.de
+- Make sure that titles including white spaces will be printed
* Thu Feb 26 2009 werner@suse.de
- Do not add empty strings to long options without argument e.g.
--color (bnc#478464)
++++++ enscript.sh ++++++
--- /var/tmp/diff_new_pack.i18845/_old 2009-02-27 16:11:59.000000000 +0100
+++ /var/tmp/diff_new_pack.i18845/_new 2009-02-27 16:11:59.000000000 +0100
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# enscript.sh: Simple workaround for getting enscript handling
+# enscript.sh: Workaround for getting enscript handling
# UTF-8 partly. Partly means that iconv is
# used to get the UTF-8 encoding into the
# natural laint encoding of the base language
@@ -9,13 +9,21 @@
# Author: Werner Fink
#
+declare -i err cnt opt isf
+declare -a CMDLINE FILES
+
+unset ${!LC_*}
ENC=$(LANG=${LANG%.*}; locale charmap 2> /dev/null)
test "$ENC" = "ISO-8859-1" && ENC=ISO-8859-15
test "${LANG%.*}" = "en_US" && ENC=ISO-8859-1
-case "${ENC%-*}" in
- ISO-8859|KOI8) ;;
- *) exec -a enscript enscript.bin -X $ENC ${1+"$@"}
+case "$@" in
+*-X[[:blank:]]UTF-8*|*--encoding=UTF-8*) ;;
+*) case "${ENC%-*}" in
+ ISO-8859|KOI8) ;;
+ *) exec -a enscript enscript.bin -X $ENC ${1+"$@"} ;;
+ esac
+ ;;
esac
#
@@ -43,55 +51,71 @@
# We need the file names provided on the command line
# or the information if we read from stdin.
#
-CMDLINE=$(getopt -u -o $SHORT -l $LONG -s bash -q -- "$@")
-if test $? -ne 0 ; then
+# Why sed? Just to get the `=' back instead of ` ' the empty space
+# which are inserted by getopt(1) and also the empty space on the
+# short options -C, -e, -E, -H, and -u.
+#
+OIFS="$IFS"; IFS=$'\n'
+CMDLINE=($(getopt -o $SHORT -l $LONG -s bash -q -- "$@" | \
+ LC_ALL=POSIX sed -r '
+ s|--([a-z-]+) ?([^-])|--\1=\2|g
+ s|-([CeEHu]) ?([^-])|-\1\2|g
+ s|=([[:space:]]+)|\1|g
+ s|-X[[:blank:]]*[[:punct:]]UTF-8[[:punct:]]||g
+ s|[[:punct:]]-[[:punct:]]|-|g
+ s|--[[:blank:]]|--\n|
+ s|[[:blank:]]-|\n-|g
+ '
+ test ${PIPESTATUS[0]} -eq 0 || exit 1
+))
+let err=$?
+IFS="$OIFS"
+
+if test $err -ne 0 ; then
# Let enscript do the error message
exec -a enscript enscript.bin ${1+"$@"}
fi
+let isf=0
+let opt=1
+while ((opt<${#CMDLINE[@]})) ; do
+ arg="${CMDLINE[$opt]}"
+ if test $isf -ne 0 ; then
+ CMDLINE[$opt]=
+ FILES[$isf]="$arg"
+ let isf++
+ fi
+ if test "$arg" = -- ; then
+ CMDLINE[$opt]=
+ let isf++
+ fi
+ let opt++
+done
+test "${FILES[@]}" = "-" && FILES=()
+
#
-# Why sed? Just to get the `=' back instead of ` ' the empty space
-# which are inserted by getopt(1) and also the empty space on the
-# short options -C, -e, -E, -H, and -u.
+# New command line
#
-CMDLINE=$(echo "$CMDLINE" | LC_ALL=POSIX sed -r 's|--([a-z-]+) ?([^-])|--\1=\2|g')
-CMDLINE=$(echo "$CMDLINE" | LC_ALL=POSIX sed -r 's|-([CeEHu]) ?([^-])|-\1\2|g')
-CMDLINE=$(echo "$CMDLINE" | LC_ALL=POSIX sed -r 's|=([[:space:]]+)|\1|g')
+eval set -- ${CMDLINE[@]} ${FILES[@]}
#
# Just for encoding given on command line:
# allow the user to overwrite autodetection
#
-case "${CMDLINE}" in
- *-X[[:blank:]]UTF-8*|*--encoding=UTF-8*)
- CMDLINE=$(echo "$CMDLINE" | LC_ALL=POSIX sed -r 's@(-X[[:blank:]]+|--encoding=)UTF-8@@g')
- ;; # handle this below
- *-X*|*--encoding=*|*--version*|*--help*|*-V*|*--list-media*)
- exec -a enscript enscript.bin ${1+"$@"}
- ;;
- *-I*|*--filter=*)
- exec -a enscript enscript.bin ${1+"$@"}
- ;;
+case "$@" in
+*-X*|*--encoding=*|*--version*|*--help*|*-V*|*--list-media*)
+ exec -a enscript enscript.bin ${1+"$@"}
+ ;;
+*-I*|*--filter=*)
+ exec -a enscript enscript.bin ${1+"$@"}
+ ;;
esac
-#
-# To not fool the bash with eval here
-#
- FILES=$(echo "$CMDLINE" | LC_ALL=POSIX sed -r 's|.* -- ?(.*)|\1|g')
-CMDLINE=$(echo "$CMDLINE" | LC_ALL=POSIX sed -r 's|(.*) -- ?.*|\1|g')
-
-if test "$FILES" = "-" ; then
- FILES=""
-fi
-
-if test -n "$FILES" ; then
+if test ${#FILES[@]} -gt 0 ; then
#
# We have real files, maybe with spaces in their path name
#
- eval set -- "$CMDLINE" "$FILES"
exec -a enscript enscript.bin -X $ENC --filter="[[ \$(file -b %s 2>/dev/null) =~ 'UTF-8 Unicode text' ]] && iconv -c -f UTF-8 -t $ENC %s || cat %s" ${1+"$@"}
-else
- eval set -- "$CMDLINE"
fi
#
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org