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)        
Example #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)
Example #3
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)
Example #4
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()