def main(args): zippath = '/' if(len(args)): zippath = args[0] dbfilename = dbrutils.defaultdb() baseline = dbrbaseline.readdb(dbfilename) if(len(baseline ) > 0): env = dbrutils.scanenv() patches = dbrpatch.loadpatches(dbrpatch.dbrutils.patchpath()) db = dbrpatch.createpatchedbaseline(baseline,patches) results = dbrpatch.newupdatedb(db,env) dbrutils.deletefiles(sorted(results['added'])) required = set() required.update(results['removed']) required.update(results['changed']) required.update(results['untestable']) #untestable is going to be a problem... dbrutils.extractfiles(required, zippath) for name in sorted(patches): dbrutils.extractfromzip(required, re.sub('.txt','.zip',name)) env = dbrutils.scanenv() results2 = dbrpatch.newupdatedb(db,env) baseline = dbrpatch.updatebaseline(baseline, db) patches = dbrpatch.updatepatches(patches, db) dbrpatch.savepatches(patches)
def main(args): zippath = '/' if (len(args)): zippath = args[0] dbfilename = dbrutils.defaultdb() baseline = dbrbaseline.readdb(dbfilename) if (len(baseline) > 0): env = dbrutils.scanenv() patches = dbrpatch.loadpatches(dbrpatch.dbrutils.patchpath()) db = dbrpatch.createpatchedbaseline(baseline, patches) results = dbrpatch.newupdatedb(db, env) dbrutils.deletefiles(sorted(results['added'])) required = set() required.update(results['removed']) required.update(results['changed']) required.update( results['untestable']) #untestable is going to be a problem... dbrutils.extractfiles(required, zippath) for name in sorted(patches): dbrutils.extractfromzip(required, re.sub('.txt', '.zip', name)) env = dbrutils.scanenv() results2 = dbrpatch.newupdatedb(db, env) baseline = dbrpatch.updatebaseline(baseline, db) patches = dbrpatch.updatepatches(patches, db) dbrpatch.savepatches(patches)
def createdb(): print 'creating db...Move CreateDB into dbrutils!!!' env = dbrutils.scanenv() hashes = glob.glob(os.path.join(dbrutils.patchpath(),'*.md5')) for file in hashes: print 'Reading: %s\n' % file dbrutils.gethashes(env, file) return env
def main(): dbfilename = dbrutils.defaultdb() baseline = dbrbaseline.readdb(dbfilename) if(len(baseline ) > 0): patches = dbrpatch.loadpatches(dbrpatch.dbrutils.patchpath()) db = dbrpatch.createpatchedbaseline(baseline,patches) env = dbrutils.scanenv() dbrpatch.newupdatedb(db,env) baseline = dbrpatch.updatebaseline(baseline, db) patches = dbrpatch.updatepatches(patches, db) dbrpatch.savepatches(patches) else: baseline = createdb() dbrbaseline.writedb(baseline,dbfilename)
def run(args): if (len(args)): dbfilename = dbrutils.defaultdb() patchname = args[0] if (patchname): print 'Creating Patch:%s\n' % patchname baseline = dbrbaseline.readdb(dbfilename) if (len(baseline) > 0): patches = dbrpatch.loadpatches(dbrpatch.dbrutils.patchpath()) db = dbrpatch.createpatchedbaseline(baseline, patches) env = dbrutils.scanenv() db = dbrpatch.newcreatepatch(patchname, db, env) baseline = dbrpatch.updatebaseline(baseline, db) patches = dbrpatch.updatepatches(patches, db) dbrpatch.savepatches(patches) dbrbaseline.writedb(baseline, dbfilename) else: help() else: help()
def run(args): if(len(args)): dbfilename = dbrutils.defaultdb() patchname = args[0] if(patchname): print 'Creating Patch:%s\n' % patchname baseline = dbrbaseline.readdb(dbfilename) if(len(baseline) > 0): patches = dbrpatch.loadpatches(dbrpatch.dbrutils.patchpath()) db = dbrpatch.createpatchedbaseline(baseline,patches) env = dbrutils.scanenv() db = dbrpatch.newcreatepatch(patchname,db,env) baseline = dbrpatch.updatebaseline(baseline, db) patches = dbrpatch.updatepatches(patches, db) dbrpatch.savepatches(patches) dbrbaseline.writedb(baseline,dbfilename) else: help() else: help()