[Pkg-mozext-commits] [adblock-plus] 204/464: Drop support for "build.py testenv" command, it has been superseded by "build.py autoinstall"
David Prévot
taffit at moszumanska.debian.org
Tue Jul 22 20:44:17 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository adblock-plus.
commit dd059b89f0dc125c3f184fad243fc034dcd239bc
Author: Wladimir Palant <trev at adblockplus.org>
Date: Fri Jan 20 10:59:01 2012 +0100
Drop support for "build.py testenv" command, it has been superseded by "build.py autoinstall"
---
build.py | 26 --------------------------
packager.py | 54 ------------------------------------------------------
2 files changed, 80 deletions(-)
diff --git a/build.py b/build.py
index ab75168..bf89536 100644
--- a/build.py
+++ b/build.py
@@ -169,21 +169,6 @@ def runBuild(baseDir, scriptName, opts, args, type):
packagerKMeleon.createBuild(baseDir, outFile=outFile, locales=locales,
buildNum=buildNum, releaseBuild=releaseBuild)
-def setupTestEnvironment(baseDir, scriptName, opts, args, type):
- dirsFile = '.profileDirs'
- for option, value in opts:
- if option in ('-d', '--dirs'):
- dirsFile = value
-
- profileDirs = args
- if len(profileDirs) == 0:
- handle = open(dirsFile, 'rb')
- profileDirs = map(str.strip, handle.readlines())
- handle.close()
- import buildtools.packager as packager
- packager.setupTestEnvironment(baseDir, profileDirs)
-
-
def runAutoInstall(baseDir, scriptName, opts, args, type):
if len(args) == 0:
print 'Port of the Extension Auto-Installer needs to be specified'
@@ -302,17 +287,6 @@ with addCommand(runBuild, 'build') as command:
command.addOption('Create a build for Babelzilla', long='babelzilla')
command.supportedTypes = ('gecko', 'kmeleon')
-with addCommand(setupTestEnvironment, 'testenv') as command:
- command.shortDescription = 'Set up test environment'
- command.description = 'Sets up the extension in given profiles in such a way '\
- 'that most files are read from the current directory. Changes in the files '\
- 'here will be available to these profiles immediately after a restart '\
- 'without having to reinstall the extension. If no directories are given the '\
- 'list of directories is read from a file.'
- command.addOption('File listing profile directories to set up if none are given on command line (default is .profileDirs)', short='d', long='dirs', value='file')
- command.params = '[options] [profile_dir] ...'
- command.supportedTypes = ('gecko')
-
with addCommand(runAutoInstall, 'autoinstall') as command:
command.shortDescription = 'Install extension automatically'
command.description = 'Will automatically install the extension in a browser running Extension Auto-Installer. If host parameter is omitted assumes that the browser runs on localhost.'
diff --git a/packager.py b/packager.py
index 68d62aa..b8a48a5 100644
--- a/packager.py
+++ b/packager.py
@@ -54,9 +54,6 @@ def getXPIFiles(baseDir):
if file.endswith('.js') or file.endswith('.xml'):
yield os.path.join(baseDir, file)
-def getTestEnvFiles(baseDir):
- return [os.path.join(baseDir, file) for file in ('components', 'defaults', 'bootstrap.js', 'chrome.manifest', 'icon.png', 'icon64.png')]
-
def getIgnoredFiles(params):
result = ['.incomplete']
if not params['limitMetadata']:
@@ -326,54 +323,3 @@ def autoInstall(baseDir, host, port):
fileBuffer = StringIO()
createBuild(baseDir, outFile=fileBuffer)
urllib.urlopen('http://%s:%s/' % (host, port), data=fileBuffer.getvalue())
-
-def setupTestEnvironment(baseDir, profileDirs):
- metadata = readMetadata(baseDir)
- params = {
- 'locales': getLocales(baseDir, True),
- 'releaseBuild': True,
- 'buildNum': '',
- 'version': '99.9',
- 'metadata': metadata,
- 'limitMetadata': False,
- }
- files = {}
- files['install.rdf'] = createManifest(baseDir, params)
- for path in getTestEnvFiles(baseDir):
- if os.path.exists(path):
- readFile(files, params, path, os.path.basename(path))
-
- if 'chrome.manifest' in files:
- # Redirect manifest entries to the current directory
- if sys.platform == 'win32':
- import nturl2path
- baseURL = 'file:' + nturl2path.pathname2url(os.path.abspath(baseDir))
- else:
- import urllib
- baseURL = 'file://' + urllib.quote(os.path.abspath(baseDir))
- files['chrome.manifest'] = re.sub(r'\bjar:chrome/\w+\.jar!', '%s/chrome' % baseURL, files['chrome.manifest'])
- files['chrome.manifest'] = re.sub(r'(\s)chrome/', r'\1%s/chrome/' % baseURL, files['chrome.manifest'])
- files['chrome.manifest'] = re.sub(r'\b(resource\s+\S+\s+)', r'\1%s/' % baseURL, files['chrome.manifest'])
- files['chrome.manifest'] = re.sub(r'\b(content\s+\S+\s+)(\w+/)', r'\1%s/\2' % baseURL, files['chrome.manifest'])
- if os.path.exists(os.path.join(baseDir, 'mochitest')):
- files['chrome.manifest'] += 'content mochikit %s/mochitest/\n' % baseURL
-
- id = metadata.get('general', 'id')
- for dir in profileDirs:
- # Remove packed XPI file if there is one
- packedPath = os.path.join(dir, 'extensions', '%s.xpi' % id)
- if os.path.isfile(packedPath):
- os.remove(packedPath)
-
- # Replace unpacked dir by new data
- unpackedPath = os.path.join(dir, 'extensions', id)
- if os.path.isdir(unpackedPath):
- shutil.rmtree(unpackedPath)
- for file, data in files.iteritems():
- filePath = os.path.join(unpackedPath, *(file.split('/')))
- parentDir = os.path.dirname(filePath)
- if not os.path.exists(parentDir):
- os.makedirs(parentDir)
- handle = open(filePath, 'wb')
- handle.write(data)
- handle.close()
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git
More information about the Pkg-mozext-commits
mailing list