1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 03_dont_crash_on_corrupt_config.dpatch by <chris@Burninator>
4
## All lines beginning with `## DP:' are a description of the patch.
8
diff -urNad specto-0.2.0~/spectlib/watch.py specto-0.2.0/spectlib/watch.py
9
--- specto-0.2.0~/spectlib/watch.py 2007-02-08 17:46:19.000000000 +1100
10
+++ specto-0.2.0/spectlib/watch.py 2007-03-19 22:15:59.000000000 +1100
12
watch_options.update(watch_options_)
14
values['name'] = name_
15
- values['type'] = int(watch_options['type'])
17
+ values['type'] = int(watch_options['type'])
19
+ ### XXX: Hack! If any of this info is incomplete, just move
20
+ ### on to the next config item rather than crashing!
22
del watch_options['type'] #delete the standard options from the dictionary with extra arguments because we allready saved them in the line above
23
- values['refresh'] = int(watch_options['refresh'])
25
+ values['refresh'] = int(watch_options['refresh'])
27
+ ### XXX: Hack, as above
29
del watch_options['refresh']
31
if int(values['type']) == 0:
32
- values['uri'] = watch_options['uri']
33
- values['error_margin'] = watch_options['error_margin']
35
+ values['uri'] = watch_options['uri']
36
+ values['error_margin'] = watch_options['error_margin']
38
+ ### XXX: Hack as above
41
elif int(values['type']) == 1:
42
- values['prot'] = watch_options['prot']
43
- if int(values['prot']) != 2:
44
- values['host'] = watch_options['host']
45
- values['ssl'] = watch_options['ssl']
46
- values['username'] = watch_options['username']
47
- values['password'] = watch_options['password']
49
+ values['prot'] = watch_options['prot']
50
+ if int(values['prot']) != 2:
51
+ values['host'] = watch_options['host']
52
+ values['ssl'] = watch_options['ssl']
53
+ values['username'] = watch_options['username']
54
+ values['password'] = watch_options['password']
56
+ ### XXX: Hack, as above
58
elif int(values['type']) == 2:
59
- values['file'] = watch_options['file']
60
- values['mode'] = watch_options['mode']
62
+ values['file'] = watch_options['file']
63
+ values['mode'] = watch_options['mode']
65
+ ### XXX: Hack, as above
68
elif int(values['type']) == 3:
69
- values['process'] = watch_options['process']
71
+ values['process'] = watch_options['process']
73
+ ###XXX: Hack, as above
77
if watch_options['updated'] == "True":