commit ea58773e4caa670e01414946e162e8afe65f75e1
Author: Guilhem Moulin <guilhem@debian.org>
Date:   Fri Oct 8 23:18:04 2021 +0200

    Replace `which` calls with `command -v`.
    
    Per which(1):
    
        DEPRECATION
            Since type and command -v were mandated by POSIX, this utility
            is no longer useful for maintainer scripts and thus will be
            removed from debianutils.

diff --git a/dbconfig-load-include b/dbconfig-load-include
index 9f1c4b8..b6a47de 100755
--- a/dbconfig-load-include
+++ b/dbconfig-load-include
@@ -191,7 +191,7 @@ EOF
 ;;
 
 php)
-	if ! which php > /dev/null; then
+	if ! command -v php >/dev/null; then
 		echo "error: php format but i can't find a php binary!" >&2
 		exit 1
 	fi
diff --git a/debian/dbconfig-common.postrm b/debian/dbconfig-common.postrm
index 512f8ab..0224e0d 100644
--- a/debian/dbconfig-common.postrm
+++ b/debian/dbconfig-common.postrm
@@ -4,7 +4,7 @@ set -e
 
 if [ $1 = "purge" ]; then
 	rm -f /etc/dbconfig-common/config || true
-  if which ucf >/dev/null 2>&1; then
+  if command -v ucf >/dev/null; then
     ucf -p /etc/dbconfig-common/config
     ucfr -p dbconfig-common /etc/dbconfig-common/config
   fi
diff --git a/doc/dbconfig-common.sgml b/doc/dbconfig-common.sgml
index fa309e8..4b477c6 100644
--- a/doc/dbconfig-common.sgml
+++ b/doc/dbconfig-common.sgml
@@ -242,7 +242,7 @@ fi
             <example>
 if [ "$1" = "purge" ]; then
     rm -f yourconfigfile
-    if which ucf >/dev/null 2>&1; then
+    if command -v ucf >/dev/null; then
         ucf --purge yourconfigfile
         ucfr --purge yourpackage yourconfigfile
     fi
diff --git a/dpkg/postrm b/dpkg/postrm
index 05ebba4..80430e7 100644
--- a/dpkg/postrm
+++ b/dpkg/postrm
@@ -18,7 +18,7 @@ dbc_go(){
     elif [ "$dbc_command" = "purge" ]; then
         # remove the dbc configuration file
         rm -f /etc/dbconfig-common/$dbc_package.conf || true
-        if which ucf >/dev/null 2>&1; then
+        if command -v ucf >/dev/null; then
             cfg="/etc/dbconfig-common/$dbc_package.conf"
             ucf -p "$cfg" || true
             ucfr -p "$dbc_package" "$cfg"
diff --git a/examples/db-test-mysql-2.0/debian/postrm b/examples/db-test-mysql-2.0/debian/postrm
index 7e0af0d..85f1593 100644
--- a/examples/db-test-mysql-2.0/debian/postrm
+++ b/examples/db-test-mysql-2.0/debian/postrm
@@ -14,7 +14,7 @@ fi
 
 if [ "$1" = "purge" ]; then
 	rm -f /etc/db-test-mysql/debian-db.php
-	if which ucf >/dev/null 2>&1; then
+	if command -v ucf >/dev/null; then
 		ucf --purge /etc/db-test-mysql/debian-db.php
 		ucfr --purge db-test-mysql /etc/db-test-mysql/debian-db.php
 	fi
diff --git a/examples/db-test-mysql-2.1/debian/postrm b/examples/db-test-mysql-2.1/debian/postrm
index 7e0af0d..85f1593 100644
--- a/examples/db-test-mysql-2.1/debian/postrm
+++ b/examples/db-test-mysql-2.1/debian/postrm
@@ -14,7 +14,7 @@ fi
 
 if [ "$1" = "purge" ]; then
 	rm -f /etc/db-test-mysql/debian-db.php
-	if which ucf >/dev/null 2>&1; then
+	if command -v ucf >/dev/null; then
 		ucf --purge /etc/db-test-mysql/debian-db.php
 		ucfr --purge db-test-mysql /etc/db-test-mysql/debian-db.php
 	fi
diff --git a/examples/db-test-mysql-frontend-2.0/debian/postrm b/examples/db-test-mysql-frontend-2.0/debian/postrm
index cc63651..1b3219a 100644
--- a/examples/db-test-mysql-frontend-2.0/debian/postrm
+++ b/examples/db-test-mysql-frontend-2.0/debian/postrm
@@ -13,7 +13,7 @@ fi
 
 if [ "$1" = "purge" ]; then
 	rm -f /etc/db-test-mysql-frontend/debian-db.php
-	if which ucf >/dev/null 2>&1; then
+	if command -v ucf >/dev/null; then
 		ucf --purge /etc/db-test-mysql-frontend/debian-db.php
 		ucfr --purge db-test-mysql-frontend /etc/db-test-mysql-frontend/debian-db.php
 	fi
diff --git a/examples/db-test-mysql-perl-2.0/debian/postrm b/examples/db-test-mysql-perl-2.0/debian/postrm
index 255d7c4..79cd2bb 100644
--- a/examples/db-test-mysql-perl-2.0/debian/postrm
+++ b/examples/db-test-mysql-perl-2.0/debian/postrm
@@ -13,7 +13,7 @@ fi
 
 if [ "$1" = "purge" ]; then
 	rm -f /etc/db-test-mysql-perl/debian-db.pm
-	if which ucf >/dev/null 2>&1; then
+	if command -v ucf >/dev/null; then
 		ucf -p /etc/db-test-mysql-perl/debian-db.pm
     ucfr -p db-test-mysql-perl /etc/db-test-mysql-perl/debian-db.pm
 	fi
diff --git a/examples/db-test-pgsql-migration-2.0/debian/postrm b/examples/db-test-pgsql-migration-2.0/debian/postrm
index 815d6a0..753783a 100644
--- a/examples/db-test-pgsql-migration-2.0/debian/postrm
+++ b/examples/db-test-pgsql-migration-2.0/debian/postrm
@@ -13,7 +13,7 @@ dbc_go db-test-pgsql-migration "$@"
 
 if [ "$1" = "purge" ]; then
 	rm -f /etc/db-test-pgsql-migration/db.new.conf
-	if which ucf >/dev/null 2>&1; then
+	if command -v ucf >/dev/null; then
 		ucf --purge /etc/db-test-pgsql-migration/db.new.conf
 		ucfr --purge db-test-pgsql-migration /etc/db-test-pgsql-migration/db.new.conf
 	fi
diff --git a/examples/db-test-sqlite3-2.0/debian/postrm b/examples/db-test-sqlite3-2.0/debian/postrm
index b514163..d0c156a 100644
--- a/examples/db-test-sqlite3-2.0/debian/postrm
+++ b/examples/db-test-sqlite3-2.0/debian/postrm
@@ -13,7 +13,7 @@ fi
 
 if [ "$1" = "purge" ]; then
 	rm -f /etc/db-test-sqlite3/debian-db.php
-	if which ucf >/dev/null 2>&1; then
+	if command -v ucf >/dev/null; then
 		ucf --purge /etc/db-test-sqlite3/debian-db.php
 		ucfr --purge db-test-sqlite3 /etc/db-test-sqlite3/debian-db.php
 	fi
diff --git a/internal/common b/internal/common
index d689ebe..b8ec7f4 100644
--- a/internal/common
+++ b/internal/common
@@ -53,28 +53,28 @@ _dbc_detect_installed_dbtype(){
     case "$1" in
         mysql)
             if [ ! -f /usr/share/dbconfig-common/internal/dbc-mysql ] ; then
-                if ! which mysql >/dev/null; then
+                if ! command -v mysql >/dev/null; then
                     return 1
                 fi
             fi
             ;;
         pgsql|psql)
             if [ ! -f /usr/share/dbconfig-common/internal/dbc-pgsql ] ; then
-                if ! which psql >/dev/null 2>&1; then
+                if ! command -v psql >/dev/null; then
                     return 1
                 fi
             fi
             ;;
         sqlite)
             if [ ! -f /usr/share/dbconfig-common/internal/dbc-sqlite ] ; then
-                if ! which sqlite >/dev/null 2>&1; then
+                if ! command -v sqlite >/dev/null; then
                     return 1
                 fi
             fi
             ;;
         sqlite3)
             if [ ! -f /usr/share/dbconfig-common/internal/dbc-sqlite3 ] ; then
-                if ! which sqlite3 >/dev/null 2>&1; then
+                if ! command -v sqlite3 >/dev/null; then
                     return 1
                 fi
             fi
@@ -170,7 +170,7 @@ _dbc_sanity_check(){
                 fi
                 ;;
             "createdb")
-                if ! which createdb >/dev/null; then
+                if ! command -v createdb >/dev/null; then
                     dbc_error="No pgsql createdb to execute.  (have
                        you installed postgresql-client?"
                     dbc_logline "sanity check failed for createdb"
@@ -178,7 +178,7 @@ _dbc_sanity_check(){
                 fi
                 ;;
             "dropdb")
-                if ! which dropdb >/dev/null; then
+                if ! command -v dropdb >/dev/null; then
                     dbc_error="No pgsql dropdb to execute.  (have
                        you installed postgresql-client?"
                     dbc_logline "sanity check failed for dropdb"
@@ -186,7 +186,7 @@ _dbc_sanity_check(){
                 fi
                 ;;
             "createuser")
-                if ! which createuser >/dev/null; then
+                if ! command -v createuser >/dev/null; then
                     dbc_error="No pgsql createuser to execute.  (have
                        you installed postgresql-client?"
                     dbc_logline "sanity check failed for createuser"
@@ -194,7 +194,7 @@ _dbc_sanity_check(){
                 fi
                 ;;
             "dropuser")
-                if ! which dropuser >/dev/null; then
+                if ! command -v dropuser >/dev/null; then
                     dbc_error="No pgsql dropuser to execute.  (have
                        you installed postgresql-client?"
                     dbc_logline "sanity check failed for dropuser"
@@ -202,7 +202,7 @@ _dbc_sanity_check(){
                 fi
                 ;;
             "pg_dump")
-                if ! which pg_dump >/dev/null; then
+                if ! command -v pg_dump >/dev/null; then
                     dbc_error="No pgsql pg_dump to execute.  (have
                        you installed postgresql-client?"
                     dbc_logline "sanity check failed for pg_dump"
@@ -210,7 +210,7 @@ _dbc_sanity_check(){
                 fi
                 ;;
             "mysqldump")
-                if ! which mysqldump >/dev/null; then
+                if ! command -v mysqldump >/dev/null; then
                     dbc_error="No mysqldump to execute.  (have
                        you installed mysql-client?"
                     dbc_logline "sanity check failed for mysqldump"
diff --git a/internal/mysql b/internal/mysql
index f09eccb..f51f88d 100644
--- a/internal/mysql
+++ b/internal/mysql
@@ -421,7 +421,7 @@ dbc_mysql_dump(){
 ## basic installation check
 ##
 dbc_mysql_db_installed(){
-    which mysqld >/dev/null 2>&1
+    command -v mysqld >/dev/null
 }
 
 ##
diff --git a/internal/sqlite b/internal/sqlite
index d9a6f50..c47001a 100644
--- a/internal/sqlite
+++ b/internal/sqlite
@@ -169,11 +169,11 @@ dbc_sqlite_dropdb(){
 ## basic installation check
 ##
 dbc_sqlite_db_installed(){
-    which sqlite >/dev/null 2>&1
+    command -v sqlite >/dev/null
 }
 
 dbc_sqlite3_db_installed(){
-    which sqlite3 >/dev/null 2>&1
+    command -v sqlite3 >/dev/null
 }
 
 ##
