#487965 checkinstall: please use absolute patch for "which"

Package:
checkinstall
Source:
checkinstall
Description:
installation tracker
Submitter:
James Westby
Date:
2026-08-07 07:07:02 UTC
Severity:
wishlist
Tags:
#487965#5
Date:
2008-06-25 13:11:24 UTC
From:
To:
Hi,

If the user has an alias defined for "which", then it can cause
checkinstall to fail. Using the absolute path to "which" ensures
that this doesn't happen. The following patch is used in Ubuntu
to provide this behaviour. Please consider applying it.

Thanks,

James

diff -pruN 1.6.1-5/checkinstall 1.6.1-5ubuntu1/checkinstall
--- 1.6.1-5/checkinstall	2007-11-18 16:12:42.000000000 +0000
+++ 1.6.1-5ubuntu1/checkinstall	2007-11-18 16:11:28.000000000 +0000
@@ -908,7 +908,7 @@ if ! [ -x "$VISUAL" ]; then
    if [ -x "$EDITOR" ]; then
       VISUAL=$EDITOR
    else
-      VISUAL=`which vi`
+      VISUAL=`/usr/bin/which vi`
    fi
 fi

@@ -920,7 +920,7 @@ BADTAR=0
 if [ "$TAR" ]; then
    ! [ -x "$TAR" ] && BADTAR=1
 else
-   TAR=`which tar-1.13 2> /dev/null`
+   TAR=`/usr/bin/which tar-1.13 2> /dev/null`
 fi

 if ! [ -x "$TAR" ]; then
@@ -1910,7 +1910,7 @@ FAILED=0
 if [ $INSTALL -gt 0 ]; then
    # Verify that we have the "installpkg" command in our path

-   INSTALLPKG_PATH=`which installpkg 2> /dev/null`
+   INSTALLPKG_PATH=`/usr/bin/which installpkg 2> /dev/null`

    if ! [ -x "$INSTALLPKG_PATH" ]; then
       echo
@@ -2117,7 +2117,7 @@ FAILED=0

 # Verify that we have the rpm command in our path

#487965#10
Date:
2008-06-25 15:50:23 UTC
From:
To:
El 25/06/08 09:11 James Westby escribió:

I'm not really sure it's checkinstall's job to work around a broken which.
Aliases shouldn't break checkinstall. What would break checkinstall is a
broken which that is present before /usr/bin in $PATH. However, if we care
about this then we should start adding full paths to all programs invoked,
and there lies madness.



Saludos,
Felipe Sateler

#487965#15
Date:
2008-06-25 15:55:05 UTC
From:
To:
Hi,

Thanks for the response.

I'm not sure it's the right thing, but it is wishlist.

Thanks,

James

#487965#20
Date:
2026-08-07 06:53:50 UTC
From:
To:
Tagging this one as wontfix. It’s been open for 18 years and hasn’t gotten
any traction.

#487965#27
Date:
2026-08-07 07:04:32 UTC
From:
To:
At this point I think this bug can be closed, given it has been 18 years
and there has been no consensus that we should implement it.

Stephen