yay
yay copied to clipboard
yay -Bi destroys the PKGBUILD when cleanbuilding
Affected Version
yay v12.3.5 - libalpm v14.0.0
Describe the bug
When using yay -Bi ./
to build a local PKGBUILD in the current directory, if the user selects to cleanbuild all packages yay errors out saying that PKGBUILD does not exist
and when you check the current directory the PKGBUILD will have disappeared.
Reproduction Steps
- Create a custom PKGBUILD in a local directory
- Change to that directory
- Run
yay -Bi ./
- select "a" on
Packages to cleanBuild?
Expected behavior
Do not destroy the PKGBUILD, and cleanbuild all the dependencies required for installation.
Output
yay -Bi ./
SRCINFO Explicit (1): illogical-impulse-pymc-aur-meta-1.0-1
1 illogical-impulse-pymc-aur-meta (Installed) (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> a
:: Deleting (1/1): ./
HEAD is now at e5339a1 hyprlock: use xdg dir properly (#549)
Refusing to remove current working directory
Removing ./PKGBUILD
Removing ./.SRCINFO
1 illogical-impulse-pymc-aur-meta (Installed) (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> n
==> ERROR: PKGBUILD does not exist.
-> error downloading sources: ./
context: exit status 12
:: (1/1) Parsing SRCINFO: illogical-impulse-pymc-aur-meta
-> failed to parse illogical-impulse-pymc-aur-meta: Unable to read file: .SRCINFO: open .SRCINFO: no such file or directorygoroutine 1 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:24 +0x5e
main.main.func2()
github.com/Jguer/yay/v12/main.go:125 +0x45
panic({0x636715ebf6c0?, 0xc000302100?})
runtime/panic.go:770 +0x132
github.com/Jguer/yay/v12/pkg/sync/srcinfo.NewService({0x636715f400f0, 0xc00012c240}, 0xc000142200, 0xc000322000, {0x636715f3da78, 0xc0000f6480}, {0x636715f3ca50, 0xc00007f740}, 0xc00030c450)
github.com/Jguer/yay/v12/pkg/sync/srcinfo/service.go:37 +0x1c7
github.com/Jguer/yay/v12/pkg/sync.(*OperationService).Run(0xc00030c240, {0x636715f3b850, 0x636716234c00}, 0xc000129420, 0xc00014dc50, {0xc000304028, 0x1, 0x1}, {0x636716234c00, 0x0, ...})
github.com/Jguer/yay/v12/pkg/sync/sync.go:74 +0xdbf
main.installLocalPKGBUILD({0x636715f3b850, 0x636716234c00}, 0xc000129420, 0xc00014dc50, {0x636715f400f0, 0xc00012c240})
github.com/Jguer/yay/v12/local_install.go:103 +0x94e
main.handleBuild({0x636715f3b850, 0x636716234c00}, 0xc000129420, {0x636715f400f0, 0xc00012c240}, 0xc00014dc50)
github.com/Jguer/yay/v12/cmd.go:333 +0x113
main.handleCmd({0x636715f3b850, 0x636716234c00}, 0xc000129420, 0xc00014dc50, {0x636715f400f0, 0xc00012c240})
github.com/Jguer/yay/v12/cmd.go:174 +0x36f
main.main()
github.com/Jguer/yay/v12/main.go:131 +0x69f