Optional chroot when installing nodejs
This commit is contained in:
parent
0871350f21
commit
95d12e1384
|
@ -61,8 +61,12 @@ function get_npm_arch {
|
||||||
}
|
}
|
||||||
|
|
||||||
function mesh_install_nodejs {
|
function mesh_install_nodejs {
|
||||||
chroot "$rootdir" apt-get -yq install g++ m4 libtool automake nodejs curl
|
mesh_install_nodejs_prefix=
|
||||||
chroot "$rootdir" apt-get -yq install libxext-dev libxtst-dev libxkbfile-dev
|
if [ $rootdir ]; then
|
||||||
|
mesh_install_nodejs_prefix="chroot $rootdir"
|
||||||
|
fi
|
||||||
|
$mesh_install_nodejs_prefix apt-get -yq install g++ m4 libtool automake nodejs curl
|
||||||
|
$mesh_install_nodejs_prefix apt-get -yq install libxext-dev libxtst-dev libxkbfile-dev
|
||||||
|
|
||||||
if [ ! -f ${rootdir}/usr/bin/nodejs ]; then
|
if [ ! -f ${rootdir}/usr/bin/nodejs ]; then
|
||||||
echo $'nodejs was not installed'
|
echo $'nodejs was not installed'
|
||||||
|
@ -83,9 +87,9 @@ function mesh_install_nodejs {
|
||||||
echo $'Unable to download npm installer'
|
echo $'Unable to download npm installer'
|
||||||
exit 8793636
|
exit 8793636
|
||||||
fi
|
fi
|
||||||
chroot "$rootdir" chmod +x /root/npm_install.sh
|
$mesh_install_nodejs_prefix chmod +x /root/npm_install.sh
|
||||||
sed -i "s|t=\"\${npm_install}\"|t=\"$NPM_VERSION\"|g" $rootdir/root/npm_install.sh
|
sed -i "s|t=\"\${npm_install}\"|t=\"$NPM_VERSION\"|g" $rootdir/root/npm_install.sh
|
||||||
chroot "$rootdir" /root/npm_install.sh
|
$mesh_install_nodejs_prefix /root/npm_install.sh
|
||||||
|
|
||||||
if [ ! -f $rootdir/usr/bin/npm ]; then
|
if [ ! -f $rootdir/usr/bin/npm ]; then
|
||||||
echo $'npm was not installed'
|
echo $'npm was not installed'
|
||||||
|
@ -95,8 +99,8 @@ function mesh_install_nodejs {
|
||||||
|
|
||||||
# update from the old debian nodejs version
|
# update from the old debian nodejs version
|
||||||
get_npm_arch
|
get_npm_arch
|
||||||
chroot "$rootdir" npm install --arch=$NPM_ARCH -g n@${NODEJS_N_VERSION} --save
|
$mesh_install_nodejs_prefix npm install --arch=$NPM_ARCH -g n@${NODEJS_N_VERSION} --save
|
||||||
chroot "$rootdir" n --arch $N_ARCH ${NODEJS_VERSION}
|
$mesh_install_nodejs_prefix n --arch $N_ARCH ${NODEJS_VERSION}
|
||||||
cp $rootdir/root/npm $rootdir/usr/bin/npm
|
cp $rootdir/root/npm $rootdir/usr/bin/npm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue