forked from Mirror/pmbootstrap
* postmarketos-splash: change arch from "all" to "noarch" * lg-mako: use .tar.gz instead of .zip (because that's the reference APKBUILD) * #220: Allow specifying multiple packages for checksum, build, aportgen * #239: Add chroot shortcuts (--rootfs and --buildroot) * Show chroot and command before entering chroot
This commit is contained in:
parent
81d8acd536
commit
2cabe1d51a
4 changed files with 48 additions and 18 deletions
|
@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
|
|||
along with pmbootstrap. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import json
|
||||
import pmb.aportgen
|
||||
import pmb.build
|
||||
|
@ -35,17 +36,31 @@ import pmb.install
|
|||
import pmb.parse
|
||||
|
||||
|
||||
def _parse_suffix(args):
|
||||
if args.rootfs:
|
||||
return "rootfs_" + args.device
|
||||
elif args.buildroot:
|
||||
return "buildroot_" + args.deviceinfo["arch"]
|
||||
elif args.suffix:
|
||||
return args.suffix
|
||||
else:
|
||||
return "native"
|
||||
|
||||
|
||||
def aportgen(args):
|
||||
pmb.aportgen.generate(args, args.package)
|
||||
for package in args.packages:
|
||||
pmb.aportgen.generate(args, package)
|
||||
|
||||
|
||||
def build(args):
|
||||
pmb.build.package(args, args.package, args.arch, args.force,
|
||||
args.buildinfo)
|
||||
for package in args.packages:
|
||||
pmb.build.package(args, package, args.arch, args.force,
|
||||
args.buildinfo)
|
||||
|
||||
|
||||
def build_init(args):
|
||||
pmb.build.init(args, args.suffix)
|
||||
suffix = _parse_suffix(args)
|
||||
pmb.build.init(args, suffix)
|
||||
|
||||
|
||||
def challenge(args):
|
||||
|
@ -53,12 +68,15 @@ def challenge(args):
|
|||
|
||||
|
||||
def checksum(args):
|
||||
pmb.build.checksum(args, args.package)
|
||||
for package in args.packages:
|
||||
pmb.build.checksum(args, package)
|
||||
|
||||
|
||||
def chroot(args):
|
||||
pmb.chroot.apk.check_min_version(args, args.suffix)
|
||||
pmb.chroot.root(args, args.command, args.suffix, log=False)
|
||||
suffix = _parse_suffix(args)
|
||||
pmb.chroot.apk.check_min_version(args, suffix)
|
||||
logging.info("(" + suffix + ") % " + " ".join(args.command))
|
||||
pmb.chroot.root(args, args.command, suffix, log=False)
|
||||
|
||||
|
||||
def index(args):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue