]> git.pld-linux.org Git - packages/arcavir.git/blame - arcavir-update.patch
- move lockfile to a place arcaupdate has write access
[packages/arcavir.git] / arcavir-update.patch
CommitLineData
fe42a3bb
JR
1diff -ur arcavir2010/usr/bin/arcaupdate arcavir2010-update/usr/bin/arcaupdate
2--- arcavir2010/usr/bin/arcaupdate 2010-08-09 14:20:39.000000000 +0200
3+++ arcavir2010-update/usr/bin/arcaupdate 2010-08-17 14:14:50.801594212 +0200
4@@ -1,4 +1,4 @@
5-#!/bin/bash
6+#!/bin/sh
7 #
8 # ArcaVir 2010 Server update script.
9 # Copyright (C) 2009 ArcaBit sp. z o.o.
10@@ -10,18 +10,17 @@
11
12 . /usr/share/arcavir/functions || { echo 'Cannot load /usr/share/arcavir/functions!'; exit 1; }
13
14-# if ( set -o noclobber; echo "$$" > ${lockfile} ) 2>/dev/null; then
15-# trap "${rm} -f ${lockfile}" int term exit
16+if ( set -o noclobber; echo "$$" > ${lockfile} ) 2>/dev/null; then
17+ trap "${rm} -f ${lockfile}" int term exit
18 ${get} "${repo}" || exit 1
19- [ -x /etc/init.d/arcad ] && /etc/init.d/arcad stop
20- ${propagate} "${repo}" "${dst}" || exit 1
21+ cp -rp "${repo}"/bases/* "${dst}"/var/lib/arcavir/bases/
22 [ -x ${bt} ] && \
23- ${bt} "${dst}"var/lib/arcavir/bases/ "${dst}"var/lib/arcavir/bases/abasetr_bt.dat && \
24- ${chown} arcabit:arcabit "${dst}"var/lib/arcavir/bases/abasetr_bt.dat
25- [ -x /etc/init.d/arcad ] && /etc/init.d/arcad start
26-# ${rm} -f ${lockfile}
27-#else
28-# die 'Cannot open lockfile'
29-#fi
30+ ${bt} "${dst}"var/lib/arcavir/bases/ "${dst}"var/lib/arcavir/bases/abasetr_bt.dat
31+ chown -R arcabit:arcabit "${dst}"/var/lib/arcavir/bases/
32+ /sbin/service arcad reload
33+ ${rm} -f ${lockfile}
34+else
35+ die 'Cannot open lockfile'
36+fi
37
38 exit 0
39diff -ur arcavir2010/usr/bin/arcaupdate-get arcavir2010-update/usr/bin/arcaupdate-get
40--- arcavir2010/usr/bin/arcaupdate-get 2010-08-09 14:20:39.000000000 +0200
41+++ arcavir2010-update/usr/bin/arcaupdate-get 2010-08-17 14:13:35.729594210 +0200
42@@ -18,26 +18,6 @@
43
44 cache="$@"
45
46-rawos=$(${uname} -o)
47-rawmach=$(${uname} -m)
48-
49-os=
50-mach=
51-
52-[ "${rawos}" = 'GNU/Linux' ] && os='linux'
53-# xxx more to follow
54-
55-[ "${rawmach}" = 'i386' ] && mach='i386'
56-[ "${rawmach}" = 'i486' ] && mach='i386'
57-[ "${rawmach}" = 'i586' ] && mach='i386'
58-[ "${rawmach}" = 'i686' ] && mach='i386'
59-[ "${rawmach}" = 'x86_64' ] && mach='amd64'
60-
61-[ "${os}" = '' ] && die "Unknown system ${rawos}"
62-[ "${mach}" = '' ] && die "Unknown machine ${rawmach}"
63-
64-suffix=core/${os}-${mach}
65-
66 verifybasessig()
67 {
68 isprog "${gpg}"
69@@ -60,29 +40,6 @@
70 }
71
72 ${mkdir} -p ${cache}/bases || die 'mkdir failed'
73-${rsync} --no-motd -a rsync://${rsyncpath}/${suffix}/ "${cache}" 2> /dev/null
74-if [ $? -gt 0 ]; then
75- echo 'arcaupdate-get: warning: rsync failed for core, falling back to http'
76- ${rm} -rf "${cache}/*" || die 'rm failed'
77- cd "${cache}" || die 'cd failed'
78- ${wget} --quiet -N -P "${cache}" -np -nd -r -R 'index.html*' http://${httppath}/${suffix}/ || die 'wget failed'
79- ${rm} -f "${cache}/robots.txt"
80-fi
81-
82-isprog "${gpg}"
83-if [ $? -eq 0 ]; then
84- ${gpg} --no-default-keyring --keyring /var/lib/arcavir/pubring.gpg -q --batch -d < "${cache}/files.gpg" > "${cache}/files.txt" 2>/dev/null
85- if [ $? -gt 0 ]; then
86- ${rm} -rf "${cache}/*"
87- die 'GnuPG verify failed! Someone may be tampering with your repository.'
88- fi
89-else
90- log_warn 'arcaupdate-get: warning: GnuPG not found. We STRONGLY suggest that you '
91- log_warn 'arcaupdate-get: warning: install it. Please see the apropriate section '
92- log_warn 'arcaupdate-get: warning: in README for details.'
93-fi
94-
95-# to samo dla baz
96
97 tmpfile=/tmp/arcaupdate.tmp
98
642f5a54
JR
99--- arcavir2010-update/usr/share/arcavir/functions~ 2010-08-09 14:20:39.000000000 +0200
100+++ arcavir2010-update/usr/share/arcavir/functions 2010-08-18 11:06:41.569925597 +0200
101@@ -24,7 +24,7 @@
102 # Various other variables
103 repo=/var/cache/arcavir/update
104 dst=/
105-lockfile=/var/run/arcaupdate.lock
106+lockfile=/var/cache/arcavir/update/arcaupdate.lock
107
108 rsyncpath=80.72.37.138/ArcaLinux2010
109 httppath=80.72.37.138/update/ArcaLinux2010
This page took 0.430184 seconds and 4 git commands to generate.