diff --git a/autodist-cgi b/autodist-cgi index 9ddfb3c..b355a06 100755 --- a/autodist-cgi +++ b/autodist-cgi @@ -32,15 +32,17 @@ if [ "$SHOWINDEX" ]; then [ "${AUTOPORT_ARCH[$i]}" ] || continue [ "${AUTOPORT_DISABLE[$i]}" -a "${AUTOPORT_DISABLE[$i]}" != "0" ] && continue - if [ "${AUTOPORT_UPDATE[$i]}" ]; then - echo "${AUTOPORT_REPOSITORIES[$i]}(${AUTOPORT_ARCH[$i]}) " - elif [ "${AUTOPORT_CHROOT[$i]}" ]; then - echo "${AUTOPORT_REPOSITORIES[$i]}(${AUTOPORT_ARCH[$i]}) " - elif [ "${AUTOPORT_NATIVE[$i]}" ]; then - echo "${AUTOPORT_REPOSITORIES[$i]}(${AUTOPORT_ARCH[$i]}) " - elif [ "${AUTOPORT_CROSS[$i]}" ]; then - echo "${AUTOPORT_REPOSITORIES[$i]}(${AUTOPORT_CROSS[$i]};${AUTOPORT_ARCH[$i]}) " - fi + for r in ${AUTOPORT_REPOSITORIES[$i]}; do + if [ "${AUTOPORT_UPDATE[$i]}" ]; then + echo "$r(${AUTOPORT_ARCH[$i]}) " + elif [ "${AUTOPORT_CHROOT[$i]}" ]; then + echo "$r(${AUTOPORT_ARCH[$i]}) " + elif [ "${AUTOPORT_NATIVE[$i]}" ]; then + echo "$r(${AUTOPORT_ARCH[$i]}) " + elif [ "${AUTOPORT_CROSS[$i]}" ]; then + echo "$r(${AUTOPORT_CROSS[$i]};${AUTOPORT_ARCH[$i]}) " + fi + done done echo "
" exit 0 @@ -59,6 +61,7 @@ if [ "$SHOWLOG" -a "$HOST" != "$AS_HOST" ]; then else for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do + for r in ${AUTOPORT_REPOSITORIES[$i]}; do [ "${AUTOPORT_ARCH[$i]}" ] || continue [ "${AUTOPORT_DISABLE[$i]}" -a "${AUTOPORT_DISABLE[$i]}" != "0" ] && continue @@ -68,11 +71,11 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do elif [ "${AUTOPORT_CHROOT[$i]}" ]; then LOGFILE="/var/autodist/log/autoport-chroot-${AUTOPORT_CHROOT[$i]}.log" LASTLOGFILE="/var/autodist/log/autoport-chroot-${AUTOPORT_CHROOT[$i]}-last.log" - AUTODISTLOGFILE="/var/autoport/${AUTOPORT_CHROOT[$i]}/home/${AUTOPORT_CHROOT_USER[$i]}/.autoport/${AUTOPORT_ARCH[$i]}/${AUTOPORT_REPOSITORIES[$i]}.log" + AUTODISTLOGFILE="/var/autoport/${AUTOPORT_CHROOT[$i]}/home/${AUTOPORT_CHROOT_USER[$i]}/.autoport/${AUTOPORT_ARCH[$i]}/$r.log" elif [ "${AUTOPORT_NATIVE[$i]}" ]; then - LOGFILE="/var/autodist/log/autoport-native-${AUTOPORT_REPOSITORIES[$i]}-${AUTOPORT_ARCH[$i]}.log" - LASTLOGFILE="/var/autodist/log/autoport-native-${AUTOPORT_REPOSITORIES[$i]}-${AUTOPORT_ARCH[$i]}-last.log" - AUTODISTLOGFILE="/var/autodist/.autoport/${AUTOPORT_ARCH[$i]}/${AUTOPORT_REPOSITORIES[$i]}.log" + LOGFILE="/var/autodist/log/autoport-native-$r-${AUTOPORT_ARCH[$i]}.log" + LASTLOGFILE="/var/autodist/log/autoport-native-$r-${AUTOPORT_ARCH[$i]}-last.log" + AUTODISTLOGFILE="/var/autodist/.autoport/${AUTOPORT_ARCH[$i]}/$r.log" elif [ "${AUTOPORT_CROSS[$i]}" ]; then LOGFILE="/var/autodist/log/autoport-cross-${AUTOPORT_CROSS[$i]}.log" LASTLOGFILE="/var/autodist/log/autoport-cross-${AUTOPORT_CROSS[$i]}-last.log" @@ -98,7 +101,7 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do break elif [ "$SHOWLOG" ]; then if [ "$HOST" = "$AS_HOST" -a "$NUM" = "$i" ]; then - echo "

$SHOWLOG log in ${AUTOPORT_REPOSITORIES[$i]}(${AUTOPORT_ARCH[$i]}):

" + echo "

$SHOWLOG log in $r(${AUTOPORT_ARCH[$i]}):

" cat << _EOF
@@ -138,17 +141,17 @@ _EOF [[ "$NUM" && "$NUM" != "$i" ]] && continue [[ "$HOST" = "$AS_HOST" ]] || continue if [ "${AUTOPORT_UPDATE[$i]}" ]; then - echo "* ${AUTOPORT_REPOSITORIES[$i]}(${AUTOPORT_ARCH[$i]}) (type:autodist update)" + echo "* $r(${AUTOPORT_ARCH[$i]}) (type:autodist update)" echo " [ log last ]" fi if [ "${AUTOPORT_CHROOT[$i]}" ]; then - echo "* ${AUTOPORT_REPOSITORIES[$i]}(${AUTOPORT_ARCH[$i]}) (type:chroot autoport chroot:${AUTOPORT_CHROOT[$i]})" + echo "* $r(${AUTOPORT_ARCH[$i]}) (type:chroot autoport chroot:${AUTOPORT_CHROOT[$i]})" echo " [ log last ]" fi if [ "${AUTOPORT_NATIVE[$i]}" ]; then - echo "* ${AUTOPORT_REPOSITORIES[$i]}(${AUTOPORT_ARCH[$i]}) (type:native autoport)" + echo "* $r(${AUTOPORT_ARCH[$i]}) (type:native autoport)" echo " [ log last ]" fi @@ -299,6 +302,7 @@ _EOF # echo echo "
" fi + done done # only root host (0) calls other hosts diff --git a/etc/cron.hourly/65-autoport b/etc/cron.hourly/65-autoport index 24aef65..50d81b4 100755 --- a/etc/cron.hourly/65-autoport +++ b/etc/cron.hourly/65-autoport @@ -32,6 +32,7 @@ function pid_check() { pid_check for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do + for r in ${AUTOPORT_REPOSITORIES[$i]}; do [ "${AUTOPORT_ARCH[$i]}" ] || continue [ "${AUTOPORT_DISABLE[$i]}" -a "${AUTOPORT_DISABLE[$i]}" != "0" ] && continue @@ -45,8 +46,8 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do LOGFILE="/var/autodist/log/autoport-chroot-${AUTOPORT_CHROOT[$i]}.log" LASTLOGFILE="/var/autodist/log/autoport-chroot-${AUTOPORT_CHROOT[$i]}-last.log" elif [ "${AUTOPORT_NATIVE[$i]}" ]; then - LOGFILE="/var/autodist/log/autoport-native-${AUTOPORT_REPOSITORIES[$i]}-${AUTOPORT_ARCH[$i]}.log" - LASTLOGFILE="/var/autodist/log/autoport-native-${AUTOPORT_REPOSITORIES[$i]}-${AUTOPORT_ARCH[$i]}-last.log" + LOGFILE="/var/autodist/log/autoport-native-$r-${AUTOPORT_ARCH[$i]}.log" + LASTLOGFILE="/var/autodist/log/autoport-native-$r-${AUTOPORT_ARCH[$i]}-last.log" elif [ "${AUTOPORT_CROSS[$i]}" ]; then LOGFILE="/var/autodist/log/autoport-cross-${AUTOPORT_CROSS[$i]}.log" LASTLOGFILE="/var/autodist/log/autoport-cross-${AUTOPORT_CROSS[$i]}-last.log" @@ -55,10 +56,8 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do fi [ -e $LOGFILE ] && mv $LOGFILE $LASTLOGFILE -# for r in ${AUTOPORT_REPOSITORIES[$i]}; do - echo "+ Autoport start at `date`" > $LOGFILE - echo "============================================" >> $LOGFILE -# done + echo "+ Autoport start at `date`" > $LOGFILE + echo "============================================" >> $LOGFILE if [ "${AUTOPORT_CHROOT[$i]}" ]; then a=${AUTOPORT_CHROOT[$i]} @@ -67,17 +66,14 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do echo "= Updating packages in $a chroot environment..." >> $LOGFILE LANG=C /usr/sbin/chroot /var/autoport/$a smart update --quiet > /dev/null LANG=C /usr/sbin/chroot /var/autoport/$a smart upgrade -y >> $LOGFILE - for r in ${AUTOPORT_REPOSITORIES[$i]}; do - echo "= Working on $r($a) in chroot mode..." >> $LOGFILE - [[ "`/usr/bin/tty`" != "not a tty" ]] && echo "Working on $r($a) in chroot mode" >> $LOGFILE - # disable service restarts - mv /var/autoport/$a/sbin/service /var/autoport/$a/sbin/service.autoport - ln -s /bin/true /var/autoport/$a/sbin/service - $CMD_PREFIX /usr/sbin/chroot /var/autoport/$a su -l ${AUTOPORT_CHROOT_USER[$i]} -c "autoport -b -r $r" >> $LOGFILE - mv /var/autoport/$a/sbin/service.autoport /var/autoport/$a/sbin/service - cat /var/autoport/$a/home/${AUTOPORT_CHROOT_USER[$i]}/.autoport/${AUTOPORT_ARCH[$i]}/${r}.log >> $LOGFILE - done -#$local_ftp/$r/autoport-$a.log + echo "= Working on $r($a) in chroot mode..." >> $LOGFILE + [[ "`/usr/bin/tty`" != "not a tty" ]] && echo "Working on $r($a) in chroot mode" >> $LOGFILE + # disable service restarts + mv /var/autoport/$a/sbin/service /var/autoport/$a/sbin/service.autoport + ln -s /bin/true /var/autoport/$a/sbin/service + $CMD_PREFIX /usr/sbin/chroot /var/autoport/$a su -l ${AUTOPORT_CHROOT_USER[$i]} -c "autoport -b -r $r" >> $LOGFILE + mv /var/autoport/$a/sbin/service.autoport /var/autoport/$a/sbin/service + cat /var/autoport/$a/home/${AUTOPORT_CHROOT_USER[$i]}/.autoport/${AUTOPORT_ARCH[$i]}/${r}.log >> $LOGFILE fi if [ "${AUTOPORT_NATIVE[$i]}" ]; then @@ -86,30 +82,21 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do echo "= Updating packages in $a native environment..." >> $LOGFILE LANG=C smart update > /dev/null LANG=C smart upgrade -y >> $LOGFILE - for r in ${AUTOPORT_REPOSITORIES[$i]}; do - echo "= Working on $r($a) in native mode" >> $LOGFILE - su -l autodist -c "autoport -b -r $r" >> $LOGFILE - cat /var/autodist/.autoport/$a/log >> $LOGFILE - done + echo "= Working on $r($a) in native mode" >> $LOGFILE + su -l autodist -c "autoport -b -r $r" >> $LOGFILE + cat /var/autodist/.autoport/$a/log >> $LOGFILE fi if [ "${AUTOPORT_CROSS[$i]}" ]; then a=${AUTOPORT_CROSS[$i]} - for r in ${AUTOPORT_REPOSITORIES[$i]}; do - [[ "`/usr/bin/tty`" != "not a tty" ]] && echo "Working on $r($a) in cross-platform mode" - echo "= Working on $r($a) in cross-platform mode" >> $LOGFILE - su -l autodist -c "autoport -b -x $a -r $r" >> $LOGFILE - cat /var/autodist/.autoport/$a/log >> $LOGFILE -# $local_ftp/$r/autoport-$a.log - done + [[ "`/usr/bin/tty`" != "not a tty" ]] && echo "Working on $r($a) in cross-platform mode" + echo "= Working on $r($a) in cross-platform mode" >> $LOGFILE + su -l autodist -c "autoport -b -x $a -r $r" >> $LOGFILE + cat /var/autodist/.autoport/$a/log >> $LOGFILE fi echo "- Autoport end at `date`" >> $LOGFILE echo "============================================" >> $LOGFILE -# for r in ${AUTOPORT_REPOSITORIES[$i]}; do -# [ -e /var/autodist/log/autoport-$r.log ] && \ -# cp /var/autodist/log/autoport-$r.log /var/autodist/log/autoport-$r-last.log -# done - + done done