autodist/autoport: minor fixes

This commit is contained in:
Silvan Calarco 2014-04-25 12:12:07 +02:00
parent 49f415f364
commit 9076297743
3 changed files with 7 additions and 3 deletions

View File

@ -66,7 +66,7 @@ if [ "$SHOWINDEX" ]; then
elif [ "$AS_HOST" = "0" ]; then elif [ "$AS_HOST" = "0" ]; then
echo "Show: [<a href=\"?NUM=\">All hosts</a>] [<a href=\"?SHOWLOG=monitor\">Build hosts monitor</a>]<br>" echo "Show: [<a href=\"?NUM=\">All hosts</a>] [<a href=\"?SHOWLOG=monitor\">Build hosts monitor</a>]<br>"
for h in `seq 0 ${#AUTOPORT_CGI_HOST[*]}`; do for h in `seq 0 ${#AUTOPORT_CGI_HOST[*]}`; do
curl "${AUTOPORT_CGI_HOST[$h]}?AS_HOST=$h&SHOWINDEX=1" 2>/dev/null curl --connect-timeout 20 "${AUTOPORT_CGI_HOST[$h]}?AS_HOST=$h&SHOWINDEX=1" 2>/dev/null
done done
echo "<hr>" echo "<hr>"
fi fi

View File

@ -200,7 +200,7 @@ function find_requirements() {
if [ "`grep " is needed by " $OUTFILE`" ]; then if [ "`grep " is needed by " $OUTFILE`" ]; then
grep " is needed by " $OUTFILE | awk '{ print $1 }' | tr -d \' > $tf1 grep " is needed by " $OUTFILE | awk '{ print $1 }' | tr -d \' > $tf1
elif [ "`grep " matches no packages" $OUTFILE`" ]; then elif [ "`grep " matches no packages" $OUTFILE`" ]; then
grep " matches no packages" $OUTFILE | awk '{ print $2 }' | tr -d \' > $tf1 grep " matches no packages" $OUTFILE | awk '{ print $2 }' | tr -d \' | sed "s|@.*||" > $tf1
elif [ "`grep " no package provides " $OUTFILE`" ]; then elif [ "`grep " no package provides " $OUTFILE`" ]; then
grep " no package provides " $OUTFILE | sed "s|.* no package provides ||" > $tf1 grep " no package provides " $OUTFILE | sed "s|.* no package provides ||" > $tf1
fi fi

View File

@ -41,10 +41,14 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
$CMD_PREFIX /usr/sbin/chroot /var/autoport/${AUTOPORT_CHROOT[$i]} su -l $SU_APPEND ${AUTOPORT_CHROOT_USER[$i]} -c "${CHROOT_COMMAND}" $CMD_PREFIX /usr/sbin/chroot /var/autoport/${AUTOPORT_CHROOT[$i]} su -l $SU_APPEND ${AUTOPORT_CHROOT_USER[$i]} -c "${CHROOT_COMMAND}"
else else
echo "Entering ${AUTOPORT_CHROOT[$i]} autoport chroot environment" echo "Entering ${AUTOPORT_CHROOT[$i]} autoport chroot environment"
hostname=`hostname`
grep $hostname /var/autoport/${AUTOPORT_CHROOT[$i]}/etc/hosts >/dev/null || {
sed -i "s|\(^127.0.0.1[[:space:]]*\)|\1$hostname |" /var/autoport/${AUTOPORT_CHROOT[$i]}/etc/hosts
}
[ -e /var/autoport/${AUTOPORT_CHROOT[$i]}/etc/profile.d/autoport.sh ] || { [ -e /var/autoport/${AUTOPORT_CHROOT[$i]}/etc/profile.d/autoport.sh ] || {
echo "PS1='[\u@${AUTOPORT_CHROOT[$i]} \W]\$ '" > /var/autoport/${AUTOPORT_CHROOT[$i]}/etc/profile.d/autoport.sh echo "PS1='[\u@${AUTOPORT_CHROOT[$i]} \W]\$ '" > /var/autoport/${AUTOPORT_CHROOT[$i]}/etc/profile.d/autoport.sh
} }
$CMD_PREFIX /usr/sbin/chroot /var/autoport/${AUTOPORT_CHROOT[$i]} su -l $SU_APPEND ${AUTOPORT_CHROOT_USER[$i]} $CMD_PREFIX /usr/sbin/chroot /var/autoport/${AUTOPORT_CHROOT[$i]} su -l $SU_APPEND ${AUTOPORT_CHROOT_USER[$i]}
fi fi
exit 0 exit 0
done done