# HG changeset patch # User MattD # Date 1276457943 -3600 # Node ID 6a928cf9e181ad55f4167c1ff3cfe6514d66b6f5 # Parent 0792141abac71cbd40c62437f4672a8131217dde 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/' diff -r 0792141abac7 -r 6a928cf9e181 dbrtools/dbr/dbrenv.py --- a/dbrtools/dbr/dbrenv.py Sun Jun 13 18:33:42 2010 +0100 +++ b/dbrtools/dbr/dbrenv.py Sun Jun 13 20:39:03 2010 +0100 @@ -16,6 +16,7 @@ #I'm using the existing stuff as helpers until things get relocated... import os.path import glob +import re import dbrutils import dbrbaseline @@ -35,6 +36,9 @@ if(os.path.exists(os.path.join(location,'build_md5.zip'))): print 'loading zipped environment' return DBRZippedEnv(location) + if(re.match('http://.+',location, re.IGNORECASE)): + print 'loading remote zipped environment' + return DBRZippedEnv(location) 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 print 'loading new env...warning: this is only here for compatibility' return DBRNewLocalEnv(location) diff -r 0792141abac7 -r 6a928cf9e181 dbrtools/dbr/dbrutils.py --- a/dbrtools/dbr/dbrutils.py Sun Jun 13 18:33:42 2010 +0100 +++ b/dbrtools/dbr/dbrutils.py Sun Jun 13 20:39:03 2010 +0100 @@ -19,6 +19,9 @@ import string import shutil import time +import urllib +from urlparse import urljoin + from os.path import join, isfile, stat from stat import * @@ -99,16 +102,20 @@ def getzippedDB(location): db = dict() + temp_dir = tempfile.mkdtemp() md5zip = os.path.join(location,'build_md5.zip') + if(re.match('^http',location, re.IGNORECASE)): + md5zip = os.path.join(temp_dir,'build_md5.zip') + url = '%s%s' % (location,'build_md5.zip') + res = urllib.urlretrieve(url,md5zip) print md5zip - temp_dir = tempfile.mkdtemp() print temp_dir if(os.path.exists(md5zip)): files = set(); files.add('*') extractfromzip(files,md5zip,temp_dir) globsearch = os.path.join(temp_dir, os.path.join(patch_path_internal(),'*.md5')) - print globsearch +# print globsearch hashes = glob.glob(globsearch) for file in hashes: # print 'Reading: %s\n' % file diff -r 0792141abac7 -r 6a928cf9e181 dbrtools/dbr/diffenv.py --- a/dbrtools/dbr/diffenv.py Sun Jun 13 18:33:42 2010 +0100 +++ b/dbrtools/dbr/diffenv.py Sun Jun 13 20:39:03 2010 +0100 @@ -37,8 +37,10 @@ def help(): print "Compares two environments" + print "Locations can be local environments or zipped environments available via UNC or http paths." print "Usage:" - print "\tdbr diffenv ()" + print "\tdbr diffenv ()" + def summary():