dbrtools/dbr/installpatch.py
changeset 200 12422144aae1
parent 179 eab8a264a833
equal deleted inserted replaced
198:04b0678959bf 200:12422144aae1
    13 # Description:
    13 # Description:
    14 # DBR installpatch - installs a patch in the current environment
    14 # DBR installpatch - installs a patch in the current environment
    15 
    15 
    16 import sys
    16 import sys
    17 import os.path
    17 import os.path
    18 #import shutils
    18 import shutil
    19 import dbrutils
    19 import dbrutils
    20 
    20 
    21 
    21 
    22 
    22 
    23 def run(args):
    23 def run(args):
    25     patch = args[0]
    25     patch = args[0]
    26     if(patch):
    26     if(patch):
    27       if(os.path.exists(patch)):
    27       if(os.path.exists(patch)):
    28         patchname = os.path.basename(patch)
    28         patchname = os.path.basename(patch)
    29         if(not os.path.exists(os.path.join(dbrutils.patchpath(),patchname))):
    29         if(not os.path.exists(os.path.join(dbrutils.patchpath(),patchname))):
    30           shutils.copyfile(patch, os.path.join(dbrutils.patchpath(),patchname))
    30           shutil.copyfile(patch, os.path.join(dbrutils.patchpath(),patchname))
    31         files = set();
    31         files = set();
    32         files.add('*')
    32         files.add('*')
    33         dbrutils.extractfromzip(files,os.path.join(dbrutils.patchpath(),patchname))
    33         dbrutils.extractfromzip(files,os.path.join(dbrutils.patchpath(),patchname),'')
    34         print 'Should probably run checkenv now...'
    34         print 'Should probably run checkenv now...'
    35       else:
    35       else:
    36         print 'Cannot find patch zip: %s\n' %patch
    36         print 'Cannot find patch zip: %s\n' %patch
    37         help()
    37         help()
    38     else:
    38     else: