Example #1
0
def install(package):
  package_name = package['package'] + '-' + package['version']
  stamp = package_name + '.stamp'
  if not os.path.isfile(os.path.join(build_path, stamp)):
    tfile = package_name + '.tar.gz'
    url = package['source'] + tfile
    bt.show_variable('url', url)
    try:
      wgetter.download(url, outdir=build_path)
    except urllib2.HTTPError:
      print 'Got blocked. Trying manual wget'
      os.chdir(os.path.join(build_path))
      bt.call_verbose(['wget', url])
    tar = tarfile.open(name=os.path.join(build_path, tfile), mode='r:gz')
    tar.extractall(path=build_path)
    os.chdir(os.path.join(build_path, package_name))
    prefix = '--prefix=' + os.path.join(install_path)
    bt.call_verbose(['./configure', prefix] + package['configure_options'])
    bt.call_verbose(['make', '-j', jobs])
    bt.call_verbose(['make', 'install'])
    bt.call_verbose(['make', '-j', jobs, 'check'])
    os.chdir(build_path)
    with open(stamp, 'a'):
      os.utime(stamp, None)
Example #2
0
def _call_verbose(cmd):
  lines_to_show = ['Package name:', 'Version:', 'Date:', 'Status:', 'version',
                   ' path.', ' path ', 'checking for ']
  bt.call_verbose(cmd, filter_strgs=lines_to_show, show_errors=args.errors)