From patchwork Thu Mar 1 18:26:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 130386 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp3132789edc; Thu, 1 Mar 2018 10:27:28 -0800 (PST) X-Google-Smtp-Source: AG47ELvrk7RdKgTBcYZF52H4X8yjNM6kV0mbkxxbtJlDWJQb0fJDH5TQjwZW8nYpUr3wcIyaxTzX X-Received: by 10.99.1.148 with SMTP id 142mr2336597pgb.24.1519928848572; Thu, 01 Mar 2018 10:27:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519928848; cv=none; d=google.com; s=arc-20160816; b=Xt2D4feLcB9bzXGP4dSjJ61MIcIRprhSoipCb/k7BIT/yg+m3Xuj7GS7HlVnXL72yg bk8JgGRPmWM95XDv6ATYF6k9sOjaeS52mp49XAcsNjFMnk1TmBxU1KZxo5AiIsaRW8GZ SQxtTOGoSwN99Gl+1WA54wt8aHVOx26pQ3+mhaoOrIXYZcpjMn6n1Uq0EpZA7+PDRvYH sqIWbTpX5i0oynZETP4rST7JcZchPCC7BYjt5vLC4b1SHWkyaC14alN3dAMzNs8eLk25 QGLPJ9DsHsqxIER023+yGiNcEoomhtTt0pvbKGxBDZd+0QyQXnLkzvx+Y9+KbLWrRV1X /cpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=hx1eA3sF0ypBFcX7PThyOCux6HrEgRYX2vx4fmnqdzA=; b=mj1EzHPn/DQr6+WDgHq9nn3oDt3fKz0HEZ79zhM2D0AaDiMatrOI04olznBYDA39F0 /behn5fIV0pLcPjwnFLkfung/lfMtzI7Lj06IiiIuspcQH9Gp+W7HpdEtL1ZXMZXFkE1 /Dx16fY0+EX2mbCF15ZJRVMhiOR9Z9t9PkGnn80JYe4BBkfkm/locYJx4bd1R9UAAIna y2lc1r2iEwzbVkv66HHLHMIDc749fI/EdEMIfG9nDXGkjZhb9eE30xPWNKK1xrzx0YEr XsnNmUiqUH/IrvZPKcFmxsWFAlShIMvjfm2GI9u3N6CFmpygt3z/Om+Ro5kOwbABF46r OCzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=yyUh89jl; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id z79si3202861pfl.211.2018.03.01.10.27.28; Thu, 01 Mar 2018 10:27:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=yyUh89jl; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Received: from layers.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id E130B788FC; Thu, 1 Mar 2018 18:26:57 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by mail.openembedded.org (Postfix) with ESMTP id 32EC478882 for ; Thu, 1 Mar 2018 18:26:47 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id 139so14039362wmn.2 for ; Thu, 01 Mar 2018 10:26:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=kZjZ9KONEBlNdhOyr2g6flG+pBr9DRF/g/NxStxLsF8=; b=yyUh89jlCmkLGz0JhHH/SlfHZT2MdQnMA0L3FBMC7z5r71QbHzQeNu1Xwfebm4eQ5m 8xTjVRil47k2IHE9V6fLorDluL90DR5VCcmM1ndtblV4XkYxkD+VZ68S5szYkR7/mObH 73zXuYKy2Qd6IhypNkvNUqXvSUSqx45vTcln5HYQSpdfq5lVEyGPrDfs0ktdPunrSvj2 J7NEGB2o9bWI5G62ZGyWpGVWsy9EeT9hIlgm4IEeX60nGqDPf/eclIxJ72VXhsyyEQpv VLZLihVAzHIg7IE8FbIigU9PCM8yhiKrYCe3SuDM7qRpWW3aLHyrpIRzjMYkD50q91Yp CWYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=kZjZ9KONEBlNdhOyr2g6flG+pBr9DRF/g/NxStxLsF8=; b=QOO3oMkapbc92RbEmADtAL2kiU2lgxdpfV2TqeJUGVjelZ70frJJuaflwMrARzf/Hl 2LTXWto/yPimpfhEaf+Rh0099cidtTTyhmsrX69QtRiR1ZaKQBKEg/bZmrbR/MxHjoN5 jDQbJveMzja2x/qanEpDI/okmwo5tSJ0IVfVjGYSzZwsmQslX1orIeWTcQvPv31md5tX RqwkVlBML7MvIw3BVkSAyoRy4VFvT/x5yHG5SLnWs/uvESaVPlQpsxf1kdXBEVNPYLZM F/aaGHMvaVbW7lGPm8B+lfLRFQ5Tz90DvsWpOjw+4TgQmY96XaRWiqH7GE/GrrOWmpzd YtBQ== X-Gm-Message-State: APf1xPAP2oQK+p7gk0KqsueOvW9E/CRNumHrcu3UhqCSsKUUk8xM1M/M 9uCaVUUtG8opsvOuCajAKP9Z1aJV X-Received: by 10.28.7.209 with SMTP id 200mr2537509wmh.49.1519928808062; Thu, 01 Mar 2018 10:26:48 -0800 (PST) Received: from flashheart.burtonini.com (35.106.2.81.in-addr.arpa. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id h188sm4955285wmf.23.2018.03.01.10.26.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Mar 2018 10:26:47 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Thu, 1 Mar 2018 18:26:30 +0000 Message-Id: <20180301182634.20502-7-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180301182634.20502-1-ross.burton@intel.com> References: <20180301182634.20502-1-ross.burton@intel.com> Subject: [OE-core] [PATCH 07/11] package-manager: add install_glob() X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org Signed-off-by: Ross Burton --- meta/lib/oe/package_manager.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index e37dd4e8a2f..7a5796a3a57 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py @@ -371,6 +371,29 @@ class PackageManager(object, metaclass=ABCMeta): pass """ + Install all packages that match a glob. + """ + def install_glob(self, globs, sdk=False): + # TODO don't have sdk here but have a property on the superclass + # (and respect in install_complementary) + if sdk: + pkgdatadir = self.d.expand("${TMPDIR}/pkgdata/${SDK_SYS}") + else: + pkgdatadir = self.d.getVar("PKGDATA_DIR") + + try: + bb.note("Installing globbed packages...") + cmd = ["oe-pkgdata-util", "-p", pkgdatadir, "list-pkgs", globs] + pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8") + self.install(pkgs.split(), attempt_only=True) + except subprocess.CalledProcessError as e: + # Return code 1 means no packages matched + if e.returncode != 1: + bb.fatal("Could not compute globbed packages list. Command " + "'%s' returned %d:\n%s" % + (' '.join(cmd), e.returncode, e.output.decode("utf-8"))) + + """ Install complementary packages based upon the list of currently installed packages e.g. locales, *-dev, *-dbg, etc. This will only attempt to install these packages, if they don't exist then no error will occur. Note: every