2022-01-02 21:38:21 +00:00
|
|
|
# Copyright 2022 Oliver Smith
|
2020-02-20 20:07:28 +00:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
2017-05-26 20:35:21 +00:00
|
|
|
import logging
|
|
|
|
|
|
|
|
import pmb.chroot
|
|
|
|
import pmb.build
|
|
|
|
import pmb.helpers.run
|
2018-11-15 07:30:49 +00:00
|
|
|
import pmb.helpers.pmaports
|
2017-05-26 20:35:21 +00:00
|
|
|
|
|
|
|
|
2019-05-24 20:41:31 +00:00
|
|
|
def update(args, pkgname):
|
2019-05-19 20:04:55 +00:00
|
|
|
""" Fetch all sources and update the checksums in the APKBUILD. """
|
2017-05-26 20:35:21 +00:00
|
|
|
pmb.build.init(args)
|
|
|
|
pmb.build.copy_to_buildpath(args, pkgname)
|
|
|
|
logging.info("(native) generate checksums for " + pkgname)
|
|
|
|
pmb.chroot.user(args, ["abuild", "checksum"],
|
2017-10-12 20:08:10 +00:00
|
|
|
working_dir="/home/pmos/build")
|
2017-05-26 20:35:21 +00:00
|
|
|
|
|
|
|
# Copy modified APKBUILD back
|
2017-10-12 20:08:10 +00:00
|
|
|
source = args.work + "/chroot_native/home/pmos/build/APKBUILD"
|
2018-11-15 07:30:49 +00:00
|
|
|
target = pmb.helpers.pmaports.find(args, pkgname) + "/"
|
2017-05-26 20:35:21 +00:00
|
|
|
pmb.helpers.run.user(args, ["cp", source, target])
|
2019-05-19 20:04:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
def verify(args, pkgname):
|
|
|
|
""" Fetch all sources and verify their checksums. """
|
|
|
|
pmb.build.init(args)
|
|
|
|
pmb.build.copy_to_buildpath(args, pkgname)
|
|
|
|
logging.info("(native) verify checksums for " + pkgname)
|
|
|
|
|
|
|
|
# Fetch and verify sources, "fetch" alone does not verify them:
|
|
|
|
# https://github.com/alpinelinux/abuild/pull/86
|
|
|
|
pmb.chroot.user(args, ["abuild", "fetch", "verify"],
|
|
|
|
working_dir="/home/pmos/build")
|