def sync_overlay(self, dir=None): vinfo("Syncing overlays to release specified revision") try: XTargetBuilder.sync_overlay(self, dir) except XTargetError, e: if e.log: error(e.log) die(str(e))
def sync(self): vinfo("Doing overlay syncing") try: XTargetBuilder.sync(self) except XTargetError, e: if e.log: error(e.log) die(str(e))
def list_profiles(self, pkg_atom=None): verbose = is_verbose() try: tgt_list = XTargetBuilder.list_profiles_ng(self, pkg_atom, version=verbose, filter=self._arch_given) except XTargetError, e: die(str(e))
def __init__(self, arch=None, sync=False, config=None): if is_verbose(): stdout = sys.stdout stderr = sys.stderr else: stdout = stderr = None try: XTargetBuilder.__init__(self, arch, sync, stdout, stderr, config) except XTargetError, e: die(str(e))
def create(self, pkg_atom, arch=None, dir=None): try: target_dir = XTargetBuilder.create(self, pkg_atom, arch, dir) rel = XTargetReleaseParser().get(target_dir, self.cfg['release_file']) if rel.has_key('name') and rel.has_key('version'): target_name = '%s-%s' % (rel['name'], rel['version']) else: target_name = pkg_atom except XTargetError, e: if e.log: error(e.log) die(str(e))
def compare(self): try: vinfo('Loading %s ...' % self.old) self.old_db = self._load(self.old) vinfo('Loading %s ...' % self.new) self.new_db = self._load(self.new) vinfo('Building package databases') XCompare.gen_db(self) vinfo('Starting comparison') XCompare.compare(self) except XUtilsError, e: die(str(e))
def vdb_check(self, _=None): try: vinfo('Building file list ...') XReport.filelist_create(self) vinfo('Checking packages ...', eol=False) XReport.vdb_check(self, self.check_progress) self.end_progress() vinfo('Checking for orphans ...', eol=False) XReport.find_orphans(self, self.check_progress) self.end_progress() except XUtilsError, e: die(str(e))
def delete(self, target_dir=None): if target_dir is None or target_dir == "current": target_dir = get_current_target(config=self.cfg) # check in config cfg = load_config() if cfg['ask_delete'] and not userquery("Are you sure you want to delete %s" % target_dir): info("Abort") return vinfo("Deleting %s" % target_dir) try: XTargetBuilder.delete(self, target_dir) except XTargetError, e: if e.log: error(e.log) die(str(e))
def process(self, compare, output_file=sys.stdout): info('Target comparison: %s -> %s' % (compare.old, compare.new), output=output_file) print('', file=output_file) for pkg_id, pkg in compare.pkg_diff.iteritems(): pkg_name = pkg_id.rsplit(':', 1) if pkg_name is None: die('Internal error when parsing comparison results') out_str = pkg_name[0] if pkg_name[1] != 'None': out_str += '(%s)\n' % pkg_name[1] else: out_str += '\n' out_str += self._process_version(pkg.get('old'), pkg.get('new')) out_str += self._process_flags(pkg.get('use')) info(out_str, output=output_file)
def delete(self, target_dir=None): if target_dir is None or target_dir == "current": target_dir = get_current_target(config=self.cfg) # check in config cfg = load_config() if cfg['ask_delete'] and not userquery( "Are you sure you want to delete %s" % target_dir): info("Abort") return vinfo("Deleting %s" % target_dir) try: XTargetBuilder.delete(self, target_dir) except XTargetError, e: if e.log: error(e.log) die(str(e))
def process(self, compare, output_file=sys.stdout): self._header(output_file) for pkg_id, pkg in compare.pkg_diff.iteritems(): full_name = pkg_id.rsplit(':', 1) if pkg is None: die('Internal error when parsing comparison results') cat, name = full_name[0].split('/') xml_pkg = etree.Element('package', name=name, category=cat) self.packages.append(xml_pkg) child = self._process_version(pkg.get('old'), pkg.get('new')) if child: xml_pkg.append(child) child = self._process_flags(pkg.get('use')) if child: xml_pkg.append(child) self._footer(output_file) indent(self.root) self.tree.write(output_file, 'utf-8')
tgt_visible = " " print " %s=%-30s ARCH=\"%s\" USE=\"%s\"" % ( tgt_visible, target, " ".join(archs), target_info[1]) else: for target, starred in tgt_list: if starred: tgt_visible = color.green(" * ") else: tgt_visible = " " if pkg_atom: pref = '=' else: pref = '' print " %s%s%s" % (tgt_visible, pref, target) except XTargetError, e: die(str(e)) def create(self, pkg_atom, arch=None, dir=None): try: target_dir = XTargetBuilder.create(self, pkg_atom, arch, dir) rel = XTargetReleaseParser().get(target_dir, self.cfg['release_file']) if rel.has_key('name') and rel.has_key('version'): target_name = '%s-%s' % (rel['name'], rel['version']) else: target_name = pkg_atom except XTargetError, e: if e.log: error(e.log) die(str(e))
def get(self, key): try: print "%s" % XTargetBuilder.get(self, key) except XTargetError, e: die(str(e))
def __init__(self, root=None, portage_configroot=None): self.prog_cnt = 0 try: XReport.__init__(self, root, portage_configroot) except XUtilsError, e: die(str(e))
def vdb_create(self): try: vinfo('Building vdb ...') XReport.vdb_create(self) except XUtilsError, e: die(str(e))
def set(self, target_dir): try: XTargetBuilder.set(self, target_dir) except XTargetError, e: die(str(e))
def create(self, dest_dir): try: Xrepo.create(self, dest_dir) except XrepoError, e: die(str(e))
else: tgt_visible = " " print " %s=%-30s ARCH=\"%s\" USE=\"%s\"" % (tgt_visible, target, " ".join(archs), target_info[1]) else: for target, starred in tgt_list: if starred: tgt_visible = color.green(" * ") else: tgt_visible = " " if pkg_atom: pref = '=' else: pref = '' print " %s%s%s" % (tgt_visible, pref, target) except XTargetError, e: die(str(e)) def create(self, pkg_atom, arch=None, dir=None): try: target_dir = XTargetBuilder.create(self, pkg_atom, arch, dir) rel = XTargetReleaseParser().get(target_dir, self.cfg['release_file']) if rel.has_key('name') and rel.has_key('version'): target_name = '%s-%s' % (rel['name'], rel['version']) else: target_name = pkg_atom except XTargetError, e: if e.log: error(e.log) die(str(e)) info("Target %s built in %s" % (target_name, target_dir)) if self.cfg['create_autocurrent']: