fosskers / aura

A multilingual package manager for Arch Linux and the AUR.
https://fosskers.github.io/aura/
GNU General Public License v3.0
1.75k stars 113 forks source link

Switch for -k|--diff doesn't seem to work #916

Closed dino- closed 1 month ago

dino- commented 2 months ago

Maybe I'm doing it wrong but my workflow with aura for years has been to do -Ak PKG and inspect the PKGBUILD diffs. Since the 4.x versions (I think) I haven't seen this switch do anything, just quietly shows the pending new package version and asks for confirmation. The only way to see AUR PKGBUILD files any longer is to use -Ap which doesn't show diffs with the prior installation.

fosskers commented 2 months ago

Hi, have I mistaken the timing of when the -k results fire? Here's a screenshot: Auk

Here we see confirmation for the initial acceptance of the updates, then a prompt to view the diffs, then another prompt to continue after the diff has been approved.

Although now I see that you mean just -Ak, not with -u? Was your old experience that with just -Ak, it would print the diffs and then exit, without attempting to install?

dino- commented 2 months ago

Can you post what command you used to get that output above? I don't see anything like that. I just tested by installing an AUR package one version back (using manual build with git clone and makepkg of the AUR repo) and then used aura -Ak PACKAGENAME to update it to the latest. Never saw the PKGBUILD diff throughout the entire process from downloading to building to installation.

dino- commented 2 months ago

Yes, I used to do aura -Ak PKG1 PKG2 ... and see one or more of them before anything was built, so I could bail out on it. I guess this was never really the intended use of -k. It would actually NOT exit, it would ask me and then attempt to install, with just -Ak SOMEPKG

fosskers commented 2 months ago

I ran aura -Auk to produce the above.

I just tested by installing an AUR package one version back (using manual build with git clone and makepkg of the AUR repo)

There's the issue. In order to produce the diff, Aura has to know from which commit it's to produce the diff from. It does this by saving a git hash to ~/.cache/aura/hashes/ after every build. When -k is used, it checks the commit of the current git pull vs what it previously stored in hashes/ and then calls git diff based on those. By building the package manually, the hashes/ directory wouldn't be updated, and -k wouldn't work as expected. If you install something via Aura at least once, subsequent builds should produce diff output as expected.

Either way I will confirm if the plain -Ak (not upgrading with -u) use-case still works.

fosskers commented 2 months ago

I have confirmed that -Ak works, even without -u. Shall we close this issue?

fosskers commented 1 month ago

Hi again, I'm going to close this. Feel free to reopen if you experience other issues with -k.