118 #update the touched... |
121 #update the touched... |
119 if(update): |
122 if(update): |
120 for file in sorted(touched): |
123 for file in sorted(touched): |
121 print 'Updating timestamp for: ',file |
124 print 'Updating timestamp for: ',file |
122 db1[file]['time'] = db2[file]['time'] |
125 db1[file]['time'] = db2[file]['time'] |
|
126 |
|
127 def createdb(): |
|
128 print 'creating db...Move CreateDB into dbrutils!!!' |
|
129 env = dbrutils.scanenv() |
|
130 hashes = glob.glob(os.path.join(dbrutils.patchpath(),'*.md5')) |
|
131 for file in hashes: |
|
132 print 'Reading: %s\n' % file |
|
133 dbrutils.gethashes(env, file, False) |
|
134 return env |
|
135 |
|
136 |
|
137 def readzippeddb(drive): |
|
138 env = dict() |
|
139 #Note that this is really crude. I'm seeing if it'll work before cleaning things up... |
|
140 #see if we have a build_md5.zip file |
|
141 md5zip = os.path.join(drive,'build_md5.zip') |
|
142 temp_dir = tempfile.mkdtemp() |
|
143 print temp_dir |
|
144 if(os.path.exists(md5zip)): |
|
145 files = set(); |
|
146 files.add('*') |
|
147 dbrutils.extractfromzip(files,md5zip,temp_dir) |
|
148 globsearch = os.path.join(temp_dir, os.path.join(dbrutils.patch_path_internal(),'*.md5')) |
|
149 print globsearch |
|
150 hashes = glob.glob(globsearch) |
|
151 for file in hashes: |
|
152 print 'Reading: %s\n' % file |
|
153 dbrutils.gethashes(env, file, True) |
|
154 shutil.rmtree(temp_dir) |
|
155 return env |
|
156 |