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

Antonio Terceiro terceiro at moszumanska.debian.org
Sat Nov 12 21:06:26 UTC 2016


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

terceiro pushed a commit to branch debian/jessie
in repository redmine.

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

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

diff --git a/debian/changelog b/debian/changelog
index ec0e42a..907a732 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+redmine (3.0~20140825-8~deb8u4) 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 21:10:04 -0300
+
 redmine (3.0~20140825-8~deb8u3) jessie; urgency=medium
 
   * gemfile-adjustments.patch: load all database drivers for all Redmine
diff --git a/debian/postinst b/debian/postinst
index 0abb494..2990058 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -12,7 +12,25 @@ RAKE_VERBOSE=false
 
 # 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
 
 # remove and purge old instances each time postinst is called

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