From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6669723628337102848 X-Received: by 2002:a1c:1c1:: with SMTP id 184mr3162590wmb.1.1555419922690; Tue, 16 Apr 2019 06:05:22 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:600c:2292:: with SMTP id 18ls2198217wmf.3.canary-gmail; Tue, 16 Apr 2019 06:05:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzslkf355GUrfoVN/r5922Xt6L6CDDWKyyGYQy8oCJ0qTiio4EtDx048jmcqjGUxfWQgYPL X-Received: by 2002:a05:600c:218e:: with SMTP id e14mr3089518wme.5.1555419922208; Tue, 16 Apr 2019 06:05:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555419922; cv=none; d=google.com; s=arc-20160816; b=MWP2AldxyXgkJFGxXd15ba904qIrU8pbooG83IdRcl1JI9Y9qVMJSKvUXAyNq2yoqD iYa/R9FpTVco3XSxOwPcAyJtyGSFDkynKYsBTtEzgdRJiNTGs2Lg7+9N/vvd0dmCi0Te mJy+4x/65brZqfhjDbH2IfchtDUoNzxZ7ei6LVD7CnUtTXsRbiUC6oWlEGaE92hnOGOf 5ayPbB0CCS7dpKKnY4yLhHbkUfluvYRzGjjdKJ91fVFSa87VGSnAe1u1OoWCQD8Bekhv 2EUwxQTdN1UkkbAxH6WWJ4xQ1iH6tzAs8QcF0JUttXVTTQ44+F2RLRy/mVpWDpnTVtrK dE6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=498KGtkXALWQoO90ozreLOzUn4bEx213dNDOWUSwicg=; b=cN1nlN0EFRtLNVFdnEvIHe1xkGbIbHbHky4MSoUVlP1fqsVz9JXTInXvYCvyq0qxud 16a4Mx3ktQvIJSaYg0NqLdFdZK05pUJfgq9dQxGm1Jkan03IP7mET2KQ7n0P2+uuCPDU Ip6YecFjgds9S72pMa+VxrxL0+RJW/Ied5T2uhHnp07vTRg4OMtRdDJGf+MLBJSyJbfI +PXVFEhLDGsegJBXN+TboGpjJqP0rvfwqMwpiSUeXgbeozMpNASl5X0VXRjNkxswMncL bld9vpmjCjmbLC9XtSPDcaRX5dELpUVH+D2b+NhOrgZ+CldUuWnYC2T1nQ1xWbS+pGpR vCBQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of andreas.reichel.ext@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=andreas.reichel.ext@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id u6si2771586wrw.2.2019.04.16.06.05.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 06:05:22 -0700 (PDT) Received-SPF: pass (google.com: domain of andreas.reichel.ext@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of andreas.reichel.ext@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=andreas.reichel.ext@siemens.com Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id x3GD5LQq011386 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 16 Apr 2019 15:05:21 +0200 Received: from localhost.localdomain (golem.ppmd.siemens.net [139.25.69.122]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id x3GD5L2p003341; Tue, 16 Apr 2019 15:05:21 +0200 From: "Andreas J. Reichel" To: isar-users@googlegroups.com Cc: Andreas Reichel Subject: [PATCH v9 1/5] Simplify and enhance apt-keyring generator Date: Tue, 16 Apr 2019 15:05:07 +0200 Message-Id: <20190416130511.10873-2-andreas.reichel.ext@siemens.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190416130511.10873-1-andreas.reichel.ext@siemens.com> References: <20190416130511.10873-1-andreas.reichel.ext@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: kgwjwBcmhPX3 From: Andreas Reichel * Remove duplicate code from apt-keyring generation * Fix fetched key location in apt-keyring generator: Use bb.fetch2.Fetch to retrieve the final filename after it is downloaded. This way we don't have to guess (which may be wrong), and also additional SRC_URI parameters like subdir or filename are usable now. Signed-off-by: Andreas Reichel --- .../isar-bootstrap/isar-bootstrap.inc | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index c1b571a..90a0faa 100644 --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -33,23 +33,23 @@ DISTRO_APT_PREMIRRORS ?= "${@ "http://ftp\.(\S+\.)?debian.org file:///${REPO_BA inherit base-apt-helper python () { - from urllib.parse import urlparse distro_apt_keys = d.getVar("DISTRO_APT_KEYS", False) - wd = d.getVar("WORKDIR", True) + aptkeys = [] + if distro_apt_keys: - d.setVar("DEBOOTSTRAP_KEYRING", "--keyring ${APTKEYRING}") - for key in distro_apt_keys.split(): - url = urlparse(key) - d.appendVar("SRC_URI", " " + key) - d.appendVar("APTKEYFILES", " " + wd + url.path) + aptkeys += distro_apt_keys.split() + if bb.utils.to_boolean(d.getVar('ISAR_USE_CACHED_BASE_REPO')): own_pub_key = d.getVar("BASE_REPO_KEY", False) if own_pub_key: - d.setVar("DEBOOTSTRAP_KEYRING", "--keyring ${APTKEYRING}") - for key in own_pub_key.split(): - url = urlparse(key) - d.appendVar("SRC_URI", " " + key) - d.appendVar("APTKEYFILES", " " + wd + url.path) + aptkeys += own_pub_key.split() + + d.setVar("DEBOOTSTRAP_KEYRING", "--keyring ${APTKEYRING}") + for key in aptkeys: + d.appendVar("SRC_URI", " %s" % key) + fetcher = bb.fetch2.Fetch([key], d) + filename = fetcher.localpath(key) + d.appendVar("APTKEYFILES", " %s" % filename) } def aggregate_files(d, file_list, file_out): -- 2.21.0