[eclipse-yocto] [neon][PATCH 2/2] setup.sh: allow disabling P2 mirrors

Tim Orling timothy.t.orling at linux.intel.com
Mon Dec 17 08:52:28 PST 2018



> On Dec 13, 2018, at 10:55 AM, Chin Huat Ang <chin.huat.ang at intel.com> wrote:
> 
> Add new option for disabling P2 mirrors when downloading IUs. Note that
> setting "-vmargs -Declipse.p2.mirrors=false" at the end of the command
> line doesn't seem to work, so instead we set them by modifying the
> config.ini file from the eclipse archive that's being extracted.
> 
> To run setup.sh with P2 mirrors disabled:
> 
>  P2_MIRRORS=0 ./setup.sh

I’m inclined to have this be the default and only have mirrors turned on when using the 
‘--upstream’ flag.
> 
> [YOCTO #13050]
> 
> Signed-off-by: Chin Huat Ang <chin.huat.ang at intel.com>
> ---
> scripts/setup.sh | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
> 
> diff --git a/scripts/setup.sh b/scripts/setup.sh
> index d493c5a..2a87281 100755
> --- a/scripts/setup.sh
> +++ b/scripts/setup.sh
> @@ -97,6 +97,11 @@ ep_date="-201703010400"
> P2_disabled=false
> P2_no_dropins=false
> 
> +# Always use P2 mirrors by default unless we're troubleshooting build
> +# related issues.

The vast majority of builds of the plugins are going to be performed by the auto builder; set the conditions for NOT using the upstream mirrors by default and set the upstream mirrors when using the ‘--upstream’ flag. We should make sure it is documented in the README.

> +P2_MIRRORS=${P2_MIRRORS:=1}
> +
> +
> if [ ! -f eclipse/plugins/org.eclipse.swt_3.105.3.v20170228-0512.jar ]; then
> 
>   pushd .
> @@ -135,6 +140,22 @@ if [ ! -f eclipse/plugins/org.eclipse.swt_3.105.3.v20170228-0512.jar ]; then
>     fi
>     ln -s eclipse-${ep_ver}-${ep_arch}/eclipse eclipse
>   fi
> +
> +  # Disable P2 mirrors as needed, the following Eclipse wiki page
> +  # suggests adding -vmargs -Declipse.p2.mirrors=false at the end of
> +  # the Java command line, in our case this means when the P2 director
> +  # being invoked for feature installation:
> +  #
> +  #   https://wiki.eclipse.org/Equinox/p2/p2.mirrorsURL#Avoiding_mirrors.2C_even_when_using_p2.mirrorsURL
> +  #
> +  # Unfortunate this doesn't seem to work, so instead we modify the
> +  # generated config.ini to force P2 to not use mirrors. This should be
> +  # fine for as long as the eclipse installation directory which
> +  # contains the modified config.ini is only used for building the
> +  # plugins.
> +
> +  [ "$P2_MIRRORS" == "1" ] || echo "eclipse.p2.mirrors=false" >> eclipse/configuration/config.ini
> +
> fi
> 
> if [ ! -f eclipse/startup.jar ]; then
> -- 
> 2.7.4
> 
> _______________________________________________
> eclipse-yocto mailing list
> eclipse-yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/eclipse-yocto



More information about the eclipse-yocto mailing list