annotate lib-src/tmdecode @ 371:cc15677e0335 r21-2b1

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