On Thu 1 Aug, 2019, 5:08 PM Henning Schild, <henning.schild@siemens.com> wrote:
Am Thu, 1 Aug 2019 17:04:08 +0530
schrieb vijai kumar <vijaikumar.kanagarajan@gmail.com>:

> On Thu 1 Aug, 2019, 4:53 PM vijai kumar,
> <vijaikumar.kanagarajan@gmail.com> wrote:
>
> >
> >
> > On Thu 1 Aug, 2019, 4:42 PM Henning Schild,
> > <henning.schild@siemens.com> wrote:
> > 
> >> Am Thu, 25 Jul 2019 12:45:04 +0530
> >> schrieb <vijaikumar.kanagarajan@gmail.com>:
> >> 
> >> > 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>
> >> > ---
> >> >  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             | 3 +++
> >> >  5 files changed, 16 insertions(+)
> >> >
> >> > diff --git a/meta/classes/base-apt-helper.bbclass
> >> > b/meta/classes/base-apt-helper.bbclass index ba768da..a8f2a41
> >> > 100644 --- a/meta/classes/base-apt-helper.bbclass
> >> > +++ b/meta/classes/base-apt-helper.bbclass
> >> > @@ -30,6 +30,10 @@ populate_base_apt() {
> >> >              compare_pkg_md5sums "$package" "$isar_package" &&
> >> > continue fi
> >> >
> >> > +        if [ ! -z ${GNUPGHOME} ]; then
> >> > +            export GNUPGHOME=${GNUPGHOME}
> >> > +        fi
> >> > + 
> >> 
> > 
> Also, This one could be moved of the loop.

Ok, please do that for v2.


Sure.



> >          # Check if this package is already in base-apt 
> >> >          isar_package=$(find ${REPO_BASE_DIR}/${BASE_DISTRO}
> >> > -name $base_name) if [ -n "$isar_package" ]; then
> >> > diff --git a/meta/classes/dpkg-base.bbclass
> >> > b/meta/classes/dpkg-base.bbclass index 3e6ba8c..da13f86 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 [ ! -z ${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..ca40b6c 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 [ ! -z ${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..8f517fe 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 [ ! -z ${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..7637d41 100755
> >> > --- a/scripts/isar-buildenv-internal
> >> > +++ b/scripts/isar-buildenv-internal
> >> > @@ -67,4 +67,7 @@ BBPATH="${BUILDDIR}"
> >> >  export BBPATH
> >> >
> >> >  BB_ENV_EXTRAWHITE="BUILDDIR ISARROOT http_proxy https_proxy
> >> > ftp_proxy no_proxy" +if [ ! -z ${GNUPGHOME} ]; then
> >> > +     BB_ENV_EXTRAWHITE="${BB_ENV_EXTRAWHITE} GNUPGHOME"
> >> > +fi 
> >>
> >> Why did you go for conditional append for that one, while the
> >> others are unconditional?
> >>
> >> Henning
> >> 
> >
> > GNUPGHOME might not be set in the host and hence went for the
> > condition. BTW, I don't think having always would cause issues.

If there is no reason for the condition please drop it.

Henning

Ok.


> > >  export BB_ENV_EXTRAWHITE
> >>
> >>