Gentoo Archives: gentoo-commits

From: "Kevin McCarthy (signals)" <signals@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-gfx/aview/files: aview-1.3.0_rc1-asciiview.patch
Date: Wed, 23 Feb 2011 17:57:08
Message-Id: 20110223175658.A335420057@flycatcher.gentoo.org
1 signals 11/02/23 17:56:58
2
3 Added: aview-1.3.0_rc1-asciiview.patch
4 Log:
5 Fix bug #293654. Add myself as maintainer.
6
7 (Portage version: 2.2.0_alpha25/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 media-gfx/aview/files/aview-1.3.0_rc1-asciiview.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/aview/files/aview-1.3.0_rc1-asciiview.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/aview/files/aview-1.3.0_rc1-asciiview.patch?rev=1.1&content-type=text/plain
14
15 Index: aview-1.3.0_rc1-asciiview.patch
16 ===================================================================
17 Support spaces in filenames (bug #39207) based on a patch from
18 kyberneticist AT yahoo DOT com with additional fixes to address bug
19 #293654 by Kevin McCarthy <signals@g.o>
20
21 Fix insecure temporary file permissions (bug #235808) based on a patch from
22 Robert Buchholz <rbu@g.o>
23
24 Fix ignored interactive keyboard commands when aview is called from the
25 asciiview script (bug #293654) by Kevin McCarthy <signals@g.o>
26
27 Rollup patch created by Kevin McCarthy <signals@g.o>
28
29 --- asciiview
30 +++ asciiview
31 @@ -3,13 +3,13 @@
32 clear()
33 {
34 kill $! 2>/dev/null
35 - rm -f /tmp/aview$$.pgm 2>/dev/null
36 + rm -rf $tmpdir 2>/dev/null
37 }
38 myconvert()
39 {
40 - if anytopnm $1 >/tmp/aview$$.pgm 2>/dev/null ; then
41 + if anytopnm "$1" >"$2" 2>/dev/null ; then
42 exit
43 - elif convert -colorspace gray $1 pgm:- 2>/dev/null ; then
44 + elif convert -colorspace gray "$1" pgm:- 2>/dev/null ; then
45 exit
46 fi
47 echo "Failed to convert file format to PNM by both convert and anytopnm" >&2
48 @@ -44,27 +44,34 @@
49 options="$options $1"
50 shift
51 ;;
52 - *)
53 - filenames="$filenames $1"
54 + *)
55 + if [ "$filenames" = "" ]
56 + then
57 + filenames=$1 #avoid leading null
58 + else
59 + filenames=$(echo -e "$filenames\n$1")
60 + fi
61 shift
62 ;;
63 esac
64 done
65 trap clear 0
66 -mkfifo /tmp/aview$$.pgm
67 -outfile=/tmp/aview$$.pgm
68 -for name in $filenames ; do
69 -if test -r $name ; then
70 -case $name in
71 +tmpdir=`mktemp -t -d`
72 +outfile=$tmpdir/aview.pgm
73 +mkfifo $outfile
74 +exec 3<&0
75 +echo "$filenames" | while read name; do
76 +if test -r "$name" ; then
77 +case "$name" in
78 *.fli | *.lfc | *.flic )
79 PATH="$PATH:."
80 - aaflip $options $name
81 + aaflip $options "$name"
82 ;;
83 *)
84 - myconvert $name >/tmp/aview$$.pgm &
85 + myconvert "$name" "$outfile" >"$outfile" &
86 pid=$!
87 PATH="$PATH:."
88 - aview $options /tmp/aview$$.pgm
89 + aview $options $outfile <&3
90 kill $pid 2>/dev/null
91 esac
92 else