Yay: --cleanafter should not run after a failed install

Created on 26 Jun 2020  路  4Comments  路  Source: Jguer/yay

Affected Version




yay v10.0.1 - libalpm v12.0.1

Issue

After waiting for a long build, the install failed due to a conflict and yay --cleanafter then deleted the package files. Maybe --cleanafter could keep the latest package file around, or copy directly to the pacman cache so paccache can deal with it?

Steps to reproduce

  1. yay -S sagemath-jupyter
  2. yay -S sagemath-jupyter-git --cleanafter

Output





...
==> Leaving fakeroot environment.
==> Finished making: sagemath-git 9.2.beta1.r0.ge2dcdeeabb-1 (Fri 26 Jun 2020 11:31:35 AM EDT)
==> Cleaning up...
 -> Found git repo: git.sagemath.org/sage.git
[sudo] password for matt: 
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) sagemath-jupyter-git-9.2.beta1.r0.ge2dcdeeabb-1

Total Installed Size:  0.00 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                                                                                                      [#####################################################################################################] 100%
(1/1) checking package integrity                                                                                                                                    [#####################################################################################################] 100%
(1/1) loading package files                                                                                                                                         [#####################################################################################################] 100%
(1/1) checking for file conflicts                                                                                                                                   [#####################################################################################################] 100%
error: failed to commit transaction (conflicting files)
sagemath-jupyter-git: /usr/share/jupyter/kernels/sagemath/doc exists in filesystem (owned by sagemath-jupyter)
sagemath-jupyter-git: /usr/share/jupyter/kernels/sagemath/kernel.json exists in filesystem (owned by sagemath-jupyter)
sagemath-jupyter-git: /usr/share/jupyter/kernels/sagemath/logo-64x64.png exists in filesystem (owned by sagemath-jupyter)
sagemath-jupyter-git: /usr/share/jupyter/kernels/sagemath/logo.svg exists in filesystem (owned by sagemath-jupyter)
sagemath-jupyter-git: /usr/share/jupyter/nbextensions/jsmol exists in filesystem (owned by sagemath-jupyter)
sagemath-jupyter-git: /usr/share/jupyter/nbextensions/mathjax exists in filesystem (owned by sagemath-jupyter)
sagemath-jupyter-git: /usr/share/jupyter/nbextensions/threejs exists in filesystem (owned by sagemath-jupyter)
Errors occurred, no packages were upgraded.
removing untracked AUR files from cache...
:: Cleaning (1/1): /home/matt/.cache/yay/sagemath-git
Removing sagemath-git-9.2.beta1.r0.ge2dcdeeabb-1-x86_64.pkg.tar.xz
Removing sagemath-jupyter-git-9.2.beta1.r0.ge2dcdeeabb-1-x86_64.pkg.tar.xz
{
    "aururl": "https://aur.archlinux.org",
    "buildDir": "/home/matt/.cache/yay",
    "absdir": "/home/matt/.cache/yay/abs",
    "editor": "",
    "editorflags": "",
    "makepkgbin": "makepkg",
    "makepkgconf": "",
    "pacmanbin": "pacman",
    "pacmanconf": "/etc/pacman.conf",
    "redownload": "no",
    "rebuild": "no",
    "answerclean": "",
    "answerdiff": "",
    "answeredit": "",
    "answerupgrade": "",
    "gitbin": "git",
    "gpgbin": "gpg",
    "gpgflags": "",
    "mflags": "",
    "sortby": "votes",
    "searchby": "name-desc",
    "gitflags": "",
    "removemake": "ask",
    "sudobin": "sudo",
    "sudoflags": "",
    "requestsplitn": 150,
    "sortmode": 0,
    "completionrefreshtime": 7,
    "sudoloop": false,
    "timeupdate": false,
    "devel": false,
    "cleanAfter": true,
    "provides": true,
    "pgpfetch": true,
    "upgrademenu": true,
    "cleanmenu": true,
    "diffmenu": true,
    "editmenu": false,
    "combinedupgrade": false,
    "useask": false,
    "batchinstall": false
}
Confirmed Bug

All 4 comments

There's an argument to be made that --cleanafter does exactly what it says. Maybe one could have a --cleanaftersuccess flag or something similar for this usecase?

    --cleanafter          Remove package sources after successful install

Two problems I see: It isn't removing just the package sources, it is removing the package final product, and it wasn't a successful install. So no, it is not doing exactly what it says.

Ok so I see this issue breaks down into two:

  • --cleanafter removes package sources and final product
    Yes, since we changed to using git clean for cleanafter this is what happens, we should add a -exclude=*.pkg.* to it to fix the first issue.

  • --cleanafter should not run after a failed install
    Is a bug and should be fixed

Thanks for the feedback @ricochet1k (@grandchild also thank you because lately you've been killing it on support tickets)

--cleanafter removes package sources and final product is fixed on https://github.com/Jguer/yay/commit/b5b4484c5c68124d996e547e3250e61d822a6062 and in yay-git.

The other issue will require some heavy refactoring so it has to be thought out before

Was this page helpful?
0 / 5 - 0 ratings

Related issues

captn3m0 picture captn3m0  路  4Comments

ixevix picture ixevix  路  3Comments

renom picture renom  路  3Comments

AdrienLemaire picture AdrienLemaire  路  3Comments

Zeioth picture Zeioth  路  3Comments