Fix #68: properly update the device chroot in the install step
* build all dependencies, that have a newer version * upgrade all packages inside the chroot
This commit is contained in:
parent
9e945423d9
commit
f1ab344f09
|
@ -51,16 +51,16 @@ def package(args, pkgname, carch, force=False, recurse=True):
|
||||||
cross = pmb.build.autodetect.crosscompile(args, apkbuild, carch_buildenv,
|
cross = pmb.build.autodetect.crosscompile(args, apkbuild, carch_buildenv,
|
||||||
suffix)
|
suffix)
|
||||||
|
|
||||||
|
# Build dependencies first (they may be outdated, even if they exist)
|
||||||
|
if recurse:
|
||||||
|
for depend in apkbuild["depends"]:
|
||||||
|
package(args, depend, carch)
|
||||||
|
|
||||||
# Skip already built versions
|
# Skip already built versions
|
||||||
if not force and not pmb.build.is_necessary(args, suffix,
|
if not force and not pmb.build.is_necessary(args, suffix,
|
||||||
carch_buildenv, apkbuild):
|
carch_buildenv, apkbuild):
|
||||||
return
|
return
|
||||||
|
|
||||||
# Build dependencies first
|
|
||||||
if recurse:
|
|
||||||
for depend in apkbuild["depends"]:
|
|
||||||
package(args, depend, carch)
|
|
||||||
|
|
||||||
# Install build tools and makedepends
|
# Install build tools and makedepends
|
||||||
pmb.build.init(args, suffix)
|
pmb.build.init(args, suffix)
|
||||||
if len(apkbuild["makedepends"]):
|
if len(apkbuild["makedepends"]):
|
||||||
|
|
|
@ -58,17 +58,23 @@ def install(args, packages, suffix="native", build=True):
|
||||||
pmb.chroot.root(args, ["apk", "--no-progress", "add"] + packages_todo,
|
pmb.chroot.root(args, ["apk", "--no-progress", "add"] + packages_todo,
|
||||||
suffix)
|
suffix)
|
||||||
|
|
||||||
# Update all packages installed in a chroot
|
|
||||||
|
|
||||||
|
def upgrade(args, suffix="native", update_index=True):
|
||||||
def update(args, suffix="native"):
|
"""
|
||||||
|
Upgrade all packages installed in a chroot
|
||||||
|
"""
|
||||||
pmb.chroot.init(args, suffix)
|
pmb.chroot.init(args, suffix)
|
||||||
pmb.chroot.root(args, ["apk", "update"], suffix)
|
if update_index:
|
||||||
|
pmb.chroot.root(args, ["apk", "update"], suffix)
|
||||||
|
|
||||||
# Get all explicitly installed packages
|
# -a: also update previously downgraded (and therefore pinned) packages
|
||||||
|
pmb.chroot.root(args, ["apk", "upgrade", "-a"], suffix)
|
||||||
|
|
||||||
|
|
||||||
def installed(args, suffix="native"):
|
def installed(args, suffix="native"):
|
||||||
|
"""
|
||||||
|
Get all explicitly installed packages
|
||||||
|
"""
|
||||||
world = args.work + "/chroot_" + suffix + "/etc/apk/world"
|
world = args.work + "/chroot_" + suffix + "/etc/apk/world"
|
||||||
if not os.path.exists(world):
|
if not os.path.exists(world):
|
||||||
return []
|
return []
|
||||||
|
|
|
@ -82,12 +82,17 @@ def install(args, show_flash_msg=True):
|
||||||
pmb.chroot.apk.install(args, pmb.config.install_native_packages,
|
pmb.chroot.apk.install(args, pmb.config.install_native_packages,
|
||||||
build=False)
|
build=False)
|
||||||
|
|
||||||
# Install all packages to device rootfs chroot
|
# Explicitly call build on the install packages, to re-build it or any
|
||||||
|
# dependency, in case the version increased
|
||||||
logging.info("*** (2/5) CREATE DEVICE ROOTFS (" + args.device + ") ***")
|
logging.info("*** (2/5) CREATE DEVICE ROOTFS (" + args.device + ") ***")
|
||||||
|
install_packages = pmb.config.install_device_packages + ["device-" + args.device]
|
||||||
|
for pkgname in install_packages:
|
||||||
|
pmb.build.package(args, pkgname, args.deviceinfo["arch"])
|
||||||
|
|
||||||
|
# Install all packages to device rootfs chroot
|
||||||
suffix = "rootfs_" + args.device
|
suffix = "rootfs_" + args.device
|
||||||
pmb.chroot.apk.install(args, pmb.config.install_device_packages +
|
pmb.chroot.apk.install(args, install_packages, suffix)
|
||||||
["device-" + args.device], suffix)
|
pmb.chroot.apk.upgrade(args, suffix)
|
||||||
pmb.chroot.apk.update(args, suffix)
|
|
||||||
set_user_password(args)
|
set_user_password(args)
|
||||||
|
|
||||||
# Partition and fill image/sdcard
|
# Partition and fill image/sdcard
|
||||||
|
|
Loading…
Reference in New Issue