|
2 | 2 | set -e |
3 | 3 | set -x |
4 | 4 |
|
5 | | - |
6 | 5 | . /usr/share/debconf/confmodule |
7 | 6 |
|
8 | 7 | db_version 2.0 |
9 | 8 |
|
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | 9 | 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 |
50 | 43 | fi |
51 | 44 |
|
52 | | - |
53 | 45 | ;; |
54 | 46 |
|
55 | | - abort-upgrade|abort-remove|abort-deconfigure) |
56 | | - ;; |
| 47 | +abort-upgrade | abort-remove | abort-deconfigure) ;; |
57 | 48 |
|
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 |
61 | 52 | ;; |
62 | 53 | esac |
63 | 54 |
|
64 | | - |
65 | 55 | #DEBHELPER# |
66 | 56 |
|
67 | 57 | exit 0 |
0 commit comments