summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/sstatesig.py
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2024-03-22 07:50:47 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-03-23 10:18:20 +0000
commit84cb5d2568d533f243cc4c717d18f06eb4b9ee09 (patch)
tree3f070966f1099d6e7c21c64fd446cefe1a3deeee /meta/lib/oe/sstatesig.py
parentb3b611a5e50c786c96d040dc712d6010bf78818f (diff)
downloadpoky-84cb5d2568d533f243cc4c717d18f06eb4b9ee09.tar.gz
sstatesig: Set hash server credentials from bitbake variables
Allows the hash server credentials to be specified in bitbake variables. If omitted, the users .netrc will be checked (From OE-Core rev: ba391d39f2b888706e53028e9df3a37c5baedfc1) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/sstatesig.py')
-rw-r--r--meta/lib/oe/sstatesig.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index aa891ecf0a..b867e2a052 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -6,6 +6,7 @@
6import bb.siggen 6import bb.siggen
7import bb.runqueue 7import bb.runqueue
8import oe 8import oe
9import netrc
9 10
10def sstate_rundepfilter(siggen, fn, recipename, task, dep, depname, dataCaches): 11def sstate_rundepfilter(siggen, fn, recipename, task, dep, depname, dataCaches):
11 # Return True if we should keep the dependency, False to drop it 12 # Return True if we should keep the dependency, False to drop it
@@ -327,6 +328,16 @@ class SignatureGeneratorOEEquivHash(SignatureGeneratorOEBasicHashMixIn, bb.sigge
327 if not self.method: 328 if not self.method:
328 bb.fatal("OEEquivHash requires SSTATE_HASHEQUIV_METHOD to be set") 329 bb.fatal("OEEquivHash requires SSTATE_HASHEQUIV_METHOD to be set")
329 self.max_parallel = int(data.getVar('BB_HASHSERVE_MAX_PARALLEL') or 1) 330 self.max_parallel = int(data.getVar('BB_HASHSERVE_MAX_PARALLEL') or 1)
331 self.username = data.getVar("BB_HASHSERVE_USERNAME")
332 self.password = data.getVar("BB_HASHSERVE_PASSWORD")
333 if not self.username or not self.password:
334 try:
335 n = netrc.netrc()
336 auth = n.authenticators(self.server)
337 if auth is not None:
338 self.username, _, self.password = auth
339 except FileNotFoundError:
340 pass
330 341
331# Insert these classes into siggen's namespace so it can see and select them 342# Insert these classes into siggen's namespace so it can see and select them
332bb.siggen.SignatureGeneratorOEBasicHash = SignatureGeneratorOEBasicHash 343bb.siggen.SignatureGeneratorOEBasicHash = SignatureGeneratorOEBasicHash