Ejemplo n.º 1
0
 def backup_scripts(self, bkup_path):
     makepaths(join(bkup_path, 'scripts'))
     for row in self.scripts():
         npath = join(bkup_path, 'scripts', row.script)
         nfile = self.scriptfile(row.script)
         filecopy(nfile, npath)
         nfile.close()
Ejemplo n.º 2
0
 def export_scripts(self, bkup_path):
     makepaths(join(bkup_path, 'scripts'))
     for row in self.scripts():
         npath = join(bkup_path, 'scripts', row.script)
         nfile = self.scriptfile(row.script)
         filecopy(nfile, npath)
         nfile.close()
Ejemplo n.º 3
0
 def backup_templates(self, bkup_path):
     makepaths(join(bkup_path, 'templates'))
     for t in self.templates():
         npath = join(bkup_path, 'templates', t.package, t.template)
         tfile = self.templatefile(t.package, t.template)
         makepaths(dirname(npath))
         filecopy(tfile, npath + '.template')
         tfile.close()
Ejemplo n.º 4
0
 def export_templates(self, bkup_path):
     makepaths(join(bkup_path, 'templates'))
     for t in self.templates():
         npath = join(bkup_path, 'templates', t.package, t.template)
         tfile = self.templatefile(t.package, t.template)
         makepaths(dirname(npath))
         filecopy(tfile, npath + '.template')
         tfile.close()
Ejemplo n.º 5
0
 def export_templates(self, bkup_path):
     n = 0
     for t in self.templates():
         npath = join(bkup_path, 'template-%d' % n)
         tfile = self.templatefile(t.package, t.template)
         filecopy(tfile, npath)
         tfile.close()
         n += 1
Ejemplo n.º 6
0
 def export_templates(self, bkup_path):
     n = 0
     for t in self.templates():
         npath = join(bkup_path, 'template-%d' % n)
         tfile = self.templatefile(t.package, t.template)
         filecopy(tfile, npath)
         tfile.close()
         n += 1
Ejemplo n.º 7
0
 def _update_section_(self, section, release=False):
     rpath = self.release.path(section, release=release)
     localpath = pjoin(self.local.source.distpath, rpath)
     url = pjoin(self.source.distpath, rpath)
     status = self.local.check_section(section, release=release)
     if status == 'missing':
         makepaths(dirname(localpath))
         rfile = get_url(url)
         filecopy(rfile, localpath)
     elif status == 'corrupt':
         rfile = get_url(url)
         filecopy(rfile, localpath)
     else:
         print localpath, status
Ejemplo n.º 8
0
 def _update_section_(self, section, release=False):
     rpath = self.release.path(section, release=release)
     localpath = path.join(self.backup.source.distpath, rpath)
     url = path.join(self.local.source.distpath, rpath)
     status = self.backup.check_section(section, release=release)
     if status == 'missing':
         makepaths(path.dirname(localpath))
         rfile = file(url)
         filecopy(rfile, localpath)
     elif status == 'corrupt':
         rfile = file(url)
         filecopy(rfile, localpath)
     else:
         print localpath, status
Ejemplo n.º 9
0
 def update_flatrepos(self):
     rpath = self.release.path(section, release=release)
     localpath = pjoin(self.local.source.distpath, rpath)
     url = pjoin(self.source.distpath, rpath)
     status = self.local.check_section(section, release=release)
     if status == 'missing':
         makepaths(dirname(localpath))
         rfile = get_url(url)
         filecopy(rfile, localpath)
     elif status == 'corrupt':
         rfile = get_url(url)
         filecopy(rfile, localpath)
     else:
         print localpath, status
Ejemplo n.º 10
0
 def update_flatrepos(self):
     rpath = self.release.path(section, release=release)
     localpath = path.join(self.backup.source.distpath, rpath)
     url = path.join(self.local.source.distpath, rpath)
     status = self.backup.check_section(section, release=release)
     if status == 'missing':
         makepaths(path.dirname(localpath))
         rfile = get_url(url)
         filecopy(rfile, localpath)
     elif status == 'corrupt':
         rfile = get_url(url)
         filecopy(rfile, localpath)
     else:
         print localpath, status
Ejemplo n.º 11
0
 def _update_section_(self, section, release=False):
     
     rpath = self.release.path(section, release=release)
     localpath = join(self.local_src.distpath, rpath)
     url = join(self.remote_src.distpath, rpath)
     status = self.local.check_dist_section(section, release=release)
     please_insert = False
     if not self.local._section_.count_rows(section) and not release:
             please_insert = True
     while status in ['missing', 'corrupt']:
         if status == 'missing':
             makepaths(dirname(localpath))
         rfile = get_url(url)
         filecopy(rfile, localpath)
         print localpath, status
         status = self.local.check_dist_section(section, release=release)
     print localpath, status
     if please_insert:
         self.insert_section_data(section)
     elif status == 'corrupt':
         self.insert_section_data(section)
Ejemplo n.º 12
0
 def export_scripts(self, bkup_path):
     for row in self.scripts():
         npath = join(bkup_path, 'script-%s' % row.script)
         nfile = self.scriptfile(row.script)
         filecopy(nfile, npath)
         nfile.close()
Ejemplo n.º 13
0
 def export_scripts(self, bkup_path):
     for row in self.scripts():
         npath = join(bkup_path, 'script-%s' % row.script)
         nfile = self.scriptfile(row.script)
         filecopy(nfile, npath)
         nfile.close()