forked from Mirror/pmbootstrap
pmbootstrap build --src: override source for any package (#1210)
* New "pmbootstrap build --src=/local/source/path hello-world" syntax * The local source path gets mounted inside the chroot * From there, a copy of the source code gets created with rsync (so we can write into the source folder if necessary, for better compatibility with all kinds of APKBUILDs) * After the aport gets copied into the chroot before building (as usually), we extend the APKBUILD with overrides to make it use mountpoint's source instead of downloading the package's source from the web as usually * The package built with the local source gets _pYYYYMMDDHHMMSS appended to the pkgver * linux-postmarketos-mainline: use $builddir, fix patch checksum
This commit is contained in:
parent
42ed5dcb0a
commit
0f371e426f
8 changed files with 276 additions and 17 deletions
|
@ -120,11 +120,17 @@ def build(args):
|
|||
for package in args.packages:
|
||||
_build_device_depends_note(args, package)
|
||||
|
||||
# Set src and force
|
||||
src = os.path.realpath(os.path.expanduser(args.src[0])) if args.src else None
|
||||
force = True if src else args.force
|
||||
if src and not os.path.exists(src):
|
||||
raise RuntimeError("Invalid path specified for --src: " + src)
|
||||
|
||||
# Build all packages
|
||||
for package in args.packages:
|
||||
arch_package = args.arch or pmb.build.autodetect.arch(args, package)
|
||||
if not pmb.build.package(args, package, arch_package, args.force,
|
||||
args.strict):
|
||||
if not pmb.build.package(args, package, arch_package, force,
|
||||
args.strict, src=src):
|
||||
logging.info("NOTE: Package '" + package + "' is up to date. Use"
|
||||
" 'pmbootstrap build " + package + " --force'"
|
||||
" if needed.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue