def gensrc(envdir, srcdir, target_arch=None): ''' envdir - directory of pbuilder environment srcdir - directory of unpacked source code ''' # We need to pass -I.git as there are 1.0 packages scriptfile = srcdir.parent / 'gensrc' if target_arch: _expand_build_depends(srcdir / 'debian' / 'control', srcdir.parent / 'control.native', target_arch) controlarg = '-c' + srcdir.parent / 'control.native' else: controlarg = '' with open(scriptfile, 'w') as fh: fh.write(_SCRIPT % (srcdir.parent, controlarg, srcdir.name)) int_exec(envdir, srcdir.parent, scriptfile) with open(srcdir.parent / 'dpkg-source.log', 'r') as fh: for line in fh: m = RE.match(line) if m: return srcdir.parent / m.group(1)
def _cross_deb(envdir, changesfile, fileinfo, target_arch): scriptfile = changesfile.parent / (fileinfo['name'] + 'cross-script') logfile = fileinfo['name'] + '.dpkg-cross.log' with open(scriptfile, 'w') as fh: fh.write(_SCRIPT % (changesfile.parent, target_arch, fileinfo['name'], logfile)) int_exec(envdir, changesfile.parent, scriptfile) with open(changesfile.parent / logfile, 'r') as fh: for line in fh: m = RE.match(line) if m: return changesfile.dirname() / m.group(1)
def prepare(envdir, srcdir, args): if args: scriptfile = srcdir / 'preparesrc' with open(scriptfile, 'w') as fh: fh.write(_SCRIPT % (srcdir, srcdir)) int_exec(envdir, srcdir, scriptfile, args)