Close #256: Implement strict package building mode (#532)

Contrary to abuild, pmbootstrap only installs makedepends, and
keeps the installed packages around - both hacks save lots of time.

However, they may introduce missing makedepends in the APKBUILDs,
that the authors of the APKBUILDs do not notice because it works
for them.

This PR adss a strict mode, which will always clean the chroots
before building a package, and also remove all installed dependencies
after the package was built. You can use the following syntax to
only zap once, but build many packages at once:
`pmbootstrap build --strict hello-world 0xffff heimdall`

It also builds dependencies properly without leaving makedepends
behind.
This commit is contained in:
Oliver Smith 2017-09-08 23:50:59 +00:00 committed by GitHub
parent 9f5607d4c3
commit bed1eacbb5
4 changed files with 34 additions and 10 deletions

View file

@ -231,6 +231,15 @@ def arguments():
build.add_argument("--arch")
build.add_argument("--force", action="store_true")
build.add_argument("--buildinfo", action="store_true")
build.add_argument("--strict", action="store_true", help="(slower) zap and install only"
" required depends when building, to detect dependency errors")
build.add_argument("--noarch-arch", dest="noarch_arch", default=None,
help="which architecture to use to build 'noarch'"
" packages. Defaults to the native arch normally,"
" and to the device arch when --strict is set."
" Override in case of strict mode failing on"
" dependencies, which only exist for a certain"
" arch.")
for action in [checksum, build, aportgen]:
action.add_argument("packages", nargs="+")