Open barak opened 1 year ago
I believe this was a bug in system-packages
on GNU ELPA. I have pushed a new version 1.0.12 with a fix, which should be available to install from GNU ELPA within 24-48 hours.
Could you please test it and report back whether it works or not?
This was actually using the Debian package elpa-use-package
version 2.4.4-1
.
Does adding this to the very beginning of your Init file, and then restarting Emacs, solve the problem?
(setq system-packages-package-manager
(let ((managers system-packages-supported-package-managers)
manager)
(while managers
(progn
(setq manager (pop managers))
(let ((found (executable-find (symbol-name (car manager)))))
(if (and found
;; The package manager named "pacman" conflicts
;; with the game binary on non-Arch systems.
(not (string-match (rx "games/pacman" eos) found)))
(setq managers nil)
(setq manager nil)))))
(car manager)))
That works, on my machine, as of today. But seems to me it's not robust because someone on an Arch system might have both /usr/bin/pacman
(the package manager) and /usr/games/pacman
(the arcade game clone) and have /usr/games
before /usr/sbin
on their path.
I'd suggest putting "apt"
before "pacman"
in the search list, just based on popularity. That's a stop-gap though.
Unfortunately I don't think there's any truly correct solution based on scanning for an executable. Sometimes people have multiple package managers installed: their native one, and also some "alien" ones for various purposes. There's a Debian package rpm
that provides /usr/bin/rpm
, and there's a Debian package pacman-package-manager
that provides /usr/bin/pacman
. The only solution I can see is to determine which distribution you're on, and case off that. I think /etc/os-release
is standard for this purpose.
I'd suggest putting
"apt"
before"pacman"
in the search list, just based on popularity. That's a stop-gap though.
I've now done this and released version 1.0.13, which should be on GNU ELPA shortly. Thanks.
I run Debian and am a fun-loving bloke so
/usr/games
is on my path andpacman
(the game) is installed. Whenuse-package
loads and searches for an appropriate value forsystem-packages-package-manager
it finds/usr/games/pacman
so the variable gets set to"pacman"
instead of"apt"
.Woka woka woka.
👻 👻 👻