From 595d17abea232345cf4475206363de7c379c3211 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Fri, 25 Dec 2015 18:28:27 -0500 Subject: Initial support for pbuilder. Note: pbuilder --create does not work well with relative build path, base.tgz creation fails. This led to the build_dir path being absolute. Perhaps we should make it more granular and only use absolute paths for pbuilder options. --- scripts/pbuilder-setup | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 scripts/pbuilder-setup (limited to 'scripts/pbuilder-setup') diff --git a/scripts/pbuilder-setup b/scripts/pbuilder-setup new file mode 100755 index 00000000..264db0b2 --- /dev/null +++ b/scripts/pbuilder-setup @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +import sys +import os +import json +import distutils.dir_util + +import pystache + +import defaults +import util + +util.check_build_config() + +pbuilder_create_cmd_tmpl= """ + sudo pbuilder --create \ + --configfile {{pbuilder_config}} +""" + +with open(defaults.BUILD_CONFIG, 'r') as f: + build_config = json.load(f) + +pbuilder_create_command = pystache.render(pbuilder_create_cmd_tmpl, build_config) + +print("Creating a pbuilder environment") +#os.chdir(defaults.BUILD_DIR) + +distutils.dir_util.mkpath(defaults.PBUILDER_DIR) + +result = os.system(pbuilder_create_command) +if result > 0: + print("pbuilder environment bootstrap failed") + sys.exit(1) + -- cgit v1.2.3