Пример #1
0
class DebRepos(object):
    def __init__(self):
        object.__init__(self)
        self.cfg = Configuration("repos")
        cfg = self.cfg
        uri = "http://%s:%s" % (cfg["repos_server"], cfg["repos_server_port"])
        print uri
        self.repos = ServerProxy(uri, None, None, 0, allow_none=True)
        self.dpkg = DpkgDeb()
        self.current_suite = None

    def extract_packages(self, packages, path):
        makepaths(path)
        os.system("rm %s/* -fr" % path)
        print "extracting ", ", ".join(packages)
        print "current_suite", self.current_suite
        for package in packages:
            tmp_path = join(path, package)
            makepaths(tmp_path)
            package_path = self.repos.full_path(self.current_suite, package)
            self.dpkg.extract(package_path, tmp_path)
            self.dpkg.control(package_path, tmp_path)

    def set_suite(self, suite):
        self.current_suite = suite
Пример #2
0
class DebRepos(object):
    def __init__(self):
        object.__init__(self)
        self.cfg = Configuration('repos')
        cfg = self.cfg
        uri = 'http://%s:%s' % (cfg['repos_server'], cfg['repos_server_port'])
        print uri
        self.repos = ServerProxy(uri, None, None, 0, allow_none=True)
        self.dpkg = DpkgDeb()
        self.current_suite = None
        
    def extract_packages(self, packages, path):
        makepaths(path)
        gpath = '%s/*' % path
        subprocess.call(['rm', gpath, '-fr'])
        print 'extracting ', ', '.join(packages)
        print 'current_suite', self.current_suite
        for package in packages:
            tmp_path = join(path, package)
            makepaths(tmp_path)
            package_path = self.repos.full_path(self.current_suite, package)
            self.dpkg.extract(package_path, tmp_path)
            self.dpkg.control(package_path, tmp_path)
            
    def set_suite(self, suite):
        self.current_suite = suite