yay icon indicating copy to clipboard operation
yay copied to clipboard

package from git gets built again, even if it is installed

Open soloturn opened this issue 1 year ago • 3 comments

can yay please notice that a package from git is already installed if the pkgver() function returns the same value of installed package? example, cosmic-comp-git.

❯ yay -Q | grep cosmic
cosmic-comp-git r1155.4f04313-1

❯ yay -S cosmic-comp-git
AUR Dependency (1): cosmic-comp-git-r1128.b3b9ead-1
:: PKGBUILD up to date, skipping download: cosmic-comp-git
  1 cosmic-comp-git                          (Installed) (Build Files Exist)
==> Packages to cleanBuild?

and it would build again and install again. even if the prepare function returns the same version which is already installed:

pkgver() {
  cd "${pkgname%-git}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

soloturn avatar Jul 24 '24 22:07 soloturn

to triage, this should work

Jguer avatar Jul 26 '24 08:07 Jguer

@Jguer the use case is special. the version is calculated from git repository, and is NOT the same as in the AUR PKGBUILD file, as i, as a package maintainer of cosmic-comp-git, do not update the version on every git commit in the upstream repository. but, the version is calculated out of the git hash of the upstream repository. this means, a version is installed, which is different from the one in the AUR.

the case failing is then, if one starts the install again, and the upstream git did NOT change. yay does NOT notice the version is already installed, and does download, compile, etc etc again.

soloturn avatar Jul 26 '24 14:07 soloturn

Observing the same behavior for golden-cheetah-git since a few weeks: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=golden-cheetah-git

It reinstalls even if there are no new commits in the git repository, although it skips the rebuild.

fritzbauer avatar Jul 28 '24 09:07 fritzbauer