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

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=b2789db9a204dbe71046619a8ceb7bb7263d1434

commit b2789db9a204dbe71046619a8ceb7bb7263d1434
Author: Guillem Jover <guil...@debian.org>
AuthorDate: Mon Feb 7 18:17:07 2022 +0100

    debian: Use dpkg-error.sh in postinst
    
    This makes it possible to use better diagnostic functions.
---
 debian/dpkg.postinst | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/debian/dpkg.postinst b/debian/dpkg.postinst
index ff2e53cf6..efa879c20 100644
--- a/debian/dpkg.postinst
+++ b/debian/dpkg.postinst
@@ -3,6 +3,10 @@
 
 set -e
 
+. /usr/share/dpkg/sh/dpkg-error.sh
+
+setup_colors
+
 # Version 1.21.0 had bogus handling of DPKG_ADMINDIR in update-alternatives,
 # and misplaced them, fix them up.
 fixup_misplaced_alternatives()
@@ -41,7 +45,7 @@ fixup_misplaced_alternatives()
       mv "$file" "alternatives/$file"
       ;;
     *)
-      echo "warning: unknown dpkg database file $admindir/$file is not a 
misplaced alternative state... leaving as is" 1>&2
+      warning "unknown dpkg database file $admindir/$file is not a misplaced 
alternative state... leaving as is"
       continue
       ;;
     esac
@@ -55,8 +59,7 @@ configure)
 abort-upgrade|abort-deconfigure|abort-remove)
   ;;
 *)
-  echo "$0 called with unknown argument '$1'" 1>&2
-  exit 1
+  error "called with unknown argument '$1'"
   ;;
 esac
 

-- 
Dpkg.Org's dpkg

Reply via email to