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)        
Beispiel #2
0
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)
Beispiel #3
0
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
Beispiel #4
0
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)
Beispiel #5
0
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()