Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Update PKGBUILD version info of -git packages match last build #92

Open
xiota opened this issue Sep 21, 2023 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@xiota
Copy link
Contributor

xiota commented Sep 21, 2023

Would also be nice for packages with pkgver() to set pkgver, pkgrel, epoch to match the last build. That should allow bumps to work for -git packages.

The presence of pkgver() would be checked only. It does not have to be run. The problem with -git packages is pkgver and pkgrel often contain some old version that is updated by pkgver(), which prevents bumps from working.

@dr460nf1r3
Copy link
Member

Do you have proposed changes?

@dr460nf1r3 dr460nf1r3 added the enhancement New feature or request label Sep 23, 2023
@xiota
Copy link
Contributor Author

xiota commented Oct 17, 2023

No proposed changes yet... But relevant section is probably:

function interference-bump() {
set -euo pipefail
local _PACKAGES _PKGTAG _VERSION _BUMPSFILE _BUMPS _BUMP
_BUMPSFILE="${CAUR_INTERFERE}/PKGREL_BUMPS"
if [ -f "${_BUMPSFILE}" ]; then
_BUMPS=$(<"${_BUMPSFILE}")
else
_BUMPS=""
fi
_PACKAGES="$(repoctl list -v)"
# Clear old bumps
while IFS= read -r _BUMP; do
_PKGTAG=${_BUMP%% *}
_VERSION="$(awk -v pkgtag="${_PKGTAG}" '$1==pkgtag { print $NF; exit }' <<<"${_PACKAGES}")"
local _INTERNALVERSION _INTERNALBUMPCOUNT
IFS=";" read -r _INTERNALVERSION _INTERNALBUMPCOUNT <<<"$(awk -v pkgtag="${_PKGTAG}" '$1==pkgtag { print $2 ";" $3; exit }' <<<"${_BUMPS}")"
if [[ -z "${_INTERNALVERSION}" ]] || [[ -z "${_INTERNALBUMPCOUNT}" ]]; then
continue
fi
if [[ "$(vercmp "${_VERSION}" "${_INTERNALVERSION}.${_INTERNALBUMPCOUNT}")" -gt 0 ]]; then
_BUMPS="$(awk -v pkgtag="$_PKGTAG" '/^$/ {next} $1==pkgtag { next } 1' <<<"${_BUMPS}")"
fi
done <<<"$_BUMPS"
# Add/increase existing bumps
for _PKGTAG in "$@"; do
_VERSION="$(awk -v pkgtag="${_PKGTAG}" '$1==pkgtag { print $NF; exit }' <<<"${_PACKAGES}")"
if [ -z "${_VERSION}" ]; then
echo "Package ${_PKGTAG} not found in repo" >&2
return 1
fi
_VERSION="${_VERSION##* }"
_BUMPS="$(awk -v pkgtag="$_PKGTAG" -v version="$_VERSION" '/^$/ {next} $1==pkgtag { if (!set) { print $1 " " $2 " " $3+1; set=1 }; next } ENDFILE { if (!set) { print pkgtag " " version " " "1" }; exit } 1' <<<"${_BUMPS}")"
done
echo "${_BUMPS}"
echo "${_BUMPS}" >"${_BUMPSFILE}"
interfere-push-bumps || interfere-sync
return 0
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants