pmb.build.is_necessary: tweak log msgs (MR 2295)

* Replace aports -> pmaports
* Make the "binary repo has newer version" message much shorter, and
  mention "pmbootstrap pull". If users didn't mess with their pmaports
  repository (checkout a custom branch, make commits), this command
  will update to the latest commit and resolve the warning. This also
  ties into MR 2294 where I removed a feature from "pmbootstrap status"
  that would complain about the last fetch of pmaports.git being too old
  and was also recommending "pmbootstrap pull". I think having it here
  in the warning makes more sense, as more people will see it.
This commit is contained in:
Oliver Smith 2024-04-12 01:48:19 +02:00
parent 21f70e9ba6
commit 08771c2ebc
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 5 additions and 8 deletions

View File

@ -73,18 +73,15 @@ def is_necessary(args, arch, apkbuild, indexes=None):
# a) Binary repo has a newer version
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:"
" <https://postmarketos.org/warning-repo2>"
"".format(package, version_pmaports, version_binary,
version_binary, package))
logging.warning(f"WARNING: about to install {package} {version_binary}"
f" (local pmaports: {version_pmaports}, consider"
" 'pmbootstrap pull')")
return False
# 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})")
logging.debug(f"{msg}binary package out of date (binary: "
f"{version_binary}, local pmaports: {version_pmaports})")
return True
# Local pmaports and binary repo have the same version