blob: 513852a3734f0bc33ec3f11f4afee4afb016f4d0 (
plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# arg 1: the new package version
pre_install () {
echo "backing up the database"
dbver=`pacman -Q mythtv-svn | awk ' { print $2 } '`
if [ ! -e /data/databases_backup ]
then
mkdir -p /data/database_backup
fi
mysqldump -u mythtv -pmythtv mythconverg -c > /data/database_backup/${dbver}.dump.sql
}
post_install() {
mkdir -p /data/home
/usr/sbin/useradd -G users,video,audio,optical -m -d /data/home/mythtv mythtv
/usr/sbin/usermod -G users,video,audio,optical mythtv
# mkdir /var/log/mythtv
# chown -R mythtv:users /var/log/mythtv
dbver=`pacman -Q mythtv-svn | awk ' { print $2 } '`
if [ ! -e /data/database_backup ]
then
mkdir -p /data/database_backup
fi
chown mythtv:nobody /data/database_backup
chmod g+s /data/database_backup
mysqldump -u mythtv -pmythtv mythconverg -c > /data/database_backup/${dbver}.dump.sql
}
pre_upgrade () {
pre_install
}
# arg 1: the new package version
# arg 2: the old package version
post_upgrade() {
post_install
/bin/true
}
# arg 1: the old package version
pre_remove() {
/bin/true
}
# arg 1: the old package version
post_remove() {
/bint/true
}
op=$1
shift
$op $*
|