scripts: install curl before baselayout

Now that Github rejects access to an unauthenticated URL with `git://`,
we have to make git and libcurl work with `https://`. However, during
the SDK stage2, curl is not explicitly installed, but just inherited
from the stage1. As a result, curl is built without the `ssl` USE flag.
So installation of baselayout fails with:

```
git fetch https://github.com/flatcar-linux/baselayout.git --prune +HEAD:refs/git-r3/HEAD
fatal: unable to access 'https://github.com/flatcar-linux/baselayout.git/':
Protocol "https" not supported or disabled in libcurl
```

To resolve the issue, we need to install curl with `BOOTSTRAP_USE=ssl`
before trying to install baselayout.
This commit is contained in:
Dongsu Park 2021-11-03 09:16:49 +01:00 committed by Dongsu Park
parent cfadfebd5b
commit 14b3353eaa

View File

@ -276,6 +276,8 @@ for atom in portage.settings.packages:
[[ -z ${myTEXINFO} ]] && myTEXINFO="sys-apps/texinfo"
[[ -z ${myZLIB} ]] && myZLIB="sys-libs/zlib"
[[ -z ${myNCURSES} ]] && myNCURSES="sys-libs/ncurses"
# Flatcar: install curl with BOOTSTRAP_USE=ssl to fetch from https URLs
[[ -z ${myCURL} ]] && myCURL="net-misc/curl"
# Do we really want gettext/nls?
[[ ${USE_NLS} != 1 ]] && myGETTEXT=
@ -297,6 +299,7 @@ einfo "Using libc : ${myLIBC}"
einfo "Using texinfo : ${myTEXINFO}"
einfo "Using zlib : ${myZLIB}"
einfo "Using ncurses : ${myNCURSES}"
einfo "Using curl : ${myCURL}"
echo -------------------------------------------------------------------------------
show_status 1 Configuring environment
echo -------------------------------------------------------------------------------
@ -324,6 +327,8 @@ export USE="-* bootstrap ${ALLOWED_USE} ${BOOTSTRAP_USE} openmp static-libs"
# We can't unmerge headers which may or may not exist yet. If your
# trying to use nptl, it may be needed to flush out any old headers
# before fully bootstrapping.
#
# Flatcar: install curl with BOOTSTRAP_USE=ssl to fetch from https URLs
if [ ${BOOTSTRAP_STAGE} -le 2 ] ; then
show_status 3 Emerging packages
if [[ ${RESUME} -eq 1 ]] ; then
@ -333,7 +338,7 @@ if [ ${BOOTSTRAP_STAGE} -le 2 ] ; then
else
STRAP_EMERGE_POSARGS="\
${myOS_HEADERS} ${myTEXINFO} ${myGETTEXT} ${myBINUTILS} \
${myGCC} ${myLIBC} ${myBASELAYOUT} ${myZLIB}"
${myGCC} ${myLIBC} ${myCURL} ${myBASELAYOUT} ${myZLIB}"
fi
${V_ECHO} emerge ${STRAP_EMERGE_OPTS} ${STRAP_EMERGE_POSARGS} || cleanup 1
echo -------------------------------------------------------------------------------