97 os.unlink(file) |
100 os.unlink(file) |
98 |
101 |
99 |
102 |
100 def getzippedDB(location): |
103 def getzippedDB(location): |
101 db = dict() |
104 db = dict() |
|
105 temp_dir = tempfile.mkdtemp() |
102 md5zip = os.path.join(location,'build_md5.zip') |
106 md5zip = os.path.join(location,'build_md5.zip') |
|
107 if(re.match('^http',location, re.IGNORECASE)): |
|
108 md5zip = os.path.join(temp_dir,'build_md5.zip') |
|
109 url = '%s%s' % (location,'build_md5.zip') |
|
110 res = urllib.urlretrieve(url,md5zip) |
103 print md5zip |
111 print md5zip |
104 temp_dir = tempfile.mkdtemp() |
|
105 print temp_dir |
112 print temp_dir |
106 if(os.path.exists(md5zip)): |
113 if(os.path.exists(md5zip)): |
107 files = set(); |
114 files = set(); |
108 files.add('*') |
115 files.add('*') |
109 extractfromzip(files,md5zip,temp_dir) |
116 extractfromzip(files,md5zip,temp_dir) |
110 globsearch = os.path.join(temp_dir, os.path.join(patch_path_internal(),'*.md5')) |
117 globsearch = os.path.join(temp_dir, os.path.join(patch_path_internal(),'*.md5')) |
111 print globsearch |
118 # print globsearch |
112 hashes = glob.glob(globsearch) |
119 hashes = glob.glob(globsearch) |
113 for file in hashes: |
120 for file in hashes: |
114 # print 'Reading: %s\n' % file |
121 # print 'Reading: %s\n' % file |
115 gethashes(db, file, True) |
122 gethashes(db, file, True) |
116 shutil.rmtree(temp_dir) |
123 shutil.rmtree(temp_dir) |