diff options
author | Ted Trask <ttrask01@yahoo.com> | 2011-04-15 17:44:29 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2011-04-15 17:44:29 +0000 |
commit | ed0aee3e414f0b0253eb353f503732b168676e65 (patch) | |
tree | 54ab9e513f56b32a99f0c35e7b015fe7c47c1119 /main/acf-provisioning | |
parent | dc4b238abb04faf222b10b5df5c0b1d101a04284 (diff) | |
download | aports-ed0aee3e414f0b0253eb353f503732b168676e65.tar.bz2 aports-ed0aee3e414f0b0253eb353f503732b168676e65.tar.xz |
main/acf-provisioning: added post-upgrade script for database changes
Diffstat (limited to 'main/acf-provisioning')
-rw-r--r-- | main/acf-provisioning/APKBUILD | 4 | ||||
-rw-r--r-- | main/acf-provisioning/acf-provisioning.post-upgrade | 23 |
2 files changed, 25 insertions, 2 deletions
diff --git a/main/acf-provisioning/APKBUILD b/main/acf-provisioning/APKBUILD index 00faf59bc6..ca84ead0b4 100644 --- a/main/acf-provisioning/APKBUILD +++ b/main/acf-provisioning/APKBUILD @@ -2,14 +2,14 @@ # Maintainer: Ted Trask <ttrask01@yahoo.com> pkgname=acf-provisioning pkgver=0.0.7 -pkgrel=0 +pkgrel=1 pkgdesc="ACF for provisioning templated configs to devices" url="http://git.alpinelinux.org/cgit/acf-provisioning" arch="noarch" license="GPL-2" depends="acf-core lua lua-sql-postgres postgresql-client lua-posixtz" makedepends="" -install="" +install="$pkgname.post-upgrade" subpackages="" source="http://git.alpinelinux.org/cgit/$pkgname.git/snapshot/$pkgname-$pkgver.tar.bz2" diff --git a/main/acf-provisioning/acf-provisioning.post-upgrade b/main/acf-provisioning/acf-provisioning.post-upgrade new file mode 100644 index 0000000000..035be21475 --- /dev/null +++ b/main/acf-provisioning/acf-provisioning.post-upgrade @@ -0,0 +1,23 @@ +#!/bin/sh + +new=$1 +old=$2 + +# if current is not older than 0.0.7-r1 we exit. +if ! [ "$(apk version -t $old 0.0.7-r1)" = "<" ]; then + exit 0 +fi + +psql -U postgres -c "INSERT INTO provisioning_classes VALUES(default, (SELECT class_group_id FROM provisioning_class_groups WHERE name='device'), 'Unsupported Phone', '999')"\ + provisioning +psql -U postgres -c "INSERT INTO provisioning_groups VALUES(default, 'reg1', 'Registration 1 Unsupported', '10')"\ + provisioning +psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Unsupported Phone'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 1 Unsupported'))"\ + provisioning +psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 1 Unsupported'), (SELECT param_id FROM provisioning_params WHERE name='extension'), null, true)"\ + provisioning +psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 1 Unsupported'), (SELECT param_id FROM provisioning_params WHERE name='password'), null, true)"\ + provisioning + +exit 0 + |