예제 #1
0
 def sync(self):
         vinfo("Doing overlay syncing")
         try:
                 XTargetBuilder.sync(self)
         except XTargetError, e:
                 if e.log:
                         error(e.log)
                 die(str(e))
예제 #2
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))
예제 #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))
예제 #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))
예제 #5
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))
예제 #6
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))
예제 #7
0
 def info(self):
         def report_path(m, v):
                 if v in self.cfg:
                         f = self.cfg.get(v)
                         print m, f,
                         print " (exists)" if os.path.exists(f) else " (doesn't exist)"
                 else:
                         print m, 'undefined'
         vinfo('Retrieving information for xtarget')
         report_path("Targets overlay:", 'ov_path')
         report_path("Targets directory:", 'targets_dir')
         print "Sync protocol:", self.cfg.get('ov_proto', 'undefined')
         print "Sync URI:", self.cfg.get('ov_uri', 'undefined')
         print "Sync branch:", self.cfg.get('ov_branch', 'undefined')
         print "Sync revision:", self.cfg.get('ov_rev', 'undefined')
         report_path("Targets release file:", 'release_file')
         report_path("Targets overlay file:", 'ov_config')
예제 #8
0
    def info(self):
        def report_path(m, v):
            if v in self.cfg:
                f = self.cfg.get(v)
                print m, f,
                print " (exists)" if os.path.exists(f) else " (doesn't exist)"
            else:
                print m, 'undefined'

        vinfo('Retrieving information for xtarget')
        report_path("Targets overlay:", 'ov_path')
        report_path("Targets directory:", 'targets_dir')
        print "Sync protocol:", self.cfg.get('ov_proto', 'undefined')
        print "Sync URI:", self.cfg.get('ov_uri', 'undefined')
        print "Sync branch:", self.cfg.get('ov_branch', 'undefined')
        print "Sync revision:", self.cfg.get('ov_rev', 'undefined')
        report_path("Targets release file:", 'release_file')
        report_path("Targets overlay file:", 'ov_config')
예제 #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))
예제 #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))
예제 #11
0
 def vinfo(self, msg, eol=True):
     vinfo(msg, eol)
     if eol:
         print(msg, file=self.log_fd)
     else:
         print(msg, file=self.log_fd, end='')
예제 #12
0
 def vdb_create(self):
     try:
         vinfo('Building vdb ...')
         XReport.vdb_create(self)
     except XUtilsError, e:
         die(str(e))