annotate lib-src/tmdecode @ 251:677f6a0ee643 r20-5b24

Import from CVS: tag r20-5b24
author cvs
date Mon, 13 Aug 2007 10:19:59 +0200
parents 364816949b59
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1 #!/bin/sh -
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
2 #
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 80
diff changeset
3 # $Id: tmdecode,v 1.4 1997/01/30 02:22:30 steve Exp $
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
4 #
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
5 # Copyright 1994, 1995, 1996 Free Software Foundation, Inc.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
6
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
7 # This program is free software; you can redistribute it and/or modify
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
8 # it under the terms of the GNU General Public License as published by
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
9 # the Free Software Foundation; either version 2, or (at your option)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
10 # any later version.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
11 #
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
12 # This program is distributed in the hope that it will be useful,
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
15 # GNU General Public License for more details.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
16 #
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
17 # You should have received a copy of the GNU General Public License
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
18 # along with GNU Emacs; see the file COPYING. If not, write to the
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
19 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
20 # Boston, MA 02111-1307, USA.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
21
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 76
diff changeset
22 PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 76
diff changeset
23
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
24 trap 'rm -f $2' 0 1 2 3 13 15
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
25
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
26 case "$3" in
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
27 /dev/stdout)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
28 OUTPUT=
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
29 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
30 *)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
31 OUTPUT='> $3'
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
32 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
33 esac
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
34
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
35 case "$1" in
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
36 ""|"7bit"|"8bit"|"binary")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
37 eval "cat $2 $OUTPUT"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
38 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
39 "base64")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
40 #eval "decode-b < $2 $OUTPUT"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
41 eval "mmencode -u $2 $OUTPUT"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
42 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
43 "quoted-printable")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
44 eval "mmencode -q -u $2 $OUTPUT"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
45 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
46 "x-uue"|"x-uuencode")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
47 (cd $TM_TMP_DIR ; uudecode $2)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
48 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
49 "x-gzip64")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
50 #eval "decode-b < $2 | gzip -cd $OUTPUT"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
51 eval "mmencode -u $2 | gzip -cd $OUTPUT"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
52 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
53 *)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
54 echo "unknown encoding"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
55 exit -1
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
56 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
57 esac
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
58
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
59 # echo "$2 was removed."