Skip to content

Commit c71e4df

Browse files
committed
sqlite fix
1 parent 4b46d82 commit c71e4df

10 files changed

+114
-104
lines changed

debian/cnb-cache-mysql.config

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
11
#!/bin/sh
22

33
set -e
4+
#set -x
45

56
. /usr/share/debconf/confmodule
6-
7-
db_version 2.0
8-
9-
db_title Reconfigure webserever
10-
db_input high cnb-cache/reconfigure-webserver || true
11-
12-
db_go || true
13-
db_stop
14-
15-
if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
16-
# source dbconfig-common stuff
17-
. /usr/share/dbconfig-common/dpkg/config
18-
19-
if [ -f /usr/share/dbconfig-common/dpkg/config.mysql ]; then
20-
. /usr/share/dbconfig-common/dpkg/config.mysql
21-
dbc_go cnb-cache "$@"
22-
fi
7+
if [ -f /usr/share/dbconfig-common/dpkg/frontend.config.mysql ]; then
8+
. /usr/share/dbconfig-common/dpkg/frontend.config.mysql
9+
dbc_go cnb-cache-mysql "$@"
2310
fi

debian/cnb-cache-mysql.postinst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,12 @@ set -x
77

88
db_version 2.0
99

10-
11-
12-
13-
1410
case "$1" in
1511
configure)
1612

1713

18-
if [ -f /usr/share/dbconfig-common/dpkg/postinst ]; then
19-
. /usr/share/dbconfig-common/dpkg/postinst
14+
if [ -f /usr/share/dbconfig-common/dpkg/postinst.mysql ]; then
15+
. /usr/share/dbconfig-common/dpkg/postinst.mysql
2016
# shellcheck disable=SC2034
2117
dbc_generate_include_args="-U -o template_infile=/usr/lib/cnb-cache/.env.template"
2218
# shellcheck disable=SC2034

debian/cnb-cache-mysql.prerm

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
set -e
3+
4+
case "$1" in
5+
remove | upgrade | deconfigure)
6+
7+
. /usr/share/debconf/confmodule
8+
. /usr/share/dbconfig-common/dpkg/prerm.mysql
9+
dbc_go dnb-cache-mysql "$@"
10+
11+
;;
12+
13+
failed-upgrade) ;;
14+
15+
*)
16+
echo "prerm called with unknown argument \`$1'" >&2
17+
exit 1
18+
;;
19+
esac
20+
21+
#DEBHELPER#
22+
23+
exit 0

debian/cnb-cache-sqlite.config

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,11 @@
11
#!/bin/sh
22

33
set -e
4+
#set -x
45

56
. /usr/share/debconf/confmodule
6-
7-
db_version 2.0
8-
9-
db_title Reconfigure webserever
10-
db_input high cnb-cache/reconfigure-webserver || true
11-
12-
db_go || true
13-
db_stop
14-
15-
if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
16-
# source dbconfig-common stuff
17-
. /usr/share/dbconfig-common/dpkg/config
18-
19-
if [ -f /usr/share/dbconfig-common/dpkg/config.sqlite3 ]; then
20-
. /usr/share/dbconfig-common/dpkg/config.sqlite3
21-
dbc_go cnb-cache "$@"
22-
fi
7+
if [ -f /usr/share/dbconfig-common/dpkg/frontend.config.sqlite3 ]; then
8+
. /usr/share/dbconfig-common/dpkg/frontend.config.sqlite3
9+
dbc_go cnb-cache-sqlite "$@"
2310
fi
11+

debian/cnb-cache-sqlite.postinst

Lines changed: 37 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,66 +2,56 @@
22
set -e
33
set -x
44

5-
65
. /usr/share/debconf/confmodule
76

87
db_version 2.0
98

10-
11-
12-
13-
149
case "$1" in
15-
configure)
16-
17-
18-
if [ -f /usr/share/dbconfig-common/dpkg/postinst ]; then
19-
. /usr/share/dbconfig-common/dpkg/postinst
20-
# shellcheck disable=SC2034
21-
dbc_generate_include_args="-U -o template_infile=/usr/lib/cnb-cache/.env.template"
22-
# shellcheck disable=SC2034
23-
dbc_generate_include=template:/etc/cnb-cache/cnb-cache.env
24-
# shellcheck disable=SC2034
25-
dbc_generate_include_owner="root:www-data"
26-
# shellcheck disable=SC2034
27-
dbc_generate_include_perms="664"
28-
# shellcheck disable=SC2034
29-
dbc_dbfile_owner="www-data:www-data"
30-
# shellcheck disable=SC2034
31-
dbc_dbfile_perms="0664"
32-
# shellcheck disable=SC2034
33-
dbc_dbuser=cnb-cache
34-
# shellcheck disable=SC2034
35-
dbc_dbname=cnb-cache
36-
37-
dbc_go cnb-cache-sqlite "$@"
38-
39-
echo "############################"
40-
cat /etc/cnb-cache/cnb-cache.env
41-
echo "############################"
42-
43-
phinx migrate -c /usr/lib/cnb-cache/phinx-adapter.php
44-
45-
if [ -f /var/lib/cnb-cache/cnb-cache ]; then
46-
chown root:www-data /var/lib/cnb-cache
47-
chmod ug+rw /var/lib/cnb-cache
48-
fi
49-
10+
configure)
11+
12+
. /usr/share/debconf/confmodule
13+
. /usr/share/dbconfig-common/dpkg/postinst.sqlite3
14+
15+
# shellcheck disable=SC2034
16+
dbc_generate_include_args="-U -o template_infile=/usr/lib/cnb-cache/.env.template"
17+
# shellcheck disable=SC2034
18+
dbc_generate_include=template:/etc/cnb-cache/cnb-cache.env
19+
# shellcheck disable=SC2034
20+
dbc_generate_include_owner="root:www-data"
21+
# shellcheck disable=SC2034
22+
dbc_generate_include_perms="664"
23+
# shellcheck disable=SC2034
24+
dbc_dbfile_owner="www-data:www-data"
25+
# shellcheck disable=SC2034
26+
dbc_dbfile_perms="0664"
27+
# shellcheck disable=SC2034
28+
dbc_dbuser=cnb-cache
29+
# shellcheck disable=SC2034
30+
dbc_dbname=cnb-cache
31+
32+
dbc_go cnb-cache-sqlite "$@" || true
33+
34+
echo "############################"
35+
cat /etc/cnb-cache/cnb-cache.env
36+
echo "############################"
37+
38+
phinx migrate -c /usr/lib/cnb-cache/phinx-adapter.php
39+
40+
if [ -f /var/lib/cnb-cache/cnb-cache ]; then
41+
chown root:www-data /var/lib/cnb-cache
42+
chmod ug+rw /var/lib/cnb-cache
5043
fi
5144

52-
5345
;;
5446

55-
abort-upgrade|abort-remove|abort-deconfigure)
56-
;;
47+
abort-upgrade | abort-remove | abort-deconfigure) ;;
5748

58-
*)
59-
echo "postinst called with unknown argument \`$1'" >&2
60-
exit 1
49+
*)
50+
echo "postinst called with unknown argument \`$1'" >&2
51+
exit 1
6152
;;
6253
esac
6354

64-
6555
#DEBHELPER#
6656

6757
exit 0

debian/cnb-cache-sqlite.postrm

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,32 @@
22
set -e
33

44
case "$1" in
5-
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
5+
purge | remove | upgrade | failed-upgrade | abort-install | abort-upgrade | disappear)
66

7-
if [ "$1" = "purge" ]; then
8-
rm -f /etc/cnb-cache/cnb-cache.env
9-
if command -v ucf >/dev/null; then
10-
ucf --purge /etc/cnb-cache/cnb-cache.env
11-
ucfr --purge cnb-cache-sqlite /etc/cnb-cache/cnb-cache.env
12-
fi
13-
fi
7+
if [ -f /usr/share/debconf/confmodule ]; then
8+
. /usr/share/debconf/confmodule
9+
fi
10+
if [ -f /usr/share/dbconfig-common/dpkg/postrm.sqlite3 ]; then
11+
. /usr/share/dbconfig-common/dpkg/postrm.sqlite3
12+
dbc_go cnb-cache-sqlite "$@"
13+
fi
14+
15+
if [ "$1" = "purge" ]; then
16+
rm -f /etc/cnb-cache/cnb-cache.env
17+
if command -v ucf >/dev/null; then
18+
ucf --purge /etc/cnb-cache/cnb-cache.env
19+
ucfr --purge cnb-cache-sqlite3 /etc/cnb-cache/cnb-cache.env
20+
fi
21+
fi
1422

1523
;;
1624

17-
*)
18-
echo "postrm called with unknown argument \`$1'" >&2
19-
exit 1
25+
*)
26+
echo "postrm called with unknown argument \`$1'" >&2
27+
exit 1
2028
;;
2129
esac
2230

23-
2431
#DEBHELPER#
2532

2633
exit 0

debian/cnb-cache-sqlite.prerm

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
set -e
3+
4+
case "$1" in
5+
remove | upgrade | deconfigure)
6+
7+
. /usr/share/debconf/confmodule
8+
. /usr/share/dbconfig-common/dpkg/prerm.sqlite3
9+
dbc_go cnb-cache-sqlite "$@"
10+
11+
;;
12+
13+
failed-upgrade) ;;
14+
15+
*)
16+
echo "prerm called with unknown argument \`$1'" >&2
17+
exit 1
18+
;;
19+
esac
20+
21+
#DEBHELPER#
22+
23+
exit 0

debian/cnb-cache.postinst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ set -x
77

88
db_version 2.0
99

10-
11-
12-
13-
1410
pathfind() {
1511
OLDIFS="$IFS"
1612
IFS=:
File renamed without changes.

debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Vcs-Git: https://github.com/Spoje-NET/CNB-cache.git
1010
Vcs-Browser: https://github.com/Spoje-NET/CNB-cache
1111

1212
Package: cnb-cache
13-
Architecture: any
13+
Architecture: all
1414
Multi-Arch: foreign
1515
Depends: ${misc:Depends}, ${shlibs:Depends},
1616
php-cli,

0 commit comments

Comments
 (0)