|
|
1.1 root 1: .ce
2: How \fIinsdist\fP works
3: .sp 2
4: .BU
5: We want either completely install the distribution, or
6: completely fail to install it; we don't want the file system
7: left in an intermediate state.
8: Initial idea:
9: .CO
10: tar cf $backup $files
11: tar t $backup | sort > $oldlist
12: tar tf $tarfile | sort > $newlist
13: if tar xf $tarfile
14: then
15: comm -23 $oldlist $newlist > $remove
16: test -s $remove && xargs rm -fr < $remove
17: else
18: tar xf $backup
19: comm -13 $oldlist $newlist > $remove
20: test -s $remove && xargs rm -fr < $remove
21: fi
22: .CE
23: .BU
24: Unfortunately, line oriented text utilities don't like
25: funny file names. We can fix this with \f(CWqargs\fP and
26: \f(CWuargs\fP.
27: Revised code:
28: .CO
29: # assume $files is in qargs format
30: uargs tar cf $backup $files
31: # tarf -tq prints tarfile contents in qargs format
32: tarf -tq < $backup | sort > $oldlist
33: tarf -tq < $tarfile | sort > $newlist
34: if tar xf $tarfile
35: then
36: comm -23 $oldlist $newlist > $remove
37: test -s $remove && xargs uargs rm -fr < $remove
38: else
39: tar xf $backup
40: comm -13 $oldlist $newlist > $remove
41: test -s $remove && xargs uargs rm -fr < $remove
42: fi
43: .CE
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.