From d55bc245d18ebcf0f2a4a27e877d452833cb044d Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Fri, 12 Apr 2024 01:34:18 +0200 Subject: [PATCH] pmb.build.is_necessary: replace version_{new,old} (MR 2295) Give more meaningful names to the variables: * version_new -> version_pmaports * version_old -> version_binary This makes the code less confusing for the case where version_binary is actually newer than version_pmaports. This is a relict from the time before there was a binary package repository, in that case the version from pmaports would always be the newer one, built from source, compared to the local binary package that was probably built before. --- pmb/build/other.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pmb/build/other.py b/pmb/build/other.py index 1c6bafae..44d00e32 100644 --- a/pmb/build/other.py +++ b/pmb/build/other.py @@ -54,7 +54,7 @@ def is_necessary(args, arch, apkbuild, indexes=None): """ # Get package name, version, define start of debug message package = apkbuild["pkgname"] - version_new = apkbuild["pkgver"] + "-r" + apkbuild["pkgrel"] + version_pmaports = apkbuild["pkgver"] + "-r" + apkbuild["pkgrel"] msg = "Build is necessary for package '" + package + "': " # Get old version from APKINDEX @@ -72,20 +72,20 @@ def is_necessary(args, arch, apkbuild, indexes=None): return False # a) Binary repo has a newer version - version_old = index_data["version"] - if pmb.parse.version.compare(version_old, version_new) == 1: + version_binary = index_data["version"] + if pmb.parse.version.compare(version_binary, version_pmaports) == 1: logging.warning("WARNING: package {}: aport version {} is lower than" " {} from the binary repository. {} will be used when" " installing {}. See also:" " " - "".format(package, version_new, version_old, - version_old, package)) + "".format(package, version_pmaports, version_binary, + version_binary, package)) return False # b) Aports folder has a newer version - if version_new != version_old: + if version_pmaports != version_binary: logging.debug(f"{msg}Binary package out of date (binary: " - f"{version_old}, aport: {version_new})") + f"{version_binary}, aport: {version_pmaports})") return True # Aports and binary repo have the same version.