83af2c6ad694d3a9dedd1695d16c1d698f32fc97 wong Fri Jan 27 21:25:27 2012 -0800 added md5sum repush options for those rare situations where something changes md5sums between releases, but retains the same filename, also added the outputting of an attic files list diff --git python/lib/ucscgenomics/mkChangeNotes.py python/lib/ucscgenomics/mkChangeNotes.py index 4f14fe5..a8252a2 100644 --- python/lib/ucscgenomics/mkChangeNotes.py +++ python/lib/ucscgenomics/mkChangeNotes.py @@ -177,37 +177,41 @@ cmd = "hgsql %s -e \"SELECT ROUND(data_length/1024/1024,2) total_size_mb, ROUND(index_length/1024/1024,2) total_index_size_mb FROM information_schema.TABLES WHERE %s\"" % (database, orstr) p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True) cmdoutput = p.stdout.read() for i in cmdoutput.split("\n")[1:-1]: fields = i.split() for j in fields: tablesize = tablesize + float(j) return int(math.ceil(tablesize)) def __checkMd5sums(self): (newfiles, oldfiles, loose) = (self.newReleaseFiles, self.oldReleaseFiles, self.loose) errors = [] + repush = set() for i in oldfiles: if i not in newfiles: pass elif re.match('wgEncode.*', i): if oldfiles[i].md5sum != newfiles[i].md5sum: + repush.add(i) errors.append("file: %s have changed md5sums between releases. %s vs %s" % (i, oldfiles[i].md5sum, newfiles[i].md5sum)) if loose: + for i in repush: + del oldfiles[i] return list() else: return errors def __cleanSpecialFiles(self, inlist): specialRemoveList = ['md5sum.history'] for i in specialRemoveList: if i in inlist: inlist.remove(i) return(inlist) def __separateOutAdditional(self): (oldReleaseFiles, totalFiles, newSupplementalSet, oldSupplementalSet) = (self.oldTotalFiles, self.totalFiles, self.newSupplementalSet, self.oldSupplementalSet) additionalList = set() @@ -411,30 +415,34 @@ output.append("New: %s" % len(additionalList)) output.append("Revoked/Replace: %s" % len(removedOther)) output.append("Total: %s" % len(allOther)) if otherprint and not args['summary']: output.append("") output.append("New Other Files (%s):" % len(additionalList)) output.extend(sorted(list(self.newOthers))) output.append("") output.append("Revoked Other Files (%s):" % len(removedOther)) output.extend(ucscUtils.printIter((removedOther), self.releasePath)) output.append("\n") output.extend(self.__addMissingToReport(missingFiles, "Files", self.releasePathOld)) output.append("\n") output.extend(self.__addMissingToReport(self.droppedTables, "Tables")) + output.extend("\n") + if self.atticSet: + output.append("Attic Objects") + output.extend(ucscUtils.printIter((self.atticSet), self.releasePath)) if not args['ignore']: output.append("No Errors") else: output.append("The counts here were generated by ignoring errors, they may not be correct") return output def __printSectionOne(self, output, set, title): output = [] if set: output.append("%s (%s):" % (title, len(set))) output.extend(sorted(list(set))) else: return output output.append("\n")