diff options
Diffstat (limited to 'poky/meta/lib/oe')
-rw-r--r-- | poky/meta/lib/oe/gpg_sign.py | 39 | ||||
-rw-r--r-- | poky/meta/lib/oe/recipeutils.py | 2 | ||||
-rw-r--r-- | poky/meta/lib/oe/rootfs.py | 1 | ||||
-rw-r--r-- | poky/meta/lib/oe/sstatesig.py | 2 |
4 files changed, 25 insertions, 19 deletions
diff --git a/poky/meta/lib/oe/gpg_sign.py b/poky/meta/lib/oe/gpg_sign.py index a95d2ba34..2fd8c3b1a 100644 --- a/poky/meta/lib/oe/gpg_sign.py +++ b/poky/meta/lib/oe/gpg_sign.py @@ -15,21 +15,27 @@ class LocalSigner(object): def __init__(self, d): self.gpg_bin = d.getVar('GPG_BIN') or \ bb.utils.which(os.getenv('PATH'), 'gpg') + self.gpg_cmd = [self.gpg_bin] + self.gpg_agent_bin = bb.utils.which(os.getenv('PATH'), "gpg-agent") + # Without this we see "Cannot allocate memory" errors when running processes in parallel + # It needs to be set for any gpg command since any agent launched can stick around in memory + # and this parameter must be set. + if self.gpg_agent_bin: + self.gpg_cmd += ["--agent-program=%s|--auto-expand-secmem" % (self.gpg_agent_bin)] self.gpg_path = d.getVar('GPG_PATH') - self.gpg_version = self.get_gpg_version() self.rpm_bin = bb.utils.which(os.getenv('PATH'), "rpmsign") - self.gpg_agent_bin = bb.utils.which(os.getenv('PATH'), "gpg-agent") + self.gpg_version = self.get_gpg_version() + def export_pubkey(self, output_file, keyid, armor=True): """Export GPG public key to a file""" - cmd = '%s --no-permission-warning --batch --yes --export -o %s ' % \ - (self.gpg_bin, output_file) + cmd = self.gpg_cmd + ["--no-permission-warning", "--batch", "--yes", "--export", "-o", output_file] if self.gpg_path: - cmd += "--homedir %s " % self.gpg_path + cmd += ["--homedir", self.gpg_path] if armor: - cmd += "--armor " - cmd += keyid - subprocess.check_output(shlex.split(cmd), stderr=subprocess.STDOUT) + cmd += ["--armor"] + cmd += [keyid] + subprocess.check_output(cmd, stderr=subprocess.STDOUT) def sign_rpms(self, files, keyid, passphrase, digest, sign_chunk, fsk=None, fsk_password=None): """Sign RPM files""" @@ -59,7 +65,7 @@ class LocalSigner(object): if passphrase_file and passphrase: raise Exception("You should use either passphrase_file of passphrase, not both") - cmd = [self.gpg_bin, '--detach-sign', '--no-permission-warning', '--batch', + cmd = self.gpg_cmd + ['--detach-sign', '--no-permission-warning', '--batch', '--no-tty', '--yes', '--passphrase-fd', '0', '-u', keyid] if self.gpg_path: @@ -72,9 +78,6 @@ class LocalSigner(object): if self.gpg_version > (2,1,): cmd += ['--pinentry-mode', 'loopback'] - if self.gpg_agent_bin: - cmd += ["--agent-program=%s|--auto-expand-secmem" % (self.gpg_agent_bin)] - cmd += [input_file] try: @@ -101,7 +104,8 @@ class LocalSigner(object): def get_gpg_version(self): """Return the gpg version as a tuple of ints""" try: - ver_str = subprocess.check_output((self.gpg_bin, "--version", "--no-permission-warning")).split()[2].decode("utf-8") + cmd = self.gpg_cmd + ["--version", "--no-permission-warning"] + ver_str = subprocess.check_output(cmd).split()[2].decode("utf-8") return tuple([int(i) for i in ver_str.split("-")[0].split('.')]) except subprocess.CalledProcessError as e: raise bb.build.FuncFailed("Could not get gpg version: %s" % e) @@ -109,11 +113,12 @@ class LocalSigner(object): def verify(self, sig_file): """Verify signature""" - cmd = self.gpg_bin + " --verify --no-permission-warning " + cmd = self.gpg_cmd + [" --verify", "--no-permission-warning"] if self.gpg_path: - cmd += "--homedir %s " % self.gpg_path - cmd += sig_file - status = subprocess.call(shlex.split(cmd)) + cmd += ["--homedir", self.gpg_path] + + cmd += [sig_file] + status = subprocess.call(cmd) ret = False if status else True return ret diff --git a/poky/meta/lib/oe/recipeutils.py b/poky/meta/lib/oe/recipeutils.py index 1e5b9a49f..630ae967a 100644 --- a/poky/meta/lib/oe/recipeutils.py +++ b/poky/meta/lib/oe/recipeutils.py @@ -934,7 +934,7 @@ def get_recipe_pv_without_srcpv(pv, uri_type): sfx = '' if uri_type == 'git': - git_regex = re.compile(r"(?P<pfx>v?)(?P<ver>[^\+]*)((?P<sfx>\+(git)?r?(AUTOINC\+))(?P<rev>.*))?") + git_regex = re.compile(r"(?P<pfx>v?)(?P<ver>.*?)(?P<sfx>\+[^\+]*(git)?r?(AUTOINC\+))(?P<rev>.*)") m = git_regex.match(pv) if m: diff --git a/poky/meta/lib/oe/rootfs.py b/poky/meta/lib/oe/rootfs.py index 9358f562c..c62fa5f54 100644 --- a/poky/meta/lib/oe/rootfs.py +++ b/poky/meta/lib/oe/rootfs.py @@ -647,6 +647,7 @@ class DpkgRootfs(DpkgOpkgRootfs): if pkg_type in pkgs_to_install: self.pm.install(pkgs_to_install[pkg_type], [False, True][pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY]) + self.pm.fix_broken_dependencies() if self.progress_reporter: # Don't support attemptonly, so skip that diff --git a/poky/meta/lib/oe/sstatesig.py b/poky/meta/lib/oe/sstatesig.py index 417943db9..13af16e47 100644 --- a/poky/meta/lib/oe/sstatesig.py +++ b/poky/meta/lib/oe/sstatesig.py @@ -155,7 +155,7 @@ class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash): else: def get_mc(tid): tid = tid.rsplit('.', 1)[0] - if tid.startswith('multiconfig:'): + if tid.startswith('mc:'): elems = tid.split(':') return elems[1] def recipename_from_dep(dep): |