The officially official Devuan Forum!

You are not logged in.

#1 2023-02-08 22:59:27

delgado
Member
Registered: 2022-07-14
Posts: 176  

[SOLVED] Bookworm's "which" pogram

New in the upcoming debian release https://wiki.debian.org/NewInBookworm

* The which program has been deprecated, and writes a warning to standard error (but still works, so long as stderr is not being captured along with stdout).

For f*** sake why? Completely unnecessary.
Will this make it to daedalus?

Probably a reminder to pin a current version before the release date to avoid stupid error messages.
gnu-which, which.debianutils ... are there more?

Offline

#2 2023-02-09 01:06:24

Altoid
Member
Registered: 2017-05-07
Posts: 1,475  

Re: [SOLVED] Bookworm's "which" pogram

Hello:

delgado wrote:

For f*** sake why? Completely unnecessary.

Hmm ...
No.

It's

For fuck's sake why?

Seriously, just who comes up with these dumb ideas?

which is one of the smartest and most useful Linux commands.

A.

Offline

#3 2023-02-09 06:49:04

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [SOLVED] Bookworm's "which" pogram

delgado wrote:

For f*** sake why?

Rather than whine like a little baby whose favourite toy has been taken away perhaps try some research instead?

I've been aware of the limitations of which for a while now and have preferred type for interactive use simply because it's a better tool for the job but I did some research for you (you're welcome) and found this excellent link explaining exactly why which is such a useless pile of shite that should be avoided by everyone:

https://unix.stackexchange.com/question … o-use-then

delgado wrote:

Probably a reminder to pin a current version before the release date to avoid stupid error messages.
gnu-which, which.debianutils ... are there more?

That is a really stupid thing to do because the debianutils package also contains commands used in the packaging system so pinning it to an old version will break APT once you try installing packages that rely on newer features.

If you want to keep using which you can either package up the GNU version or install it manually by using these commands:

wget https://ftp.gnu.org/gnu/which/which-2.21.tar.gz # or whatever the latest version is
tar xf which-2.21.tar.gz && cd which-2.21
./configure
make
make install # as root

And to illustrate just how limited and crap which really is:

archie:~$ which ls
/usr/bin/ls
archie:~$ type ls
ls is an alias for 'ls --color'
archie:~$ which kvm
which: no kvm in (/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
1archie:~$ type kvm
kvm is a function
archie:~$ which scrath 
which: no scrath in (/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
1archie:~$ type scratch 
scratch is an alias for 'doas systemd-nspawn --ephemeral --boot --directory=/'
archie:~$

So just drop which completely. It's worse than useless.

Last edited by Head_on_a_Stick (2023-02-09 07:03:23)


Brianna Ghey — Rest In Power

Offline

#4 2023-02-09 07:06:22

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,171  

Re: [SOLVED] Bookworm's "which" pogram

Settle down a bit, please.

It should be obvious without stupid examples that trying to use a program for something it doesn't do, then it won't provide the output you want.

It's a huge step from there to saying that the program is useless, since then the problem really sits behind the keyboard.

Offline

#5 2023-02-09 07:11:41

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [SOLVED] Bookworm's "which" pogram

ralph.ronnquist wrote:

Settle down a bit, please.

I presume that is directed to the people doing the whining? I've actually provided a solution in my post that doesn't break the packaging system. You're welcome.


Brianna Ghey — Rest In Power

Offline

#6 2023-02-09 08:18:09

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,171  

Re: [SOLVED] Bookworm's "which" pogram

Yes, your technical advice is likely to be helpful.

But pretending to be an arrogant twit less so, although I can understand that there probably is a constructive basis for that artistic style in your mind.

I am thinking that Bookworm is a release of debian, and as such its developers would or should strive for backward compatibility in as many ways as possible with all of the possible uses of the debian software. I believe it serves the end user community quite badly to make up a "pseudo fight" about which particular software is the better one for some functionality. Especially when it concerns actually removing programs or packages that get deemed to be the lesser good, and certainly where it's widely used software.

I suppose if we keep needing to patch against debian developers' choices, then we end up at that place where debian is no longer our platform. Actually @Head_on_a_Stick, I believe you are well ahead of me there.

Offline

#7 2023-02-09 15:08:11

boughtonp
Member
From: UK
Registered: 2023-01-19
Posts: 212  
Website

Re: [SOLVED] Bookworm's "which" pogram

alias which=type

Problem solved?


3.1415P265E589T932E846R64338

Offline

#8 2023-02-09 17:34:42

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [SOLVED] Bookworm's "which" pogram

ralph.ronnquist wrote:

pretending to be an arrogant twit

How dare you! That is outrageous. I'm not pretending at all...

Anyway my advice to manually compile & install GNU's which is bollocks because there's already a package for it in testing/unstable:

$ rmadison gnu-which                                                                                                                                                                                 
gnu-which  | 2.21+dfsg-2   | testing        | source, amd64, arm64, armel, armhf, i386, mips64el, mipsel, ppc64el, s390x
gnu-which  | 2.21+dfsg-2   | unstable       | source, amd64, arm64, armel, armhf, i386, mips64el, mipsel, ppc64el, s390x
gnu-which  | 2.21+dfsg-2   | unstable-debug | source
$

This was alluded to by the OP but I wasn't paying enough attention. Sorry OP.

ralph.ronnquist wrote:

I am thinking that Bookworm is a release of debian, and as such its developers would or should strive for backward compatibility in as many ways as possible with all of the possible uses of the debian software.

Hence GNU's which being packaged up separately. There is no "problem" here at all. IMO.

broughtonp wrote:

Problem solved?

That's an excellent suggestion :-)

I think this will more closely replicate the traditional output though:

alias which='command -v'

But anyway this is rendered moot by the new gnu-which package.


Brianna Ghey — Rest In Power

Offline

#9 2023-02-09 17:49:49

chris2be8
Member
Registered: 2018-08-11
Posts: 273  

Re: [SOLVED] Bookworm's "which" pogram

It will cause problems for scripts that call which. Unless stderr is sent somewhere harmless such as /dev/null it will either put out the message to the terminal (annoying, but probably the script will still work) or get mixed up with the output the script will try to parse (and probably make the script fail).

https://wiki.debian.org/NewInBookworm says:

Shell script writers are advised to use command -v instead.

But I won't be holding my breath waiting for *every* script calling which to be updated.

which is actually a shell script, so if this proves too annoying you could just update it on your system to comment out the message. And try to remember this if you write a script for someone else that uses which.

Offline

#10 2023-02-09 18:17:50

boughtonp
Member
From: UK
Registered: 2023-01-19
Posts: 212  
Website

Re: [SOLVED] Bookworm's "which" pogram

Head_on_a_Stick wrote:

But anyway this is rendered moot by the new gnu-which package.

So why is the default crappy "which" being deprecated instead of just being replaced with GNU's superior version?

Or is the latter what will be happening but the NewInBookworm page hasn't been updated yet?

https://wiki.debian.org/NewInBookworm?action=info wrote:

2021-09-16 01:44:08    ...    GregWooledge     which(1) deprecated

https://tracker.debian.org/pkg/gnu-which wrote:

[2022-03-28] gnu-which 2.21+dfsg-2 MIGRATED to testing (Debian testing watch)
[2022-03-22] Accepted gnu-which 2.21+dfsg-2 (source) into unstable (Boyuan Yang)


3.1415P265E589T932E846R64338

Offline

#11 2023-02-09 18:33:37

boughtonp
Member
From: UK
Registered: 2023-01-19
Posts: 212  
Website

Re: [SOLVED] Bookworm's "which" pogram

Trying to find the answer to the above, seems the deprecation may have been reversed in January?
metadata.ftp-master.debian.org/changelogs/main/d/debianutils/testing_changelog

* Revert deprecation of which (no. 2).
    closes: #993582, #993700


3.1415P265E589T932E846R64338

Offline

#12 2023-02-09 18:34:33

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [SOLVED] Bookworm's "which" pogram

I think the NewInBookworm page just hasn't been updated. I don't get a "deprecation" message when I try to use /usr/bin/which.debianutils so perhaps that's been decided against. The mailing lists probably have a discussion about all this but I don't follow them myself because I don't like spoilers.

A quick search brings up https://lists.debian.org/debian-devel/2 … 00283.html, which looks relevant. Can't be bothered reading it all though big_smile

EDIT: crossposted, I think my mailing list link continues the discussion at the end of the first bug report.

Last edited by Head_on_a_Stick (2023-02-09 18:36:15)


Brianna Ghey — Rest In Power

Offline

#13 2023-02-09 19:31:28

boughtonp
Member
From: UK
Registered: 2023-01-19
Posts: 212  
Website

Re: [SOLVED] Bookworm's "which" pogram

Head_on_a_Stick wrote:

Can't be bothered reading it all though

I regret reading it all. :/

There's not much meaningful discussion - just unanswered questions and disillusionment.


3.1415P265E589T932E846R64338

Offline

#14 2023-02-13 19:53:05

delgado
Member
Registered: 2022-07-14
Posts: 176  

Re: [SOLVED] Bookworm's "which" pogram

Thanks for the input, guys.

Probably it's not as bad as I thought in the first place. De-deprecation seems somewhat likely and gnu-which was included.
Still don't like it when "they" mess around with the basic tool set.

Head_on_a_Stick wrote:

I think the NewInBookworm page just hasn't been updated

Best solution (EDIT:), but bad public relation.

Last edited by delgado (2023-02-15 18:03:22)

Offline

Board footer