author | MattD <mattd@symbian.org> |
Sun, 13 Jun 2010 20:39:03 +0100 | |
branch | DBRToolsDev |
changeset 285 | 6a928cf9e181 |
parent 284 | 0792141abac7 |
permissions | -rw-r--r-- |
203
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
1 |
# Copyright (c) 2010 Symbian Foundation Ltd |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
2 |
# This component and the accompanying materials are made available |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
3 |
# under the terms of the License "Eclipse Public License v1.0" |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
4 |
# which accompanies this distribution, and is available |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
5 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html". |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
6 |
# |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
7 |
# Initial Contributors: |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
8 |
# Symbian Foundation Ltd - initial contribution. |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
9 |
# |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
10 |
# Contributors: |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
11 |
# mattd <mattd@symbian.org> |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
12 |
# |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
13 |
# Description: |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
14 |
# DBREnv - OO rewrite of the Environments |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
15 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
16 |
#I'm using the existing stuff as helpers until things get relocated... |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
17 |
import os.path |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
18 |
import glob |
285
6a928cf9e181
diffenv - Added some basic support for diffing with zipped builds over http (such as the internal foundation builds). for example: dbr diffenv 'http://builds.symbian.org/SF_builds/symbian3/builds/FCL/symbian3_FCL.single.555/'
MattD <mattd@symbian.org>
parents:
284
diff
changeset
|
19 |
import re |
203
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
20 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
21 |
import dbrutils |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
22 |
import dbrbaseline |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
23 |
import dbrpatch |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
24 |
|
242
9fd4819bf104
DBRTools - Added filtering support. It's currently implmented in checkenv and diffenv, but adding it to other commands is pretty easy.
MattD <mattd@symbian.org>
parents:
217
diff
changeset
|
25 |
import dbrresults |
9fd4819bf104
DBRTools - Added filtering support. It's currently implmented in checkenv and diffenv, but adding it to other commands is pretty easy.
MattD <mattd@symbian.org>
parents:
217
diff
changeset
|
26 |
import dbrfilter |
203
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
27 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
28 |
def CreateDB(location): #virtual constructor |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
29 |
print location |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
30 |
# print dbrutils.patch_path_internal() |
208
01c2b1268053
Embryonic support for filtering. Can now use a file list with diffenv to filter the results.
MattD <mattd@symbian.org>
parents:
203
diff
changeset
|
31 |
if(os.path.isfile(os.path.join(location,dbrutils.defaultdb()))): |
203
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
32 |
# print 'loading baseline environment' |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
33 |
# return DBRBaselineEnv(location) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
34 |
print 'loading patched baseline environment' |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
35 |
return DBRPatchedBaselineEnv(location) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
36 |
if(os.path.exists(os.path.join(location,'build_md5.zip'))): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
37 |
print 'loading zipped environment' |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
38 |
return DBRZippedEnv(location) |
285
6a928cf9e181
diffenv - Added some basic support for diffing with zipped builds over http (such as the internal foundation builds). for example: dbr diffenv 'http://builds.symbian.org/SF_builds/symbian3/builds/FCL/symbian3_FCL.single.555/'
MattD <mattd@symbian.org>
parents:
284
diff
changeset
|
39 |
if(re.match('http://.+',location, re.IGNORECASE)): |
6a928cf9e181
diffenv - Added some basic support for diffing with zipped builds over http (such as the internal foundation builds). for example: dbr diffenv 'http://builds.symbian.org/SF_builds/symbian3/builds/FCL/symbian3_FCL.single.555/'
MattD <mattd@symbian.org>
parents:
284
diff
changeset
|
40 |
print 'loading remote zipped environment' |
6a928cf9e181
diffenv - Added some basic support for diffing with zipped builds over http (such as the internal foundation builds). for example: dbr diffenv 'http://builds.symbian.org/SF_builds/symbian3/builds/FCL/symbian3_FCL.single.555/'
MattD <mattd@symbian.org>
parents:
284
diff
changeset
|
41 |
return DBRZippedEnv(location) |
203
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
42 |
if(os.path.exists(os.path.join(location,dbrutils.patch_path_internal()))): #should do something more fun with creating a basleine if we have MD5s |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
43 |
print 'loading new env...warning: this is only here for compatibility' |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
44 |
return DBRNewLocalEnv(location) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
45 |
if(os.path.exists(os.path.join(location,'epoc32'))): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
46 |
print 'loading localenv' |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
47 |
return DBRLocalEnv(location) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
48 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
49 |
return DBREnv(location) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
50 |
|
242
9fd4819bf104
DBRTools - Added filtering support. It's currently implmented in checkenv and diffenv, but adding it to other commands is pretty easy.
MattD <mattd@symbian.org>
parents:
217
diff
changeset
|
51 |
#Basic DBREnv definition |
203
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
52 |
class DBREnv: |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
53 |
db = dict() |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
54 |
location = '' |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
55 |
name = '' |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
56 |
def __init__(self, location): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
57 |
self.location = location |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
58 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
59 |
def compare(self, other): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
60 |
db1files = set(self.db.keys()) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
61 |
db2files = set(other.db.keys()) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
62 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
63 |
removed = db1files - db2files |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
64 |
added = db2files - db1files |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
65 |
common = db1files & db2files |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
66 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
67 |
touched = set() |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
68 |
for file in common: |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
69 |
if(int(self.db[file]['time']) != int(other.db[file]['time'])): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
70 |
touched.add(file) |
284
0792141abac7
DBRUtils - zipped baseline comparisons: Fixed so we only need the md5s.
MattD <mattd@symbian.org>
parents:
242
diff
changeset
|
71 |
if(int(self.db[file]['time']) ==0 or int(other.db[file]['time']) == 0): #workaround for zipped dbs |
0792141abac7
DBRUtils - zipped baseline comparisons: Fixed so we only need the md5s.
MattD <mattd@symbian.org>
parents:
242
diff
changeset
|
72 |
touched.add(file) |
203
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
73 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
74 |
sizechanged = set() |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
75 |
for file in common: |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
76 |
if(int(self.db[file]['size']) != int(other.db[file]['size'])): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
77 |
sizechanged.add(file) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
78 |
#can be funny with some zip files...suggest we don't use sizechanged... |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
79 |
# changed = sizechanged |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
80 |
changed = set() |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
81 |
touched = touched - changed |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
82 |
unknown = set() |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
83 |
for file in touched: |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
84 |
if((self.db[file]['md5'] == "xxx") or (other.db[file]['md5'] == "xxx")): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
85 |
unknown.add(file) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
86 |
# if((self.db[file]['md5'] == "xxx")): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
87 |
# print 'unknown left: %s' % file |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
88 |
# else: |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
89 |
# print 'unknown right: %s' % file |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
90 |
else: |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
91 |
if(self.db[file]['md5'] != other.db[file]['md5']): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
92 |
# print '%s %s %s' % (file, self.db[file]['md5'], other.db[file]['md5'] ) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
93 |
changed.add(file) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
94 |
touched = touched - unknown |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
95 |
touched = touched - changed |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
96 |
|
242
9fd4819bf104
DBRTools - Added filtering support. It's currently implmented in checkenv and diffenv, but adding it to other commands is pretty easy.
MattD <mattd@symbian.org>
parents:
217
diff
changeset
|
97 |
results = dbrresults.DBRResults(added, removed, touched, changed, unknown) |
203
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
98 |
return results |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
99 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
100 |
def verify(self, files): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
101 |
print 'this is a pure virtual...' |
242
9fd4819bf104
DBRTools - Added filtering support. It's currently implmented in checkenv and diffenv, but adding it to other commands is pretty easy.
MattD <mattd@symbian.org>
parents:
217
diff
changeset
|
102 |
|
203
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
103 |
def save(self): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
104 |
print 'this is a pure virtual...' |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
105 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
106 |
def remove(self, files): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
107 |
for file in files: |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
108 |
if(file in self.db): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
109 |
del self.db[file] |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
110 |
else: |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
111 |
print 'warning: del: %s isnt defined' % file |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
112 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
113 |
def add(self, other, files): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
114 |
for file in files: |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
115 |
if(file in self.db): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
116 |
print 'warning: add: %s already defined' % file |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
117 |
else: |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
118 |
if(other.db[file]['md5'] == 'xxx'): #don't update a null md5 |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
119 |
print 'warning: MD5: %s isnt defined' % file |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
120 |
else: |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
121 |
self.db[file] = other.db[file] |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
122 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
123 |
def update(self, other, files): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
124 |
for file in files: |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
125 |
if(other.db[file]['md5'] != 'xxx'): #don't update a null md5 |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
126 |
self.db[file]['md5'] = other.db[file]['md5'] |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
127 |
else: |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
128 |
print 'warning: MD5: %s isnt defined' % file |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
129 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
130 |
self.db[file]['time'] = other.db[file]['time'] |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
131 |
self.db[file]['size'] = other.db[file]['size'] |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
132 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
133 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
134 |
#Database plus local filesystem access |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
135 |
class DBRLocalEnv (DBREnv): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
136 |
def __init__(self, location): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
137 |
DBREnv.__init__(self, location) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
138 |
#load up local files... |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
139 |
self.db = dbrutils.scanenv() |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
140 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
141 |
def verify(self, files): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
142 |
#should assert that the files are in the local DB. |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
143 |
localfiles = set(self.db.keys()) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
144 |
if(localfiles.issuperset(files)): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
145 |
md5s = dbrutils.generateMD5s(files) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
146 |
for file in files: |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
147 |
self.db[file]['md5'] = md5s[file]['md5'] |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
148 |
|
242
9fd4819bf104
DBRTools - Added filtering support. It's currently implmented in checkenv and diffenv, but adding it to other commands is pretty easy.
MattD <mattd@symbian.org>
parents:
217
diff
changeset
|
149 |
#Creating a DBREnv from scratch... |
203
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
150 |
class DBRNewLocalEnv (DBRLocalEnv): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
151 |
def __init__(self, location): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
152 |
DBRLocalEnv.__init__(self, location) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
153 |
#load up local files... |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
154 |
hashes = glob.glob(os.path.join(dbrutils.patchpath(),'*.md5')) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
155 |
for file in hashes: |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
156 |
print 'Reading: %s\n' % file |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
157 |
dbrutils.gethashes(self.db, file, False) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
158 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
159 |
def save(self): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
160 |
filename = os.path.join(self.location,dbrutils.defaultdb()) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
161 |
print 'Saving %s' % filename |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
162 |
dbrbaseline.writedb(self.db,filename) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
163 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
164 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
165 |
#zipped files, contains MD5s. |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
166 |
class DBRZippedEnv (DBREnv): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
167 |
def __init__(self, location): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
168 |
DBREnv.__init__(self, location) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
169 |
#load up zip MD5 and stuff |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
170 |
self.db = dbrutils.getzippedDB(self.location) |
242
9fd4819bf104
DBRTools - Added filtering support. It's currently implmented in checkenv and diffenv, but adding it to other commands is pretty easy.
MattD <mattd@symbian.org>
parents:
217
diff
changeset
|
171 |
|
203
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
172 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
173 |
#Database, but no filesystem access |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
174 |
class DBRBaselineEnv (DBREnv): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
175 |
def __init__(self, location): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
176 |
DBREnv.__init__(self, location) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
177 |
#load up database... |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
178 |
filename = os.path.join(self.location,dbrutils.defaultdb()) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
179 |
print 'Loading %s' % filename |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
180 |
self.db = dbrbaseline.readdb(filename) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
181 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
182 |
def save(self): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
183 |
filename = os.path.join(self.location,dbrutils.defaultdb()) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
184 |
print 'Saving %s' % filename |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
185 |
dbrbaseline.writedb(self.db,filename) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
186 |
|
242
9fd4819bf104
DBRTools - Added filtering support. It's currently implmented in checkenv and diffenv, but adding it to other commands is pretty easy.
MattD <mattd@symbian.org>
parents:
217
diff
changeset
|
187 |
|
203
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
188 |
class DBRPatchedBaselineEnv (DBRBaselineEnv): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
189 |
patches = [] |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
190 |
baseline = [] |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
191 |
def __init__(self, location): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
192 |
DBRBaselineEnv.__init__(self, location) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
193 |
#load up patches... |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
194 |
if(len(self.db) > 0): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
195 |
self.baseline = self.db |
217
1eec8c29548a
DBRTools - did some fixes to the nasty path appending I'd done for patches. This fixes some of the problems with doing 'diffenv' on patched databases with UNC paths.
MattD <mattd@symbian.org>
parents:
208
diff
changeset
|
196 |
self.patches = dbrpatch.loadpatches(os.path.join(self.location,dbrutils.patch_path_internal())) |
203
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
197 |
self.db = dbrpatch.createpatchedbaseline(self.baseline,self.patches) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
198 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
199 |
def save(self): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
200 |
self.baseline = dbrpatch.updatebaseline(self.baseline, self.db) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
201 |
self.patches = dbrpatch.updatepatches(self.patches, self.db) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
202 |
dbrpatch.savepatches(self.patches) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
203 |
self.db = self.baseline |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
204 |
DBRBaselineEnv.save(self) |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
205 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
206 |
|
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
207 |
class CBREnv (DBREnv): # placeholder for handling CBR components... |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
208 |
def __init__(self, location): |
e274d29c8bc9
Initial version of code cleanup. Now have classes for the environments. checkenv and diffenv updated to use it (although there are minor changes to the paths).
MattD <mattd@symbian.org>
parents:
diff
changeset
|
209 |
DBREnv.__init__(self, location) |