yay -G silently overwrites entire directories

Created on 23 Aug 2018  路  2Comments  路  Source: Jguer/yay

Affected Version

yay v8.998.r83.g31aca68 - libalpm v11.0.1

Issue

yay -G silently overwrites entire directories.

Steps to reproduce

streetwalrus@Akatsuki:~
$ mkdir fontconfig          
streetwalrus@Akatsuki:~
$ touch fontconfig/asdf
streetwalrus@Akatsuki:~
$ ls fontconfig          
asdf
streetwalrus@Akatsuki:~
$ yay -G fontconfig
:: Querying AUR...
:: Downloaded PKGBUILD from ABS (1/1): fontconfig
streetwalrus@Akatsuki:~
$ ls fontconfig
fontconfig.hook  fontconfig.install  PKGBUILD
Expected Behavior

Most helpful comment

That is an option. Recursively removing a directory without even asking for confirmation is a terrible terrible idea. I think the best way to do this would be to add a -f flag to -G, and refuse overwriting anything without it.

All 2 comments

I purposely made this change of behaviour. It allows you to update pkgbuilds via -G. Otherwise you would have to delete it then run -G.

As a safety feature it could be made to overwrite only if there is a pkgbuild in the directory.

That is an option. Recursively removing a directory without even asking for confirmation is a terrible terrible idea. I think the best way to do this would be to add a -f flag to -G, and refuse overwriting anything without it.

Was this page helpful?
0 / 5 - 0 ratings