All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yevgeny Popovych <yevgenyp@pointgrab.com>
To: "André Draszik" <git@andred.net>,
	openembedded-devel@lists.openembedded.org
Subject: Re: [meta-java][PATCH 3/3] ca-certificates-java: Distinguish between SYSROOT and D
Date: Wed, 19 Sep 2018 13:09:00 +0300	[thread overview]
Message-ID: <42aafc61-86ba-94f9-477c-3e0f4e76295f@pointgrab.com> (raw)
In-Reply-To: <443986f19cf49e6d735faac8d6646a48f3ab5349.camel@andred.net>



On 09/17/2018 06:00 PM, André Draszik wrote:
> On Fri, 2018-09-07 at 21:10 +0300, Yevgeny Popovych wrote:
>> This fixes ca-certificates-java-hook invocation via
>> update-ca-certificates on build host and as a native tool.
>> Provide SYSROOT variable in the postinst and consume it in the script,
>> like ca-certificates recipe does.
>>
>> SYSROOT is set whenever the script is executed on the build host
>> (do_rootfs, or as native dependency).
>> D is only set during do_rootfs.
>>
> 
> I think I'm missing something...
> It looks like this patch switches the hook script to use $SYSROOT instead of
> $D, and SYSROOT is set to $D in the postinst explicitly.
> 
> In both cases, the expansion of $SYSROOT or $D will yield the same. How is
> that fixing anything? What am I missing?

The only difference would be between usage as a native tool and on do_rootfs.
SYSROOT is always set when run on build host and it points to the files we want to modify.
D is used only on do_rootfs and is used to find the hook (jar). On do_roofs these are equal.

> 
> 
> Cheers,
> Andre'
> 
> 
>> Change-Id: Ifbf50ca705a98012e1357ebf5afa33c07ea6cd87
>> Signed-off-by: Yevgeny Popovych <yevgenyp@pointgrab.com>
>> ---
>>  .../ca-certificates-java/ca-certificates-java.hook.in   | 17 ++++++++--
>> -------
>>  .../ca-certificates-java_20180516.bb                    |  2 +-
>>  2 files changed, 9 insertions(+), 10 deletions(-)
>>
>> diff --git a/recipes-core/ca-certificates-java/ca-certificates-java/ca-
>> certificates-java.hook.in b/recipes-core/ca-certificates-java/ca-
>> certificates-java/ca-certificates-java.hook.in
>> index 611a4ef..5e89dd9 100755
>> --- a/recipes-core/ca-certificates-java/ca-certificates-java/ca-
>> certificates-java.hook.in
>> +++ b/recipes-core/ca-certificates-java/ca-certificates-java/ca-
>> certificates-java.hook.in
>> @@ -8,20 +8,21 @@
>>  # and package update in OE, so the distinction between cases 2)
>>  # and 3) isn't perfect.
>>  
>> +# SYSROOT is set whenever the script is executed on the build host
>> +# (do_rootfs, or as native dependency).
>> +# D is only set during do_rootfs.
>> +
>>  self=$(basename $0)
>> -jvm_libdir="@@libdir_jvm@@"
>> +jvm_libdir="${JVM_LIBDIR:-@@libdir_jvm@@}"
>>  
>> -if [ -n "${D:-}" ] ; then
>> -    # called from postinst as part of image build on host
>> +if [ -n "${SYSROOT:-}" ] ; then
>> +    # called on build host - from postinst (directly or as a hook) or as
>> a native tool
>>      if [ -z "${JVM_LIBDIR:-}" ] ; then
>>          # if JVM_LIBDIR is not present - we were called as a hook
>>          echo "called as a hook of ca-certificates on do_rootfs, exiting"
>>          exit 0
>>      fi
>>  fi
>> -if [ -n "${JVM_LIBDIR:-}" ] ; then
>> -    jvm_libdir="${JVM_LIBDIR}"
>> -fi
>>  
>>  for JAVA in icedtea7-native/bin/java \
>>              openjdk-8-native/bin/java openjdk-8/bin/java openjre-
>> 8/bin/java \
>> @@ -58,6 +59,4 @@ else
>>      while read filename ; do
>>          echo "+${filename}"
>>      done
>> -fi | SYSROOT="${D:-}" ${JAVA} -Xmx64m \
>> -                              -jar ${D:-}@@datadir_java@@/@@JARFILENAME@@ 
>> \
>> -                              -storepass changeit
>> +fi | ${JAVA} -Xmx64m -jar ${D:-}@@datadir_java@@/@@JARFILENAME@@
>> -storepass changeit
>> diff --git a/recipes-core/ca-certificates-java/ca-certificates-
>> java_20180516.bb b/recipes-core/ca-certificates-java/ca-certificates-
>> java_20180516.bb
>> index 7db5110..2f2536d 100644
>> --- a/recipes-core/ca-certificates-java/ca-certificates-java_20180516.bb
>> +++ b/recipes-core/ca-certificates-java/ca-certificates-java_20180516.bb
>> @@ -100,7 +100,7 @@ pkg_postinst_${PN} () {
>>  	    fi
>>  	    JVM_LIBDIR=$NATIVE_ROOT${libdir_jvm}
>>  	fi
>> -	JVM_LIBDIR=$JVM_LIBDIR $D${sbindir}/create-ca-certificates-java
>> +	SYSROOT=$D JVM_LIBDIR=$JVM_LIBDIR $D${sbindir}/create-ca-
>> certificates-java
>>  }
>>  
>>  RDEPENDS_${PN} = "ca-certificates"
>> -- 
>> 2.7.4
>>
> 

-- 
Sincerely,
Yevgeny Popovych


  reply	other threads:[~2018-09-19 10:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-07 18:10 [meta-java][PATCH 0/3] ca-certificates-java: Fix usage as a native tool, do_rootfs failure Yevgeny Popovych
2018-09-07 18:10 ` [meta-java][PATCH 1/3] ca-certificates-java: Fix sysconfdir for -native recipe Yevgeny Popovych
2018-09-17 14:39   ` André Draszik
2018-09-19  9:48     ` Yevgeny Popovych
2018-09-19 14:27       ` André Draszik
2018-09-19 16:00         ` Yevgeny Popovych
2018-09-07 18:10 ` [meta-java][PATCH 2/3] ca-certificates-java: Don't fail when called via hook on do_rootfs Yevgeny Popovych
2018-09-17 14:44   ` André Draszik
2018-09-19  9:49     ` Yevgeny Popovych
2018-09-07 18:10 ` [meta-java][PATCH 3/3] ca-certificates-java: Distinguish between SYSROOT and D Yevgeny Popovych
2018-09-17 15:00   ` André Draszik
2018-09-19 10:09     ` Yevgeny Popovych [this message]
2018-09-17 15:10 ` [meta-java][PATCH 0/3] ca-certificates-java: Fix usage as a native tool, do_rootfs failure André Draszik
2018-09-19  9:45   ` Yevgeny Popovych

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=42aafc61-86ba-94f9-477c-3e0f4e76295f@pointgrab.com \
    --to=yevgenyp@pointgrab.com \
    --cc=git@andred.net \
    --cc=openembedded-devel@lists.openembedded.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.