fix(build): allow unstable repositories to override repo target

This works around the fact that we are currently not auto detecting
unstable repository targets while providing a stability layer option on
the subcommand. Soften the --repo option rules by allowing unstable
repositories to use that flag for building and releasing against the
unstable repositories.

This will be replaced in the near future by proper integration of target
repository auto-detection that in aware of unstable repositories while
providing a unstable stability layer options.

Component: pkgctl build
Component: pkgctl release
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
This commit is contained in:
Levente Polyak 2024-02-08 01:15:48 +01:00
parent 3ecba314fc
commit fc05ea19d9
No known key found for this signature in database
GPG Key ID: FC1B547C8D8172C8
2 changed files with 12 additions and 2 deletions

View File

@ -337,7 +337,12 @@ pkgctl_build() {
# fail if an existing package specifies --repo
if [[ -n "${repo}" ]] && [[ -n ${pkgrepo} ]]; then
die 'Using --repo for packages that exist in official repositories is disallowed'
# allow unstable to use --repo
if [[ ${pkgrepo} == *unstable ]]; then
repo=${pkgrepo}
else
die 'Using --repo for packages that exist in official repositories is disallowed'
fi
fi
# assign auto-detected target repository

View File

@ -141,7 +141,12 @@ pkgctl_release() {
# fail if an existing package specifies --repo
if [[ -n "${repo}" ]] && [[ -n ${REPO} ]]; then
die 'Using --repo for packages that exist in official repositories is disallowed'
# allow unstable to use --repo
if [[ ${REPO} == *unstable ]]; then
repo=${REPO}
else
die 'Using --repo for packages that exist in official repositories is disallowed'
fi
fi
# fail if a new package does not specify --repo