bash
This commit is contained in:
parent
6b4fca0353
commit
ddb600ead2
34 changed files with 770 additions and 343 deletions
|
@ -100,7 +100,7 @@ fi
|
|||
|
||||
[ -d /etc/portage -a -z "$BOX_USER_NAME" ] && BOX_USER_NAME=vagrant
|
||||
[ -d /etc/apt -a -z "$BOX_USER_NAME" ] && BOX_USER_NAME=devuan
|
||||
[ -z "$BOX_USER_HOME" ] && BOX_USER_HOME=/home/$BOX_USER_NAME
|
||||
[ -z "$BOX_USER_HOME" -o ! -d "$BOX_USER_HOME" ] && BOX_USER_HOME=/home/$BOX_USER_NAME
|
||||
[ -z "$BOX_ALSO_GROUP" ] && BOX_ALSO_GROUP=adm
|
||||
|
||||
[ -z "$LOGDIR" ] && LOGDIR=$PREFIX/tmp
|
||||
|
@ -148,20 +148,20 @@ fi
|
|||
if [ -d $UPTMP/boxuser_pip_cache ] ; then
|
||||
bootstrap_mkdir $BOX_USER_HOME/.cache/ && \
|
||||
cp -rip $UPTMP/boxuser_pip_cache $BOX_USER_HOME/.cache/pip && \
|
||||
chown -R ${BOX_USER_NAME}.{BOX_ALSO_GROUP} $BOX_USER_HOME/.cache/pip && \
|
||||
#? chown -R ${BOX_USER_NAME}.{BOX_ALSO_GROUP} $BOX_USER_HOME/.cache/pip && \
|
||||
chmod -R g+rw $BOX_USER_HOME/.cache/pip && \
|
||||
chmod -R o-w $BOX_USER_HOME/.cache/pip
|
||||
fi
|
||||
if [ -d $UPTMP/root_pip_cache ] ; then
|
||||
bootstrap_mkdir /root/.cache/ && \
|
||||
cp -rip $UPTMP/root_pip_cache /root/.cache/pip && \
|
||||
chown -R root.root /root/.cache/pip && \
|
||||
#? chown -R ${BOX_USER_NAME}:{BOX_ALSO_GROUP} /root/.cache/pip && \
|
||||
chmod -R g+rw /root/.cache/pip && \
|
||||
chmod -R o-w /root/.cache/pip
|
||||
fi
|
||||
|
||||
if [ -d /etc/apt ] ; then
|
||||
if ! route | grep -q ^default ; then
|
||||
if ! grep -q "^wlan[1-9][ ]00000000" /proc/net/route ; then
|
||||
DBUG "Not connected; skipping apt-get update"
|
||||
elif [ ! -f /var/log/dpkg.log ] ; then
|
||||
apt-get update # || exit 4
|
||||
|
@ -332,7 +332,7 @@ EOF
|
|||
fi
|
||||
|
||||
# dont use -CAfile $UPTMP/cacert.pem - we want it to fail if we need the cert
|
||||
if ! route | grep -q ^default ; then
|
||||
if ! grep -q "^wlan[1-9][ ]00000000" /proc/net/route ; then
|
||||
DBUG "Not connected; skipping SSL Certificate Authority chain"
|
||||
elif [ -n "$https_proxy" ] ; then
|
||||
proxy=`echo "$https_proxy" | sed -e 's/https*:\/*//'`
|
||||
|
@ -486,7 +486,7 @@ if ! $PREFIX/bin/python$PYVER.bash -c 'import curl' 2>/dev/null ; then
|
|||
[ -x /usr/bin/curl ] || which curl 2>/dev/null || emerge -vb curl
|
||||
fi
|
||||
#? --allow-unverified pycurl
|
||||
if ! route | grep -q ^default ; then
|
||||
if ! grep -q "^wlan[1-9][ ]00000000" /proc/net/route ; then
|
||||
INFO "Not connected; not installing pycurl"
|
||||
elif $PREFIX/bin/pip$PYVER.sh install $PIP_INSTALL_ARGS pycurl >> $LOGDIR/pip_install_pycurl.log 2>&1 ; then
|
||||
INFO "Installed pycurl from pip with $PREFIX/bin/pip install $PIP_INSTALL_ARGS"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
prog=$( basename $0 .bash )
|
||||
ROLE=base
|
||||
PYVER=3
|
||||
LOG_DIR=/usr/local/var/logs/portage
|
||||
[ -d $LOG_DIR ] || mkdir -p $LOG_DIR
|
||||
|
||||
|
@ -37,15 +38,16 @@ LARGS="$LARGS --noreplace"
|
|||
# LARGS="$LARGS --exclude "
|
||||
LOG=$LOG_DIR/$LOG
|
||||
export PYTHONPATH=
|
||||
echo INFO: $LARGS $ARGS >> $LOG 2>&1
|
||||
nice python$BASE_PYTHON3_MINOR $( which emerge ) $LARGS $ARGS >> $LOG 2>&1
|
||||
[ $? -ne 0 ] && exit $?
|
||||
echo INFO: emerge $LARGS $ARGS |tee -a $LOG >&2
|
||||
nice python$PYVER $( which emerge ) $LARGS $ARGS >> $LOG 2>&1
|
||||
retval=$?
|
||||
[ $retval -ne 0 ] && echo ERROR: $retval $LOG && tail $LOG && exit $retval
|
||||
if grep ImportError $LOG ; then
|
||||
echo ERROR: ImportError $ARGS && exit 10
|
||||
echo ERROR: ImportError $LOG && exit 10
|
||||
elif grep ParseError $LOG ; then
|
||||
echo ERROR: ParseError $ARGS && exit 11
|
||||
echo ERROR: ParseError $LOG && exit 11
|
||||
elif grep 'Your current profile is invalid' $LOG ; then
|
||||
echo ERROR: Your current profile is invalid $ARGS && exit 12
|
||||
echo ERROR: Your current profile is invalid $LOG && exit 12
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue