Your message dated Thu, 14 Oct 2021 11:03:26 +0000
with message-id <[email protected]>
and subject line Bug#995957: fixed in dbconfig-common 2.0.20
has caused the Debian Bug report #995957,
regarding dbconfig-common: Spews "/usr/bin/which: this version of `which' is 
deprecated; use `command -v' in scripts instead."
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
995957: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=995957
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: dbconfig-common
Version: 2.0.19
Severity: normal
Tags: patch

Dear Maintainer,

/usr/share/dbconfig-common/internal/* (and also 
/usr/share/dbconfig-common/dpkg/postrm)
call which(1), which is currently deprecated.

    $ rgrep -E "^[^#]*which" /usr/share/dbconfig-common
    /usr/share/dbconfig-common/internal/sqlite:    which sqlite >/dev/null 2>&1
    /usr/share/dbconfig-common/internal/sqlite:    which sqlite3 >/dev/null 2>&1
    /usr/share/dbconfig-common/internal/mysql:    which mysqld >/dev/null 2>&1
    /usr/share/dbconfig-common/internal/common:                if ! which mysql 
>/dev/null; then
    /usr/share/dbconfig-common/internal/common:                if ! which psql 
>/dev/null 2>&1; then
    /usr/share/dbconfig-common/internal/common:                if ! which 
sqlite >/dev/null 2>&1; then
    /usr/share/dbconfig-common/internal/common:                if ! which 
sqlite3 >/dev/null 2>&1; then
    /usr/share/dbconfig-common/internal/common:                if ! which 
createdb >/dev/null; then
    /usr/share/dbconfig-common/internal/common:                if ! which 
dropdb >/dev/null; then
    /usr/share/dbconfig-common/internal/common:                if ! which 
createuser >/dev/null; then
    /usr/share/dbconfig-common/internal/common:                if ! which 
dropuser >/dev/null; then
    /usr/share/dbconfig-common/internal/common:                if ! which 
pg_dump >/dev/null; then
    /usr/share/dbconfig-common/internal/common:                if ! which 
mysqldump >/dev/null; then
    /usr/share/dbconfig-common/dpkg/postrm:        if which ucf >/dev/null 
2>&1; then

Some calls void the standard error but not all.  In particular, `which mysql 
>/dev/null;`
causes roundcube-core.postinst to spew

    /usr/bin/which: this version of `which' is deprecated; use `command -v' in 
scripts instead.

Here is a trivial patch following the suggested workaround from the
debianutils maintainer.

Thanks
Cheers,
-- 
Guilhem.
commit ea58773e4caa670e01414946e162e8afe65f75e1
Author: Guilhem Moulin <[email protected]>
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
 }
 
 ##

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
Source: dbconfig-common
Source-Version: 2.0.20
Done: Paul Gevers <[email protected]>

We believe that the bug you reported is fixed in the latest version of
dbconfig-common, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Paul Gevers <[email protected]> (supplier of updated dbconfig-common package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sun, 10 Oct 2021 21:48:00 +0200
Source: dbconfig-common
Architecture: source
Version: 2.0.20
Distribution: unstable
Urgency: medium
Maintainer: Paul Gevers <[email protected]>
Changed-By: Paul Gevers <[email protected]>
Closes: 995957
Changes:
 dbconfig-common (2.0.20) unstable; urgency=medium
 .
   [ Debian Janitor ]
   * Remove constraints unnecessary since buster
 .
   [ Guilhem Moulin ]
   * Replace `which` calls with `command -v`. (Closes: #995957)
Checksums-Sha1:
 0f62be7b8de78d929da7e0d5b6ffc3528ee3d59c 1890 dbconfig-common_2.0.20.dsc
 79beaeb0366005bc60f5220843ce2581f327dde0 222716 dbconfig-common_2.0.20.tar.xz
Checksums-Sha256:
 fe347c927f26ac17b085fdf4cc33c0e78b460baf5f0f64b5ff8d053895ff97aa 1890 
dbconfig-common_2.0.20.dsc
 4b4f3acb0220668e6bb75bf8a6aecca4db1d412aa461ed702187246a403f1b6d 222716 
dbconfig-common_2.0.20.tar.xz
Files:
 1441ba36d3235abc98789ff957356416 1890 admin optional dbconfig-common_2.0.20.dsc
 5520fdb885233eeb3dd83189e80dd4d1 222716 admin optional 
dbconfig-common_2.0.20.tar.xz

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEWLZtSHNr6TsFLeZynFyZ6wW9dQoFAmFoCtUACgkQnFyZ6wW9
dQrwoAgAxwIlADPOsoDPfLw3FBI1plxzZ+pyqQ6lr2chJEcJIPBW+V9qxsRFvY7A
G0MwmYK7xJzHJWSt3IDGq3cum9GG5cQumWwZavqqNovMmALi4TG/mGFLXeYFvj1J
MDXQ9W6vU3gDz4KyQw/E3Fa7C0Ly8icJZNSsuNBoq9Ie0VU6Cse8h+xp2e1VaQuN
e/PIwu5iZWr/etCPGEaq1goqwlAZ044v6rSUbZDh8458EhV6/XoRIlR/ivXeHncZ
teyuAcE2++S2Zj+rsP/yXBPo0KBEZlLg1uzddMGwqw3DWbjDBASg/AAKI0NbU4cN
lf8WRs/yFQLb1NFA9g01DkyaNUh9/Q==
=/oZO
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to