Exemplo n.º 1
0
 def get_dscfile_from_changes(self, changes):
     dscfile = ''
     filenames = get_filenames_with_dcmd(changes)
     for filename in filenames:
         if filename.endswith('.dsc'):
             if not dscfile:
                 dscfile = os.path.basename(filename)
             else:
                 print "Already a dscfile", dscfile
                 print "filename", filename
                 raise RuntimeError, "too many .dsc's"
     if not dscfile:
         raise RuntimeError, "No .dsc found."
     return dscfile
Exemplo n.º 2
0
 def stage_changes(self, source, changes, arch, remove=True):
     if not os.path.isdir(source):
         os.mkdir(source)
     files = get_filenames_with_dcmd(changes)
     arch_only_present = False
     for filename in files:
         if filename.endswith('_%s.deb' % arch):
             arch_only_present = True
         basename = os.path.basename(filename)
         newname = os.path.join(source, basename)
         move = True
         if os.path.isfile(newname):
             move = False
             if remove:
                 print "WARNING: Removing existing file %s" % newname
                 os.remove(newname)
                 move = True
         if move:
             os.rename(filename, newname)
     return arch_only_present