Example #1
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)
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 run(args):
  if(len(args)):
    patch = args[0]
    if(patch):
      if(os.path.exists(patch)):
        patchname = os.path.basename(patch)
        if(not os.path.exists(os.path.join(dbrutils.patchpath(),patchname))):
          shutils.copyfile(patch, os.path.join(dbrutils.patchpath(),patchname))
        files = set();
        files.add('*')
        dbrutils.extractfromzip(files,os.path.join(dbrutils.patchpath(),patchname))
        print 'Should probably run checkenv now...'
      else:
        print 'Cannot find patch zip: %s\n' %patch
        help()
    else:
        help()
  else:
   help()
def run(args):
    if len(args):
        patch = args[0]
        if patch:
            if os.path.exists(patch):
                patchname = os.path.basename(patch)
                if not os.path.exists(os.path.join(dbrutils.patchpath(), patchname)):
                    shutils.copyfile(patch, os.path.join(dbrutils.patchpath(), patchname))
                files = set()
                files.add("*")
                dbrutils.extractfromzip(files, os.path.join(dbrutils.patchpath(), patchname))
                print "Should probably run checkenv now..."
            else:
                print "Cannot find patch zip: %s\n" % patch
                help()
        else:
            help()
    else:
        help()