[DRE-commits] [redmine] 02/02: Do not fail is manual database installation is selected

Marc Dequènes duck at moszumanska.debian.org
Mon Nov 20 11:19:35 UTC 2017


This is an automated email from the git hooks/post-receive script.

duck pushed a commit to branch master
in repository redmine.

commit 854a82fd70901defe33f8655dc656352b93bdd1b
Author: Marc Dequènes (Duck) <Duck at DuckCorp.org>
Date:   Mon Nov 20 20:08:48 2017 +0900

    Do not fail is manual database installation is selected
---
 debian/changelog     |  2 ++
 debian/postinst      | 18 +++++++++++++-----
 debian/tests/control |  3 +++
 3 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index cf56df1..93948a7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,6 +16,8 @@ redmine (3.4.2-1) UNRELEASED; urgency=medium
   * Pass instance list to postrm to ensure removal works when things are
     broken (found in #868955).
   * Support dbconfig-no-thanks.
+  * Do not fail is manual database installation is selected (Closes:
+    #868955).
 
   [ Lucas Kanashiro ]
   * debian/copyright: fix path of redcloth3.rb file
diff --git a/debian/postinst b/debian/postinst
index b31be1b..ee9a91a 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -75,12 +75,20 @@ manage_instance() {
   chown root:www-data $secret_key
   chmod 0640  $secret_key
 
-  cd /usr/share/redmine
-  su www-data -s /bin/sh -c "REDMINE_INSTANCE=$instance SCHEMA=/dev/null bundle exec rake db:migrate redmine:plugins:migrate"
+  # check if the user either use dbconfig-no-thanks or selected a manual DB install
+  dbc_install=false
+  if [ -f $dbc_packageconfig ]; then
+    . $dbc_packageconfig
+  fi
+
+  if [ "$dbc_install" = "true" ]; then
+    cd /usr/share/redmine
+    su www-data -s /bin/sh -c "REDMINE_INSTANCE=$instance SCHEMA=/dev/null bundle exec rake db:migrate redmine:plugins:migrate"
 
-  db_get redmine/instances/$instance/default-language || true
-  REDMINE_LANG="${RET:-en}"
-  su www-data -s /bin/sh -c "REDMINE_INSTANCE=$instance REDMINE_LANG=$REDMINE_LANG bundle exec rake redmine:load_default_data"
+    db_get redmine/instances/$instance/default-language || true
+    REDMINE_LANG="${RET:-en}"
+    su www-data -s /bin/sh -c "REDMINE_INSTANCE=$instance REDMINE_LANG=$REDMINE_LANG bundle exec rake redmine:load_default_data"
+  fi
 
   # tell application to restart (works with passenger)
   su www-data -s /bin/sh -c "touch /var/lib/redmine/$instance/tmp/restart.txt"
diff --git a/debian/tests/control b/debian/tests/control
index 78e301d..f710ebd 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -25,3 +25,6 @@ Restrictions: needs-root
 Tests: install-break-purge
 Depends: redmine
 Restrictions: needs-root
+
+Test-Command: /bin/true
+Depends: redmine-sqlite, redmine, dbconfig-no-thanks

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/redmine.git



More information about the Pkg-ruby-extras-commits mailing list