Ejemplo n.º 1
0
 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))
Ejemplo n.º 2
0
 def sync(self):
         vinfo("Doing overlay syncing")
         try:
                 XTargetBuilder.sync(self)
         except XTargetError, e:
                 if e.log:
                         error(e.log)
                 die(str(e))
Ejemplo n.º 3
0
 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))
Ejemplo n.º 4
0
 def sync(self):
     vinfo("Doing overlay syncing")
     try:
         XTargetBuilder.sync(self)
     except XTargetError, e:
         if e.log:
             error(e.log)
         die(str(e))
Ejemplo n.º 5
0
 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))
Ejemplo n.º 6
0
        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))
Ejemplo n.º 7
0
    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))
Ejemplo n.º 8
0
 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))
Ejemplo n.º 9
0
 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))
Ejemplo n.º 10
0
    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))
Ejemplo n.º 11
0
 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))
Ejemplo n.º 12
0
 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))
Ejemplo n.º 13
0
 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)
Ejemplo n.º 14
0
 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))
Ejemplo n.º 15
0
    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')
Ejemplo n.º 16
0
                        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))
Ejemplo n.º 17
0
 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))
Ejemplo n.º 18
0
 def get(self, key):
     try:
         print "%s" % XTargetBuilder.get(self, key)
     except XTargetError, e:
         die(str(e))
Ejemplo n.º 19
0
 def get(self, key):
         try:
                 print "%s" % XTargetBuilder.get(self, key)
         except XTargetError, e:
                 die(str(e))
Ejemplo n.º 20
0
 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))
Ejemplo n.º 21
0
 def vdb_create(self):
     try:
         vinfo('Building vdb ...')
         XReport.vdb_create(self)
     except XUtilsError, e:
         die(str(e))
Ejemplo n.º 22
0
 def set(self, target_dir):
     try:
         XTargetBuilder.set(self, target_dir)
     except XTargetError, e:
         die(str(e))
Ejemplo n.º 23
0
 def create(self, dest_dir):
     try:
         Xrepo.create(self, dest_dir)
     except XrepoError, e:
         die(str(e))
Ejemplo n.º 24
0
 def set(self, target_dir):
         try:
                 XTargetBuilder.set(self, target_dir)
         except XTargetError, e:
                 die(str(e))
Ejemplo n.º 25
0
                                        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']: