public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: vijaikumar.kanagarajan@gmail.com
To: isar-users@googlegroups.com, henning.schild@siemens.com,
	claudius.heine.ext@siemens.com
Cc: jan.kiszka@siemens.com,
	Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
Subject: [PATCH v2] export GNUGPHOME for reprepro
Date: Mon,  5 Aug 2019 16:28:43 +0530	[thread overview]
Message-ID: <20190805105843.12319-1-Vijaikumar_Kangarajan@mentor.com> (raw)
In-Reply-To: <20190801133818.3915d525@md1za8fc.ad001.siemens.net>

From: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>

reprepro doesnot know about GNUPGHOME. If you trigger package feed
creation in a machine that has GNUPGHOME set, reprepro would not
know that it should use the new location and might use the keys it
find in the default ~/.gnupg directory.

Make GNUPGHOME available for reprepro.

Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
---

Changes in v2:
- Implemented review comments from Henning.
  1. Moved export out of loop in base-apt-helper
  2. Removed condition check before adding to BB_ENV_EXTRAWHITE

 meta/classes/base-apt-helper.bbclass       | 4 ++++
 meta/classes/dpkg-base.bbclass             | 3 +++
 meta/recipes-devtools/base-apt/base-apt.bb | 3 +++
 meta/recipes-devtools/isar-apt/isar-apt.bb | 3 +++
 scripts/isar-buildenv-internal             | 2 +-
 5 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/meta/classes/base-apt-helper.bbclass b/meta/classes/base-apt-helper.bbclass
index ba768da..81df45a 100644
--- a/meta/classes/base-apt-helper.bbclass
+++ b/meta/classes/base-apt-helper.bbclass
@@ -14,6 +14,10 @@ compare_pkg_md5sums() {
 populate_base_apt() {
     search_dir=$1
 
+    if [ -n "${GNUPGHOME}" ]; then
+        export GNUPGHOME="${GNUPGHOME}"
+    fi
+
     find $search_dir -name '*.deb' | while read package; do
         # NOTE: due to packages stored by reprepro are not modified, we can
         # use search by filename to check if package is already in repo. In
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 3e6ba8c..e03f1d0 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -120,6 +120,9 @@ repo_clean() {
 
 # Install package to Isar-apt
 do_deploy_deb() {
+    if [ -n "${GNUPGHOME}" ]; then
+        export GNUPGHOME="${GNUPGHOME}"
+    fi
     repo_clean
     reprepro -b ${REPO_ISAR_DIR}/${DISTRO} \
              --dbdir ${REPO_ISAR_DB_DIR}/${DISTRO} \
diff --git a/meta/recipes-devtools/base-apt/base-apt.bb b/meta/recipes-devtools/base-apt/base-apt.bb
index 1c0b4c6..488a44d 100644
--- a/meta/recipes-devtools/base-apt/base-apt.bb
+++ b/meta/recipes-devtools/base-apt/base-apt.bb
@@ -28,6 +28,9 @@ do_cache_config() {
     path_databases="${REPO_BASE_DB_DIR}/${BASE_DISTRO}"
 
     if [ ! -d "${path_databases}" ]; then
+        if [ -n "${GNUPGHOME}" ]; then
+            export GNUPGHOME="${GNUPGHOME}"
+        fi
         reprepro -b ${path_cache} \
                  --dbdir ${path_databases} \
                  export ${BASE_DISTRO_CODENAME}
diff --git a/meta/recipes-devtools/isar-apt/isar-apt.bb b/meta/recipes-devtools/isar-apt/isar-apt.bb
index a959691..e6f1753 100644
--- a/meta/recipes-devtools/isar-apt/isar-apt.bb
+++ b/meta/recipes-devtools/isar-apt/isar-apt.bb
@@ -20,6 +20,9 @@ do_cache_config() {
     path_databases="${REPO_ISAR_DB_DIR}/${DISTRO}"
 
     if [ ! -d "${path_databases}" ]; then
+        if [ -n "${GNUPGHOME}" ]; then
+            export GNUPGHOME="${GNUPGHOME}"
+        fi
         reprepro -b ${path_cache} \
                  --dbdir ${path_databases} \
                  export ${DEBDISTRONAME}
diff --git a/scripts/isar-buildenv-internal b/scripts/isar-buildenv-internal
index 2476d90..2186e40 100755
--- a/scripts/isar-buildenv-internal
+++ b/scripts/isar-buildenv-internal
@@ -66,5 +66,5 @@ export PATH
 BBPATH="${BUILDDIR}"
 export BBPATH
 
-BB_ENV_EXTRAWHITE="BUILDDIR ISARROOT http_proxy https_proxy ftp_proxy no_proxy"
+BB_ENV_EXTRAWHITE="BUILDDIR ISARROOT http_proxy https_proxy ftp_proxy no_proxy GNUPGHOME"
 export BB_ENV_EXTRAWHITE
-- 
2.17.1


  parent reply	other threads:[~2019-08-05 10:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25  7:15 [PATCH] " vijaikumar.kanagarajan
2019-07-25  7:25 ` Henning Schild
2019-07-25  8:59   ` Vijai Kumar K
2019-07-25  7:35 ` Claudius Heine
2019-07-25  9:08   ` [PATCH v2] " vijaikumar.kanagarajan
2019-07-25  9:10     ` Jan Kiszka
2019-07-25  9:15       ` Vijai Kumar K
2019-08-01 11:12 ` [PATCH] " Henning Schild
2019-08-01 11:23   ` vijai kumar
2019-08-01 11:34     ` vijai kumar
2019-08-01 11:38       ` Henning Schild
2019-08-01 11:42         ` vijai kumar
2019-08-01 11:48         ` Baurzhan Ismagulov
2019-08-01 11:52           ` Henning Schild
2019-08-01 12:09             ` Baurzhan Ismagulov
2019-08-05 10:58         ` vijaikumar.kanagarajan [this message]
2019-08-06  8:35           ` [PATCH v2] export GNUPGHOME " Baurzhan Ismagulov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190805105843.12319-1-Vijaikumar_Kangarajan@mentor.com \
    --to=vijaikumar.kanagarajan@gmail.com \
    --cc=Vijaikumar_Kanagarajan@mentor.com \
    --cc=claudius.heine.ext@siemens.com \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox