lyskom-do-send 2.28 KB
Newer Older
Per Cederqvist's avatar
.  
Per Cederqvist committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh -x
# argument lyskom.el [lyskom.elc]
# Detta {r en enklare variant av lyskom-send som f|ruts{tter att man st}r
# i ett iordninggjort dir.
#
# P -- PARTS.xx {r distributionen d{r delarna {r var f|r sig
# A -- ALL.xx {r lyskom.el sharad
# adir -- lyskom.el uuencodedad.
# B -- BYTEC.xx {r lyskom.elc sharad
# udir -- lyskom.elc {r obel18 versionen av klienten med r{tt skyddskod.
# D -- DOC.xx {r klientdocumentationen sharad.
# ddir -- elisp-client-*.txt {r klientdocumentationen.
# I -- IDOC.xx {r klientdocumentationen sharad.
# idir -- elisp-client-*.txt {r klientdocumentationen.

Linus Tolke's avatar
Linus Tolke committed
16
maillist=../../lib/mailing-do-list
Per Cederqvist's avatar
.  
Per Cederqvist committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123

set -- `getopt m: $*`
if [ $1 != -- ]
then
# just sending an announcement message

	recipients=`
	while read status options
	do
		if [ X$status != XACTIVE ]
		then continue
		fi
		set -- \`getopt BCLOU: $options\`
		while [ $1 != -- ]
		do
			shift;
		done
		echo $2
	done < $maillist`

	if [ $2 = - ]
	then
		echo Recipients: $recipients
		echo Type your message. End with EOF
		messagefile=/tmp/lyskom-message
		cat > $messagefile
		temps="$messagefile $temps"
	else
		messagefile=$2
	fi
	echo Mailing message to $recipients
	Mail -s "Message on the lyskom source list" $recipients < $messagefile

	rm $temps
	exit;
fi

shift

while read status options
do
	if [ X$status != XACTIVE ]
	then continue
	fi

	
	files=
	all=
	udir=
	doc=
	idoc=

	set -- `getopt PBu:Aa:Dd:Ii: $options`
# defaults
	while [ $1 != -- ]
	do
		case $1 in
		-P) files="$files `echo PARTS.*`" ;;
	 	-B) files="$files `echo BYTEC.*`" ;;
		-u) shift;
		    udir=$1 ;;
		-A) files="$files `echo ALL.*`" ;;
		-a) shift;
		    all=$1 ;;
		-D) files="$files `echo DOC.*`" ;;
		-d) shift;
		    doc=$1;;
		-I) files="$files `echo IDOC.*`" ;;
		-i) shift;
		    idoc=$1;;
		esac
		shift
	done
	
	shift


	echo sending to $1

	for file in $files --
	do
		if [ $file != -- ] 
		then
			Mail -s $file $1 < $file ;
		fi
	done
	
	if [ X$all != X ] 
	then
		uuencode lyskom.el ${all}lyskom.el | Mail -s lyskom.el $1;
	fi
	if [ X$udir != X ] 
	then
		uuencode lyskom.elc ${udir}lyskom.elc | Mail -s lyskom.elc $1;
	fi
	if [ X$doc != X ] 
	then
		file=elisp-client-*.txt;
		uuencode $file ${doc}$file | Mail -s $file $1;
	fi
	if [ X$idoc != X ] 
	then
		file=elisp-client-*;
		uuencode $file ${idoc}$file | Mail -s $file $1;
	fi
done < $maillist