OSDN Git Service

sconstruct: Add certPassword option to specify the password for the private key in...
authorJames Teh <jamie@jantrid.net>
Fri, 26 Nov 2010 04:58:43 +0000 (14:58 +1000)
committerJames Teh <jamie@jantrid.net>
Fri, 26 Nov 2010 04:58:43 +0000 (14:58 +1000)
Fixes #1221.

contributors.txt
readme.txt
sconstruct

index 33ef6f8..f6182c3 100644 (file)
@@ -80,3 +80,4 @@ Andrzej Kałuża <andkal55@gmail.com> - polish localization
 晴天 <qt06.com@139.com> - simplified chinese localization\r
 Dejan Zubovic <zubovic@gmail.com> on be half of Special library for blind and visually impaired of Republic of Srpska <bsrs@bsrs.rs.ba> - serbian language files\r
 vrutti vyas <vruttivyas@yahoo.co.in> - hindi language files\r
+Niko Carpenter <nik62591@gmail.com> - Small patches\r
index 0d5274d..7f99579 100644 (file)
@@ -119,6 +119,7 @@ Optionally, the build can  be customised by providing variables on the command l
        * release: Whether this is a release version.\r
        * publisher: The publisher of this build.\r
        * certFile: The certificate file with which to sign executables. The certificate must be in pfx format and contain the private key.\r
+       * certPassword: The password for the private key in the signing certificate. If omitted, no password will be assumed.\r
        * outputDir: The directory where the final built archives and such will be placed.\r
        * targetArchitectures: The target architectures that NVDA should support. Possible values are all, x86 and x86_64. This should generally be left as the default.\r
 \r
index 9639260..bc8dafd 100755 (executable)
@@ -76,6 +76,7 @@ vars.Add(BoolVariable("release", "Whether this is a release version", False))
 vars.Add("publisher", "The publisher of this build", "unknown")\r
 vars.Add(PathVariable("certFile", "The certificate file with which to sign executables", "",\r
        lambda key, val, env: not val or PathVariable.PathIsFile(key, val, env)))\r
+vars.Add("certPassword", "The password for the private key in the signing certificate", "")\r
 vars.Add(PathVariable("outputDir", "The directory where the final built archives and such will be placed", "output",PathVariable.PathIsDirCreate))\r
 vars.Add(ListVariable('targetArchitectures','Which architectures should NVDA support?','all',['x86','x86_64']))\r
 \r
@@ -89,6 +90,7 @@ env = Environment(variables=vars,tools=["textfile","gettext","t2t",keyCommandsDo
 version = env["version"]\r
 release = env["release"]\r
 certFile = env["certFile"]\r
+certPassword = env["certPassword"]\r
 userDocsDir=Dir('user_docs')\r
 sourceDir = Dir("source")\r
 Export('sourceDir')\r
@@ -172,7 +174,10 @@ def SzSfxGenerator(target, source, env, for_signature):
 env["BUILDERS"]["SzSfx"] = Builder(generator=SzSfxGenerator)\r
 \r
 # An action to sign an executable with certFile.\r
-signExec = [signtool, "sign", "/f", certFile, "$TARGET"]\r
+signExec = [signtool, "sign", "/f", certFile]\r
+if certPassword:\r
+       signExec.extend(("/p", certPassword))\r
+signExec.append("$TARGET")\r
 \r
 portableDist = env.NVDADist("dist", sourceDir, uiAccess=False)\r
 if certFile:\r