[DRE-commits] [redmine] 01/05: debian/postinst: handle dependency check failure when triggered

Antonio Terceiro terceiro at moszumanska.debian.org
Wed Sep 7 14:34:18 UTC 2016


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

terceiro pushed a commit to branch master
in repository redmine.

commit e45f23138cb118b76acc8d55bd88bebe716c46ec
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Sun Jun 12 20:51:13 2016 -0300

    debian/postinst: handle dependency check failure when triggered
---
 debian/changelog |  7 +++++++
 debian/postinst  | 20 +++++++++++++++++++-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index fc4126f..cadf175 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+redmine (3.2.3-2) UNRELEASED; urgency=medium
+
+  * debian/postinst: handle dependency check failure when triggered, to avoid
+    breaking in the middle of dist-upgrades.
+
+ -- Antonio Terceiro <terceiro at debian.org>  Sun, 12 Jun 2016 20:49:25 -0300
+
 redmine (3.2.3-1) unstable; urgency=medium
 
   * New upstream release
diff --git a/debian/postinst b/debian/postinst
index 2fbced4..7779538 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -8,7 +8,25 @@ set -e
 # update Gemfile.lock, always
 #######################################################################
 rm -f /var/lib/redmine/Gemfile.lock
-(cd /usr/share/redmine && bundle --local --quiet)
+cd /usr/share/redmine
+if ! bundle --local --quiet; then
+  if [ "$1" = "triggered" ]; then
+    # probably triggered in the middle of an system upgrade; ignore failure
+    # but abort here
+    echo "#########################################################################"
+    echo "# Failed to detect redmine dependencies; if you are in the middle of an #"
+    echo "# upgrade, this is probably fine, there will be another attempt later.  #"
+    echo "#                                                                       #"
+    echo "# If you are NOT in the middle of an upgrade, there is probably a real  #"
+    echo "# issue. Please report a bug.                                           #"
+    echo "#########################################################################"
+    exit 0
+  else
+    # something is really broken
+    exit 1
+  fi
+fi
+cd - >/dev/null
 chown www-data:www-data /var/lib/redmine/Gemfile.lock
 
 #######################################################################

-- 
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