dbrtools/dbr/checkenv.py
changeset 200 12422144aae1
parent 179 eab8a264a833
child 203 e274d29c8bc9
equal deleted inserted replaced
198:04b0678959bf 200:12422144aae1
    14 # DBR checkenv - Checks your environment against what was installed
    14 # DBR checkenv - Checks your environment against what was installed
    15 
    15 
    16 import dbrbaseline
    16 import dbrbaseline
    17 import dbrpatch
    17 import dbrpatch
    18 import dbrutils
    18 import dbrutils
    19 import glob
       
    20 
    19 
    21 import os.path
    20 import os.path
    22 
    21 
    23 def main():
    22 def main():
    24     dbfilename = dbrutils.defaultdb()
    23     dbfilename = dbrutils.defaultdb()
    32         baseline = dbrpatch.updatebaseline(baseline, db)
    31         baseline = dbrpatch.updatebaseline(baseline, db)
    33         patches = dbrpatch.updatepatches(patches, db)
    32         patches = dbrpatch.updatepatches(patches, db)
    34 
    33 
    35         dbrpatch.savepatches(patches)        
    34         dbrpatch.savepatches(patches)        
    36     else:
    35     else:
    37         baseline = createdb()
    36         baseline = dbrbaseline.createdb()
    38     dbrbaseline.writedb(baseline,dbfilename)
    37     dbrbaseline.writedb(baseline,dbfilename)
    39 
    38 
    40 def createdb():
       
    41     print 'creating db...Move CreateDB into dbrutils!!!'
       
    42     env = dbrutils.scanenv()
       
    43     hashes = glob.glob(os.path.join(dbrutils.patchpath(),'*.md5'))
       
    44     for file in hashes:
       
    45         print 'Reading: %s\n' % file
       
    46         dbrutils.gethashes(env, file)
       
    47     return env
       
    48 
    39 
    49 def run(args):  
    40 def run(args):  
    50   main()
    41   main()
    51 
    42 
    52 def help():
    43 def help():