Merge commit 'd816500cdd5ca4e017f2fe16fa9ec27205dc2e28' into eclair-mr2-plus-aosp * commit 'd816500cdd5ca4e017f2fe16fa9ec27205dc2e28': add 'extras' mechanism to OTA and signing tools
This commit is contained in:
@@ -35,6 +35,7 @@ OPTIONS.max_image_size = {}
|
|||||||
OPTIONS.verbose = False
|
OPTIONS.verbose = False
|
||||||
OPTIONS.tempfiles = []
|
OPTIONS.tempfiles = []
|
||||||
OPTIONS.device_specific = None
|
OPTIONS.device_specific = None
|
||||||
|
OPTIONS.extras = {}
|
||||||
|
|
||||||
class ExternalError(RuntimeError): pass
|
class ExternalError(RuntimeError): pass
|
||||||
|
|
||||||
@@ -259,6 +260,10 @@ COMMON_DOCSTRING = """
|
|||||||
Path to the python module containing device-specific
|
Path to the python module containing device-specific
|
||||||
releasetools code.
|
releasetools code.
|
||||||
|
|
||||||
|
-x (--extra) <key=value>
|
||||||
|
Add a key/value pair to the 'extras' dict, which device-specific
|
||||||
|
extension code may look at.
|
||||||
|
|
||||||
-v (--verbose)
|
-v (--verbose)
|
||||||
Show command lines being executed.
|
Show command lines being executed.
|
||||||
|
|
||||||
@@ -283,8 +288,8 @@ def ParseOptions(argv,
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
opts, args = getopt.getopt(
|
opts, args = getopt.getopt(
|
||||||
argv, "hvp:s:" + extra_opts,
|
argv, "hvp:s:x:" + extra_opts,
|
||||||
["help", "verbose", "path=", "device_specific="] +
|
["help", "verbose", "path=", "device_specific=", "extra="] +
|
||||||
list(extra_long_opts))
|
list(extra_long_opts))
|
||||||
except getopt.GetoptError, err:
|
except getopt.GetoptError, err:
|
||||||
Usage(docstring)
|
Usage(docstring)
|
||||||
@@ -303,6 +308,9 @@ def ParseOptions(argv,
|
|||||||
OPTIONS.search_path = a
|
OPTIONS.search_path = a
|
||||||
elif o in ("-s", "--device_specific"):
|
elif o in ("-s", "--device_specific"):
|
||||||
OPTIONS.device_specific = a
|
OPTIONS.device_specific = a
|
||||||
|
elif o in ("-x" "--extra"):
|
||||||
|
key, value = a.split("=", 1)
|
||||||
|
OPTIONS.extras[key] = value
|
||||||
else:
|
else:
|
||||||
if extra_option_handler is None or not extra_option_handler(o, a):
|
if extra_option_handler is None or not extra_option_handler(o, a):
|
||||||
assert False, "unknown option \"%s\"" % (o,)
|
assert False, "unknown option \"%s\"" % (o,)
|
||||||
@@ -437,6 +445,7 @@ class DeviceSpecificParams(object):
|
|||||||
module."""
|
module."""
|
||||||
for k, v in kwargs.iteritems():
|
for k, v in kwargs.iteritems():
|
||||||
setattr(self, k, v)
|
setattr(self, k, v)
|
||||||
|
self.extras = OPTIONS.extras
|
||||||
|
|
||||||
if self.module is None:
|
if self.module is None:
|
||||||
path = OPTIONS.device_specific
|
path = OPTIONS.device_specific
|
||||||
|
Reference in New Issue
Block a user