- # Auto-convert old dak files to new format supporting
- # multiple tarballs
- orig_tar_gz = None
- for dsc_file in self.dsc_files.keys():
- if dsc_file.endswith(".orig.tar.gz"):
- orig_tar_gz = dsc_file
- self.orig_files[orig_tar_gz] = {}
- if next_obj != None:
- self.orig_files[orig_tar_gz]["id"] = next_obj
- next_obj = p.load()
- if next_obj != None and next_obj != "":
- self.orig_files[orig_tar_gz]["location"] = next_obj
- if len(self.orig_files[orig_tar_gz]) == 0:
- del self.orig_files[orig_tar_gz]
-
- dump_file.close()
-
- def sanitised_files(self):
- ret = {}
- for name, entry in self.files.items():
- ret[name] = {}
- for i in CHANGESFIELDS_FILES:
- if entry.has_key(i):
- ret[name][i] = entry[i]
-
- return ret
-
- def sanitised_changes(self):
- ret = {}
- # Mandatory changes fields
- for i in CHANGESFIELDS_MANDATORY:
- ret[i] = self.changes[i]
-
- # Optional changes fields
- for i in CHANGESFIELDS_OPTIONAL:
- if self.changes.has_key(i):
- ret[i] = self.changes[i]
-
- return ret
-
- def sanitised_dsc(self):
- ret = {}
- for i in CHANGESFIELDS_DSC:
- if self.dsc.has_key(i):
- ret[i] = self.dsc[i]
-
- return ret
-
- def sanitised_dsc_files(self):
- ret = {}
- for name, entry in self.dsc_files.items():
- ret[name] = {}
- # Mandatory dsc_files fields
- for i in CHANGESFIELDS_DSCFILES_MANDATORY:
- ret[name][i] = entry[i]
-
- # Optional dsc_files fields
- for i in CHANGESFIELDS_DSCFILES_OPTIONAL:
- if entry.has_key(i):
- ret[name][i] = entry[i]
-
- return ret
-
- def sanitised_orig_files(self):
- ret = {}
- for name, entry in self.orig_files.items():
- ret[name] = {}
- # Optional orig_files fields
- for i in CHANGESFIELDS_ORIGFILES:
- if entry.has_key(i):
- ret[name][i] = entry[i]
-
- return ret
-
- def write_dot_dak(self, dest_dir):
- """
- Dump ourself into a cPickle file.