yay
yay copied to clipboard
--needed option is only adhered to by pacman, not yay
Affected Version
yay v10.2.3 - libalpm v13.0.0
Describe the bug
When using the --needed flag pacman will only install the listed packages if a newer version is available. Yay honours this for the repository packages, but for AUR packages it will download, build the package and then try to install it with pacman --needed resulting in a no-op, but only after building every chosen AUR package
Reproduction Steps
yay -S --needed spotify- Spotify will be downloaded and built in to a package even when it is already installed.
Expected behavior
When the currently installed package and version available are equal, the package is not installed
Output
╰─ yay -S --needed --noconfirm spotify
:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur:1] spotify-1:1.1.56.595-1
1 spotify (Installed) (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==>
:: PKGBUILD up to date, Skipping (1/1): spotify
1 spotify (Installed) (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==>
:: (1/1) Parsing SRCINFO: spotify
==> Making package: spotify 1:1.1.56.595-1 (Wed 14 Jul 2021 12:06:19 PM AEST)
==> Retrieving sources...
-> Found spotify.protocol
-> Found LICENSE
-> Found spotify-1.1.56.595-x86_64.deb
-> Found spotify-1.1.56.595-Release
-> Found spotify-1.1.56.595-Release.sig
-> Found spotify-1.1.56.595-x86_64-Packages
==> Validating source files with sha512sums...
spotify.protocol ... Passed
LICENSE ... Passed
spotify-1.1.56.595-x86_64.deb ... Passed
spotify-1.1.56.595-Release ... Skipped
spotify-1.1.56.595-Release.sig ... Skipped
spotify-1.1.56.595-x86_64-Packages ... Skipped
==> Verifying source file signatures with gpg...
spotify-1.1.56.595-Release ... Passed
==> Making package: spotify 1:1.1.56.595-1 (Wed 14 Jul 2021 12:06:21 PM AEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Found spotify.protocol
-> Found LICENSE
-> Found spotify-1.1.56.595-x86_64.deb
-> Found spotify-1.1.56.595-Release
-> Found spotify-1.1.56.595-Release.sig
-> Found spotify-1.1.56.595-x86_64-Packages
==> Validating source files with sha512sums...
spotify.protocol ... Passed
LICENSE ... Passed
spotify-1.1.56.595-x86_64.deb ... Passed
spotify-1.1.56.595-Release ... Skipped
spotify-1.1.56.595-Release.sig ... Skipped
spotify-1.1.56.595-x86_64-Packages ... Skipped
==> Verifying source file signatures with gpg...
spotify-1.1.56.595-Release ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
-> Extracting spotify-1.1.56.595-x86_64.deb with bsdtar
==> Starting prepare()...
spotify-1.1.56.595-x86_64-Packages: OK
spotify-1.1.56.595-x86_64.deb: OK
==> Sources are ready.
==> Making package: spotify 1:1.1.56.595-1 (Wed 14 Jul 2021 12:06:24 PM AEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Sources are ready.
spotify-1:1.1.56.595-1 is up to date -- skipping
I think the bigger bug here is that yay appears to give no output whatsoever.
Please follow the template.
Thanks. The snarky response is appreciated. I've added the output, did that help clear things up for you?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Don't use stale bot
Please do not use stale bot, it makes the open or closed status of bugs meaningless. Closed bugs should mean:
- the bug is fixed
- the bug cannot be fixed (e.g. it is upstream)
- the maintainer does not want the bug to be fixed
When stale bot is in the mix, open/closed status is instead is a measurement of:
- how much discussion is required to understand the bug (obvious bugs may actually be higher priority)
- how much people who care about the bug are willing to complain, rewarding whining rather than patience
- whether the person with the skills/time/energy to fix the bug arrives in 3 months or 6 months, i.e. arbitrary timing
Furthermore, stale bot adds noise to GitHub notifications both from stale bot itself and people defending against stale bot. I received a meaningless stale bot notification just now, and anyone following this issue will now also get a notification from this comment.
Scripting with yay is made painful by this bug
Fixing this bug would be very useful to me when automating setup of new machines using e.g. Chezmoi scripts. Testing my scripts or using them to keep the list of installed packages consistent across existing machines is very time-consuming when I have to wait for yay to build packages that do not need to be built. Please leave the bug open.
For anyone looking to save time, I've been running yay --sync --needed --norebuild --noredownload --nocleanmenu --nodiffmenu --noremovemake, but it still takes far more time than necessary and far more time than pacman.
@skyfaller you are right, it does generate a lot of noise, I've exempted bugs and triage from it.
https://github.com/Jguer/yay/commit/6c09d9bf335bd152aef3c608db00e14df5a036e5
Thanks for all the hard work @Jguer ! It's much appreciated