updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / smolt-client / 002-ArchLinux-patch.diff
blob8fb81b1b7ce537e6e4b9f683f9a6ad5516ab0112
1 diff --git a/smolt-1.4/client/Makefile b/smolt-1.4/client/Makefile
2 index ec47021..66a4de2 100644
3 --- a/smolt-1.4/client/Makefile
4 +++ b/smolt-1.4/client/Makefile
5 @@ -84,9 +84,9 @@ install: post-install
7 post-install: install-main
9 - mkdir -p $(ETC)/init.d/
10 + mkdir -p $(ETC)/rc.d/
11 mkdir -p $(ETC)/cron.d/
12 - cp -adv smolt-init $(ETC)/init.d/smolt
13 + cp -adv smolt-init $(ETC)/rc.d/smolt
14 cp -adv smolt.cron.monthly $(ETC)/cron.d/smolt
16 uuid:
17 diff --git a/smolt-1.4/client/os_detect.py b/smolt-1.4/client/os_detect.py
18 index 16b6fc0..2d617ab 100644
19 --- a/smolt-1.4/client/os_detect.py
20 +++ b/smolt-1.4/client/os_detect.py
21 @@ -60,6 +60,7 @@ distro_info['Blag Linux']='/etc/blag-release'
22 distro_info['MythVantage']='/etc/mythvantage-release'
23 distro_info['Knoppmyth']='/etc/KnoppMyth-version'
24 distro_info['MythDora']='/etc/mythdora-release'
25 +distro_info['KinuX Linux']='/etc/KinuX-version'
26 distro_info['Arch Linux']= '/etc/arch-release'
27 distro_info['Aurox Linux']= '/etc/aurox-release'
28 distro_info['Conectiva Linux']= '/etc/conectiva-release'
29 @@ -102,7 +103,7 @@ def get_os_info():
30 fd = open(path_to_file)
31 text = fd.read().strip()
32 fd.close()
33 - if path_to_file.endswith('KnoppMyth-version'):
34 + if path_to_file.endswith('KnoppMyth-version') or path_to_file.endswith('KinuX-version'):
35 text = text
36 elif path_to_file.endswith('version'):
37 text = distro_name + ' ' + text
38 diff --git a/smolt-1.4/client/sendProfile.py b/smolt-1.4/client/sendProfile.py
39 index ff3a0a9..e3a94b7 100644
40 --- a/smolt-1.4/client/sendProfile.py
41 +++ b/smolt-1.4/client/sendProfile.py
42 @@ -139,7 +139,7 @@ if opts.httpproxy == None:
43 else:
44 proxies = {'http':opts.httpproxy}
46 -if opts.checkin and os.path.exists('/var/lock/subsys/smolt'):
47 +if opts.checkin and os.path.exists('/var/run/daemons/smolt'):
48 # Smolt is set to run
49 opts.autoSend = True
50 elif opts.checkin:
51 diff --git a/smolt-1.4/client/smolt-init b/smolt-1.4/client/smolt-init
52 index 43fee82..c19eb48 100755
53 --- a/smolt-1.4/client/smolt-init
54 +++ b/smolt-1.4/client/smolt-init
55 @@ -5,37 +5,45 @@
56 # Author: Seth Vidal <skvidal@phy.duke.edu>
57 # Mike McGrath <mmcgrath@redhat.com>
59 +# Ported to Arch Linux: Otavio Souza <leader@kinuxlinux.org>
61 # chkconfig: - 90 01
63 # description: Enable monthly update of Smolt
64 # processname: smolt
67 +# Changelog:
68 +# * Change to etc/rc.d/functions
69 +# * Change echo to stat_done, stat_busy, stat_fail
70 +# * Change to /var/run/daemons/smolt
72 # source function library
73 -. /etc/rc.d/init.d/functions
74 +. /etc/rc.conf
75 +. /etc/rc.d/functions
77 -lockfile=/var/lock/subsys/smolt
78 +lockfile=/var/run/daemons/smolt
80 RETVAL=0
82 start() {
83 - echo -n $"Enabling monthly Smolt checkin: "
84 + stat_busy "Enabling monthly Smolt checkin: "
85 if ! [ -f /etc/smolt/hw-uuid ]
86 then
87 echo
88 - echo "Generating UUID"
89 + stat_busy "Generating UUID"
90 /bin/cat /proc/sys/kernel/random/uuid > /etc/smolt/hw-uuid
91 /bin/chmod 0644 /etc/smolt/hw-uuid
92 /bin/chown root:root /etc/smolt/hw-uuid
94 - touch "$lockfile" && success || failure
95 + touch "$lockfile" && stat_done || stat_fail
96 RETVAL=$?
97 - echo
98 + stat_done
101 stop() {
102 - echo -n $"Disabling monthly Smolt update: "
103 - /bin/rm "$lockfile" 2> /dev/null && success || failure
104 + stat_busy "Disabling monthly Smolt update: "
105 + /bin/rm "$lockfile" 2> /dev/null && stat_done || stat_fail
106 RETVAL=$?
107 echo
109 @@ -62,15 +70,15 @@ case "$1" in
111 status)
112 if [ -f $lockfile ]; then
113 - echo $"Monthly smolt check-in is enabled."
114 + echo "Monthly smolt check-in is enabled."
115 RETVAL=0
116 else
117 - echo $"Monthly smolt check-in is disabled."
118 + echo "Monthly smolt check-in is disabled."
119 RETVAL=3
123 - echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
124 + echo "Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
125 exit 1
126 esac