def checkout( self, root=None, tag=None, date=None, az=None, ## Native path nonrecursive=None, zap=None, download_only=None, system_id=None, profile=None, build_type=None): import distributions import cvs import shell try: if self.checkin_dep_only: return except AttributeError: pass if self.type == "cvs": distributions.setup() tmpdir = distributions.tmpdir() tmpdir = os.path.join(tmpdir, "module") cvs.Checkout(tag or self.cvs_tag, self.cvs_path or self.name, root or self.cvs_root, tmpdir, date or self.cvs_date, nonrecursive, zap) if ((tag or self.cvs_tag) and (date or self.cvs_date) and not os.path.exists(tmpdir)): cvs.Checkout(self.cvs_tag, self.cvs_path or self.name, root or self.cvs_root, tmpdir, self.cvs_date, nonrecursive, zap) if not os.path.exists(tmpdir): raise cvs.cvs_error shell.mkdir(os.path.dirname(az or self.path())) os.rename(tmpdir, az or self.path()) distributions.cleanup() elif self.type == "distribution": df = distributions.DistFinder(self.name, root or self.cvs_root, tag or self.tag, date or self.cvs_date) fun = df.get_distribution if download_only: fun = df.download_distribution if not system_id: system_id = sysinfo.id return df.get_distribution( sysinfo.PLATFORM_HASH.get(system_id).distribution_id, profile, build_type)
def checkout(self, tag, module_list, az=None, timestamp=None, nonrecursive=0, checkout_dir=None): log.trace( 'entry', [tag, module_list, az, timestamp, nonrecursive, checkout_dir]) import distributions if not checkout_dir: checkout_dir = "." if az: tmpdirbase = os.path.join(checkout_dir, os.path.dirname(az), "cvs") else: tmpdirbase = os.path.join(checkout_dir, "cvs") distributions.setup(tmpdirbase) tmpdir = distributions.tmpdir(tmpdirbase) if az: t = os.path.join(tmpdir, "tmp") self.update(tag, module_list, t, timestamp, nonrecursive) if os.path.exists(t): utils.mkdirTree(os.path.dirname(az)) outmsg.verbose("Moving %s to %s" % (t, az)) shell.move(t, az) else: out_dirs = self.update(tag, module_list, az, timestamp, nonrecursive, tmpdir) #print out_dirs for d in out_dirs: rl = os.path.join(checkout_dir, d[len(tmpdir) + 1:]) if os.path.exists(d): outmsg.verbose("Moving %s to %s" % (d, rl)) utils.mkdirTree(os.path.dirname(rl)) if d[len(tmpdir) + 1:] == ".": for tmp in os.listdir(d): outmsg.verbose( "Moving %s to %s" % (os.path.join(d, tmp), os.path.join(rl, tmp))) shell.move(os.path.join(d, tmp), os.path.join(rl, tmp)) else: shell.move(d, rl) else: print "%s does not exists" % d distributions.cleanup(tmpdirbase) log.trace('exit')
def checkout(self, tag, module_list, az = None, timestamp = None, nonrecursive = 0, checkout_dir = None): log.trace( 'entry' , [ tag , module_list , az , timestamp , nonrecursive , checkout_dir ] ) import distributions if not checkout_dir: checkout_dir="." if az: tmpdirbase=os.path.join(checkout_dir, os.path.dirname(az), "cvs") else: tmpdirbase=os.path.join(checkout_dir, "cvs") distributions.setup(tmpdirbase) tmpdir=distributions.tmpdir(tmpdirbase) if az: t=os.path.join(tmpdir,"tmp") self.update( tag, module_list,t , timestamp, nonrecursive) if os.path.exists(t): utils.mkdirTree(os.path.dirname(az)) outmsg.verbose("Moving %s to %s" % (t,az)) shell.move(t, az) else: out_dirs=self.update( tag, module_list, az, timestamp, nonrecursive, tmpdir) #print out_dirs for d in out_dirs: rl=os.path.join(checkout_dir, d[len(tmpdir)+1:]) if os.path.exists(d): outmsg.verbose("Moving %s to %s" % (d, rl)) utils.mkdirTree(os.path.dirname(rl)) if d[len(tmpdir)+1:] == ".": for tmp in os.listdir(d): outmsg.verbose("Moving %s to %s" % (os.path.join(d,tmp), os.path.join(rl, tmp))) shell.move(os.path.join(d,tmp), os.path.join(rl, tmp)) else: shell.move(d, rl) else: print "%s does not exists" % d distributions.cleanup(tmpdirbase) log.trace( 'exit' )
def checkout(self, root=None, tag=None, date=None, az=None, ## Native path nonrecursive = None, zap=None, download_only=None, system_id=None, profile=None, build_type=None): import distributions import cvs import shell try: if self.checkin_dep_only: return except AttributeError: pass if self.type == "cvs": distributions.setup() tmpdir=distributions.tmpdir() tmpdir=os.path.join(tmpdir,"module") cvs.Checkout(tag or self.cvs_tag, self.cvs_path or self.name, root or self.cvs_root, tmpdir, date or self.cvs_date, nonrecursive, zap) if ( ( tag or self.cvs_tag) and (date or self.cvs_date) and not os.path.exists(tmpdir) ): cvs.Checkout(self.cvs_tag, self.cvs_path or self.name, root or self.cvs_root, tmpdir, self.cvs_date, nonrecursive, zap) if not os.path.exists(tmpdir): raise cvs.cvs_error shell.mkdir(os.path.dirname(az or self.path())) os.rename(tmpdir, az or self.path()) distributions.cleanup() elif self.type == "distribution": df=distributions.DistFinder(self.name, root or self.cvs_root, tag or self.tag, date or self.cvs_date) fun = df.get_distribution if download_only: fun=df.download_distribution if not system_id: system_id = sysinfo.id return df.get_distribution( sysinfo.PLATFORM_HASH.get(system_id).distribution_id, profile, build_type)