Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

batcat has been renamed to bat in Debian #2455

Open
Tachi107 opened this issue Jan 21, 2023 · 3 comments
Open

batcat has been renamed to bat in Debian #2455

Tachi107 opened this issue Jan 21, 2023 · 3 comments
Labels
documentation feature-request New feature or request

Comments

@Tachi107
Copy link

Hi, the bat utility has been finally moved back to /usr/bin/bat from /usr/bin/batcat, as the package that used to "own" /usr/bin/bat hasn't been part of Debian for a couple of years. See https://bugs.debian.org/1029096 for the relevant Debian bug report.

This means that most likely the batcat workaround won't be needed in Debian 12 and Ubuntu 23.04 (not released yet), and it might make sense to mention this already in the README.

Related to #982

@Tachi107 Tachi107 added the feature-request New feature or request label Jan 21, 2023
@sharkdp
Copy link
Owner

sharkdp commented Jan 21, 2023

Oh this is great news! Thank you for posting here. I agree that we should already prepare for these changes.

@nabajour
Copy link

FYI, I updated my Debian unstable and bat wasn't working again. Due to this bugfix:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1029504

If I understand this correctly, the naming still conflicts with another executable (/usr/sbin/bat) from bacula-console-qt.

I don't know what the most debianic way to get this to work is, without making a manual symlink that's not managed by the packaging system. I'm not using bacula.

For now, I tried the alternative system:

 $ sudo update-alternatives --install /usr/bin/bat bat /usr/bin/batcat 50

But I might be strong-arming it by using the system in the opposite way than it was intended, as it's supposed to help selecting between multiple binaries providing the same functionalities. So this is probably useless and not different to a manual symlink.

@jvschiavo
Copy link

I think our best bet to solve this issue would be trying to convince bacula developers to change the /usr/sbin/bat filename upstream, maybe to /usr/sbin/bacula-bat.

So after a version of Debian with the bat command free, the bat project could make use of it on the next release.

Example:
Debian Bookworm: /usr/sbin/bat is part of bacula-console-qt (/usr/bin/bat is free)
Debian Trixie: both /usr/sbin/bat and /usr/bin/bat are free (to avoid confusion for upgrading bacula users to mistakenly run the wrong software)
Debian Forky: /usr/bin/bat is part of the bat package

In the transitional release (Trixie in this example) we could also replace the /usr/bin/bat (and symlink /usr/sbin/bat to it) with some info about this.

Something like:

#!/usr/bin/sh
echo 'This command used to be part of the "bacula-console-qt" package, and it's going to be part of the "bat" package on the next stable version of Debian.'
echo 'If you want to use the previous bat command from bacula-console-qt, please run "bacula-bat" as root.'
echo 'If you want to use the cat-like command from the bat package, please run "batcat".'
echo
echo 'You can also add an alias or a symlink for either of these commands. Example:'
echo
echo 'Alias:'
echo "echo 'alias bat="/usr/bin/batcat"' >> ~/.bashrc"
echo 'Local symlink for your user only:'
echo 'ln -s /usr/bin/batcat ~/.local/bin/bat'
echo
echo 'Symlink for the whole system (needs root permission):'
echo 'ln -s /usr/bin/batcat /usr/bin/bat'
echo 'or for bacula:'
echo 'ln -s /usr/sbin/bacula-bat /usr/sbin/bat'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants