Compare commits

..
Author SHA1 Message Date
6d60df4497
pkg.sh: Fix broken version macro expansion
Some checks failed
CI / Packaging test (pull_request) Has been cancelled
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Has been cancelled
CI / Packaging - Kali Linux (pull_request) Has been cancelled
pkg-dist.mk queries the package relations with
--dont-expand-version-macros, and build_pkg() expanded the remaining
VERSION and VERSION-REVISION macros with a local sed-based
expand_version_macros(). That substitutes the version of the project being
built for every macro, instead of the version of the dependency the macro
refers to.

Drop --dont-expand-version-macros from the proj_query calls so the macros
resolve to the dependency's own version, and remove expand_version_macros()
from build_pkg(), which passes the PKG_* variables to rpmbuild as they are
queried.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-09-09 15:27:10 +02:00
a805972a3e
lib.version: Add API docstrings
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m56s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m17s
CI / Packaging test (pull_request) Successful in 0s
The lib.version module carries no documentation: the Syntax, Component and
Boundary types, the Version and Dependency classes and their public methods
are bare, and the compatibility tiers the next_* stepping methods implement
are not documented anywhere.

Add docstrings: a line each for the base.py types, the compatibility
tier table in the Version class, and a short description for every
public method, with the three next_* methods citing the tier each one
steps to.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-09-09 15:27:10 +02:00
3 changed files with 14 additions and 18 deletions

View file

@ -78,13 +78,13 @@ ifeq ($(CREATE_DEVEL),true)
BINARY_PKG += $(DIST_PCKG_DIR)/$(PKG_DEVEL_X86)
endif
PKG_REQUIRES_BUILD += $(call proj_query, pkg-requires --dont-expand-version-macros $(PROJ_QUERY_PKG_REQUIRES_EXTRA_ARGS) build $(PROJECT))
PKG_REQUIRES_RUN += $(call proj_query, pkg-requires --dont-expand-version-macros $(PROJ_QUERY_PKG_REQUIRES_EXTRA_ARGS) run $(PROJECT))
PKG_REQUIRES_DEVEL += $(call proj_query, pkg-requires --dont-expand-version-macros $(PROJ_QUERY_PKG_REQUIRES_EXTRA_ARGS) devel $(PROJECT))
PKG_CONFLICTS_RUN += $(call proj_query, pkg-conflicts --dont-expand-version-macros $(PROJ_QUERY_PKG_CONFLICTS_EXTRA_ARGS) run $(PROJECT))
PKG_CONFLICTS_DEVEL += $(call proj_query, pkg-conflicts --dont-expand-version-macros $(PROJ_QUERY_PKG_CONFLICTS_EXTRA_ARGS) devel $(PROJECT))
PKG_PROVIDES_RUN += $(call proj_query, pkg-provides --dont-expand-version-macros $(PROJ_QUERY_PKG_PROVIDES_EXTRA_ARGS) run $(PROJECT))
PKG_PROVIDES_DEVEL += $(call proj_query, pkg-provides --dont-expand-version-macros $(PROJ_QUERY_PKG_PROVIDES_EXTRA_ARGS) devel $(PROJECT))
PKG_REQUIRES_BUILD += $(call proj_query, pkg-requires $(PROJ_QUERY_PKG_REQUIRES_EXTRA_ARGS) build $(PROJECT))
PKG_REQUIRES_RUN += $(call proj_query, pkg-requires $(PROJ_QUERY_PKG_REQUIRES_EXTRA_ARGS) run $(PROJECT))
PKG_REQUIRES_DEVEL += $(call proj_query, pkg-requires $(PROJ_QUERY_PKG_REQUIRES_EXTRA_ARGS) devel $(PROJECT))
PKG_CONFLICTS_RUN += $(call proj_query, pkg-conflicts $(PROJ_QUERY_PKG_CONFLICTS_EXTRA_ARGS) run $(PROJECT))
PKG_CONFLICTS_DEVEL += $(call proj_query, pkg-conflicts $(PROJ_QUERY_PKG_CONFLICTS_EXTRA_ARGS) devel $(PROJECT))
PKG_PROVIDES_RUN += $(call proj_query, pkg-provides $(PROJ_QUERY_PKG_PROVIDES_EXTRA_ARGS) run $(PROJECT))
PKG_PROVIDES_DEVEL += $(call proj_query, pkg-provides $(PROJ_QUERY_PKG_PROVIDES_EXTRA_ARGS) devel $(PROJECT))
PKG_UPLOAD_OS_NAME = $(shell echo $(OS_NAME_VERSION) | sed 's/-.*//')
PKG_UPLOAD_OS_VERSION = $(shell echo $(OS_NAME_VERSION) | sed 's/[^-]\+-//')

View file

@ -438,16 +438,12 @@ build_pkg()
local tar_archive_orig=$src_base.orig.tar.bz2
local distribution=`get_os`
expand_version_macros() {
echo "$@" | sed "s/__NEXT_VERSION__/$version/g; s/VERSION-REVISION/$version/g; s/VERSION/$version/g"
}
local rpm_requires_run=`expand_version_macros $PKG_REQUIRES_RUN`
local rpm_requires_devel=`expand_version_macros $PKG_REQUIRES_DEVEL`
local rpm_conflicts_run=`expand_version_macros $PKG_CONFLICTS_RUN`
local rpm_conflicts_devel=`expand_version_macros $PKG_CONFLICTS_DEVEL`
local rpm_provides_run=`expand_version_macros $PKG_PROVIDES_RUN`
local rpm_provides_devel=`expand_version_macros $PKG_PROVIDES_DEVEL`
local rpm_requires_run="$PKG_REQUIRES_RUN"
local rpm_requires_devel="$PKG_REQUIRES_DEVEL"
local rpm_conflicts_run="$PKG_CONFLICTS_RUN"
local rpm_conflicts_devel="$PKG_CONFLICTS_DEVEL"
local rpm_provides_run="$PKG_PROVIDES_RUN"
local rpm_provides_devel="$PKG_PROVIDES_DEVEL"
# --- create source directory tree
create_empty_dir $src_tree "Source files compilation directory"

View file

@ -29,8 +29,8 @@ class Boundary(NamedTuple): # export
op: str
version: Version
"""Syntax-aware formatted version comparion operator"""
def format_op(self, syntax: Syntax) -> str:
if syntax is Syntax.DEBIAN:
match self.op: