File: 09-no-delete

package info (click to toggle)
syncmaildir 1.2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,104 kB
  • sloc: ansic: 6,643; sh: 1,780; makefile: 247
file content (29 lines) | stat: -rw-r--r-- 666 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh

mdiff Mail
assert $? 0 "mdiff failed"

mv db.txt.new db.txt
mv db.txt.mtime.new db.txt.mtime

ls Mail/cur | head -n 2 > mails
exec 7<mails
read MAIL1 <&7
read MAIL2 <&7
exec 7<&-

rm Mail/cur/$MAIL1
mv Mail/cur/$MAIL2 Mail/cur/foo

mdiff Mail
N=`cat log.mddiff | wc -l`
assert $N 3 "too many commands: $N"
N=`cat log.mddiff | grep ^DELETE | wc -l`
assert $N 2 "too few DELETE commands: $N"
N=`cat log.mddiff | grep ^COPY | wc -l`
assert $N 1 "not 1 COPY command: $N"
mdiff -n Mail
N=`cat log.mddiff | grep ^DELETE | wc -l`
assert $N 1 "too many DELETE commands: $N"
N=`cat log.mddiff | grep ^DELETE | grep $MAIL1 | wc -l`
assert $N 0 "deletes aven if -n"