Jguer / yay

Yet another Yogurt - An AUR Helper written in Go
GNU General Public License v3.0
10.9k stars 356 forks source link

--needed option is only adhered to by pacman, not yay #1552

Closed justin8 closed 1 year ago

justin8 commented 3 years ago

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

  1. yay -S --needed spotify
  2. 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
Morganamilo commented 3 years ago

I think the bigger bug here is that yay appears to give no output whatsoever.

Please follow the template.

justin8 commented 3 years ago

Thanks. The snarky response is appreciated. I've added the output, did that help clear things up for you?

stale[bot] commented 2 years ago

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.

skyfaller commented 2 years ago

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:

When stale bot is in the mix, open/closed status is instead is a measurement of:

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.

Jguer commented 2 years ago

@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

justin8 commented 1 year ago

Thanks for all the hard work @Jguer ! It's much appreciated