pmb.build.is_necessary: tweak comments (MR 2295)

* Remove obvious / not helpful line:
  "# Get package name, version, define start of debug message"
* Remove "old" in "Get old version from APKINDEX" because it may be
  newer than the version in pmaports
* Replace "Aports [folder]" with pmaports (in some parts of pmbootstrap
  code, pmaports is still referred to as aports, this was one of them)
This commit is contained in:
Oliver Smith 2024-04-12 01:38:10 +02:00
parent d55bc245d1
commit 21f70e9ba6
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -52,12 +52,11 @@ def is_necessary(args, arch, apkbuild, indexes=None):
:param indexes: list of APKINDEX.tar.gz paths
:returns: boolean
"""
# Get package name, version, define start of debug message
package = apkbuild["pkgname"]
version_pmaports = apkbuild["pkgver"] + "-r" + apkbuild["pkgrel"]
msg = "Build is necessary for package '" + package + "': "
# Get old version from APKINDEX
# Get version from APKINDEX
index_data = pmb.parse.apkindex.package(args, package, arch, False,
indexes)
if not index_data:
@ -82,13 +81,13 @@ def is_necessary(args, arch, apkbuild, indexes=None):
version_binary, package))
return False
# b) Aports folder has a newer version
# b) Local pmaports has a newer version
if version_pmaports != version_binary:
logging.debug(f"{msg}Binary package out of date (binary: "
f"{version_binary}, aport: {version_pmaports})")
return True
# Aports and binary repo have the same version.
# Local pmaports and binary repo have the same version
return False