Changes: * Removed the apkindex_files cache. That particular cache caused bug #189 and didn't bring any real-world performance improvements (tested 3x with that cache and 3x without, no significant speed difference). I decided to remove it instead of keeping it/adding even more code to resolve the bug. * Fix the check for already built packages: always use the architecture, that the package should be built for instead of the architecture of the build environment (e.g. use armhf, even when building a noarch package in the x86_64 chroot). This partially resolves #341. * Make pmb.chroot.apk.install_is_necessary() more robust: If the binary package is missing, although it should be there, print a warning and build it with force.
This commit is contained in:
parent
035e3807b5
commit
21c09b3b3c
|
@ -53,8 +53,7 @@ def package(args, pkgname, carch, force=False, buildinfo=False):
|
||||||
suffix)
|
suffix)
|
||||||
|
|
||||||
# Skip already built versions
|
# Skip already built versions
|
||||||
if not force and not pmb.build.is_necessary(
|
if not force and not pmb.build.is_necessary(args, carch, apkbuild):
|
||||||
args, carch_buildenv, apkbuild):
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# Initialize build environment, install/build makedepends
|
# Initialize build environment, install/build makedepends
|
||||||
|
|
|
@ -122,9 +122,21 @@ def install_is_necessary(args, build, arch, package, packages_installed):
|
||||||
if package not in packages_installed:
|
if package not in packages_installed:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
# Make sure, that we really have a binary package
|
||||||
|
data_repo = pmb.parse.apkindex.read_any_index(args, package, arch)
|
||||||
|
if not data_repo:
|
||||||
|
logging.warning("WARNING: Internal error in pmbootstrap," +
|
||||||
|
" package '" + package + "' for " + arch +
|
||||||
|
" has not been built yet, but it should have"
|
||||||
|
" been. Rebuilding it with force. Please "
|
||||||
|
" report this, if there is no ticket about this"
|
||||||
|
" yet!")
|
||||||
|
pmb.build.package(args, package, arch, True)
|
||||||
|
return install_is_necessary(args, build, arch, package,
|
||||||
|
packages_installed)
|
||||||
|
|
||||||
# Compare the installed version vs. the version in the repos
|
# Compare the installed version vs. the version in the repos
|
||||||
data_installed = packages_installed[package]
|
data_installed = packages_installed[package]
|
||||||
data_repo = pmb.parse.apkindex.read_any_index(args, package, arch)
|
|
||||||
compare = pmb.parse.apkindex.compare_version(data_installed["version"],
|
compare = pmb.parse.apkindex.compare_version(data_installed["version"],
|
||||||
data_repo["version"])
|
data_repo["version"])
|
||||||
# a) Installed newer (should not happen normally)
|
# a) Installed newer (should not happen normally)
|
||||||
|
|
|
@ -128,10 +128,6 @@ def apkindex_files(args, arch=None):
|
||||||
if not arch:
|
if not arch:
|
||||||
arch = args.arch_native
|
arch = args.arch_native
|
||||||
|
|
||||||
# Try to get a cached result first.
|
|
||||||
if arch in args.cache["apkindex_files"]:
|
|
||||||
return args.cache["apkindex_files"][arch]
|
|
||||||
|
|
||||||
# Local user repository (for packages compiled with pmbootstrap)
|
# Local user repository (for packages compiled with pmbootstrap)
|
||||||
ret = [args.work + "/packages/" + arch + "/APKINDEX.tar.gz"]
|
ret = [args.work + "/packages/" + arch + "/APKINDEX.tar.gz"]
|
||||||
|
|
||||||
|
@ -151,5 +147,4 @@ def apkindex_files(args, arch=None):
|
||||||
ret.append(args.work + "/cache_apk_" + arch + "/APKINDEX." +
|
ret.append(args.work + "/cache_apk_" + arch + "/APKINDEX." +
|
||||||
hash(url) + ".tar.gz")
|
hash(url) + ".tar.gz")
|
||||||
|
|
||||||
args.cache["apkindex_files"][arch] = ret
|
|
||||||
return ret
|
return ret
|
||||||
|
|
|
@ -241,7 +241,6 @@ def arguments():
|
||||||
|
|
||||||
# Add a caching dict (caches parsing of files etc. for the current session)
|
# Add a caching dict (caches parsing of files etc. for the current session)
|
||||||
setattr(args, "cache", {"apkindex": {},
|
setattr(args, "cache", {"apkindex": {},
|
||||||
"apkindex_files": {},
|
|
||||||
"apkbuild": {},
|
"apkbuild": {},
|
||||||
"apk_min_version_checked": [],
|
"apk_min_version_checked": [],
|
||||||
"apk_repository_list_updated": [],
|
"apk_repository_list_updated": [],
|
||||||
|
|
Loading…
Reference in New Issue