2018-08-30 22:39:24 +00:00
|
|
|
#!/usr/bin/env python3
|
2019-01-02 08:29:47 +00:00
|
|
|
# Copyright 2019 Oliver Smith
|
2018-08-30 22:39:24 +00:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2019-05-19 20:18:12 +00:00
|
|
|
# Same dir
|
|
|
|
import common
|
2018-08-30 22:39:24 +00:00
|
|
|
|
|
|
|
|
2019-05-19 20:13:06 +00:00
|
|
|
def check_build(packages, verify_only=False):
|
2018-08-30 22:39:24 +00:00
|
|
|
# Initialize build environment with less logging
|
2019-05-19 20:18:12 +00:00
|
|
|
common.run_pmbootstrap(["build_init"])
|
2019-05-19 20:13:06 +00:00
|
|
|
|
|
|
|
if verify_only:
|
2019-05-19 20:18:12 +00:00
|
|
|
common.run_pmbootstrap(["--details-to-stdout", "checksum",
|
|
|
|
"--verify"] + list(packages))
|
2019-05-19 20:13:06 +00:00
|
|
|
else:
|
2019-05-19 20:18:12 +00:00
|
|
|
common.run_pmbootstrap(["--details-to-stdout", "build", "--strict",
|
|
|
|
"--force"] + list(packages))
|
2018-08-30 22:39:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2019-02-09 21:22:41 +00:00
|
|
|
# Get and print modified packages
|
2019-05-19 20:18:12 +00:00
|
|
|
common.add_upstream_git_remote()
|
|
|
|
packages = common.get_changed_packages()
|
2019-02-09 21:22:41 +00:00
|
|
|
|
|
|
|
# Build changed packages
|
2019-05-19 20:18:12 +00:00
|
|
|
common.get_changed_packages_sanity_check(len(packages))
|
2018-08-30 22:39:24 +00:00
|
|
|
if len(packages) == 0:
|
|
|
|
print("no aports changed in this branch")
|
|
|
|
else:
|
2019-05-19 20:18:12 +00:00
|
|
|
verify_only = common.commit_message_has_string("[ci:skip-build]")
|
2019-05-19 20:13:06 +00:00
|
|
|
if verify_only:
|
|
|
|
print("WARNING: not building changed packages ([ci:skip-build])!")
|
|
|
|
print("verifying checksums: " + ", ".join(packages))
|
|
|
|
else:
|
|
|
|
print("building in strict mode: " + ", ".join(packages))
|
|
|
|
check_build(packages, verify_only)
|