Switch from using smart to dnf and integrate other old changes
This commit is contained in:
parent
f23570f228
commit
ac8340c0d6
@ -5,7 +5,8 @@
|
||||
RPMS_CTIME_OLD="+14"
|
||||
BUILD_CTIME_OLD="+14"
|
||||
SOURCES_CTIME_OLD="+40"
|
||||
SOURCES_PATH_CTIME_OLD="+730"
|
||||
SOURCES_ARCHIVES_CTIME_OLD="+14"
|
||||
SOURCES_PATCH_CTIME_OLD="+730"
|
||||
SRPMS_CTIME_OLD="+14"
|
||||
TMP_CTIME_OLD="+2"
|
||||
|
||||
@ -18,10 +19,23 @@ function clean() {
|
||||
[ -e $dir/RPM/RPMS/$arch/ ] && find $dir/RPM/RPMS/$arch/ -mindepth 1 -maxdepth 1 -type f -mtime ${RPMS_CTIME_OLD} -exec rm -f {} \;
|
||||
done
|
||||
[ -e $dir/RPM/RPMS/noarch/ ] && find $dir/RPM/RPMS/noarch/ -mindepth 1 -maxdepth 1 -type f -mtime ${RPMS_CTIME_OLD} -exec rm -f {} \;
|
||||
[ -e $dir/RPM/BUILD/ ] && find $dir/RPM/BUILD/ -mindepth 1 -maxdepth 1 -type d -ctime ${BUILD_CTIME_OLD} -exec rm -rf {} \;
|
||||
if [ -e $dir/RPM/BUILD/ ]; then
|
||||
find $dir/RPM/BUILD/ -mindepth 1 -maxdepth 1 -type d -ctime ${BUILD_CTIME_OLD} -exec rm -rf {} \;
|
||||
# delete older package duplicates
|
||||
find $dir/RPM/BUILD/ -maxdepth 1 | sort -V | \
|
||||
while read curr; do
|
||||
if [ "${curr/-[0-9._]*}" = "${last/-[0-9._]*}" -a "${last}" ]; then
|
||||
rm -rf $last
|
||||
fi
|
||||
last=$curr;
|
||||
done
|
||||
fi
|
||||
[ -e $dir/RPM/SOURCES/ ] && {
|
||||
find $dir/RPM/SOURCES/ -mindepth 1 -maxdepth 1 -type f -ctime ${SOURCES_CTIME_OLD} -a ! -name "*.patch" -exec rm -rf {} \;
|
||||
find $dir/RPM/SOURCES/ -mindepth 1 -maxdepth 1 -type f -ctime ${SOURCES_PATH_CTIME_OLD} -a -name "*.patch" -exec rm -rf {} \;
|
||||
find $dir/RPM/SOURCES/ -mindepth 1 -maxdepth 1 -type f -ctime ${SOURCES_ARCHIVES_CTIME_OLD} -a -name "*.tar.xz" -exec rm -rf {} \;
|
||||
find $dir/RPM/SOURCES/ -mindepth 1 -maxdepth 1 -type f -ctime ${SOURCES_ARCHIVES_CTIME_OLD} -a -name "*.tar.bz2" -exec rm -rf {} \;
|
||||
find $dir/RPM/SOURCES/ -mindepth 1 -maxdepth 1 -type f -ctime ${SOURCES_ARCHIVES_CTIME_OLD} -a -name "*.tar.gz" -exec rm -rf {} \;
|
||||
find $dir/RPM/SOURCES/ -mindepth 1 -maxdepth 1 -type f -ctime ${SOURCES_PATCH_CTIME_OLD} -a -name "*.patch" -exec rm -rf {} \;
|
||||
}
|
||||
[ -e $dir/RPM/SRPMS/ ] && find $dir/RPM/SRPMS/ -mindepth 1 -maxdepth 1 -type f -mtime ${SRPMS_CTIME_OLD} -exec rm -f {} \;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# openmamba-autobuild-autoport daily cron script
|
||||
# (c) 2008-2014 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
# (c) 2008-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
#
|
||||
#. /etc/sysconfig/openmamba-central
|
||||
. /etc/sysconfig/autoport
|
||||
@ -60,8 +60,7 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
|
||||
if [ ! "$NATIVE_UPGRADED" ]; then
|
||||
[[ "`/usr/bin/tty`" != "not a tty" ]] && echo "Updating packages in $a native environment"
|
||||
echo "= Updating packages in $a native environment..." >> $LOGFILE
|
||||
LANG=C smart update > /dev/null
|
||||
LANG=C smart upgrade -y >> $LOGFILE
|
||||
LANG=C dnf update -y >> $LOGFILE
|
||||
NATIVE_UPGRADED=1
|
||||
fi
|
||||
echo "= Working on $r($a) in native mode" >> $LOGFILE
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# openmamba-autobuild-autoport daily cron script
|
||||
# (c) 2008-2014 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
# (c) 2008-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
#
|
||||
#. /etc/sysconfig/openmamba-central
|
||||
. /etc/sysconfig/autoport
|
||||
@ -42,8 +42,7 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
|
||||
# sudo mount -o bind /proc /var/autoport/${AUTOPORT_CHROOT[$i]}/proc
|
||||
[[ "`/usr/bin/tty`" != "not a tty" ]] && echo "Updating packages in ${AUTOPORT_CHROOT[$i]} chroot environment"
|
||||
#echo "= Updating packages in ${AUTOPORT_CHROOT[$i]} chroot environment..." >> $LOGFILE
|
||||
LANG=C /usr/sbin/chroot /var/autoport/${AUTOPORT_CHROOT[$i]} smart update --quiet > /dev/null
|
||||
LANG=C /usr/sbin/chroot /var/autoport/${AUTOPORT_CHROOT[$i]} smart upgrade -y > /dev/null
|
||||
LANG=C /usr/sbin/chroot /var/autoport/${AUTOPORT_CHROOT[$i]} dnf update -y > /dev/null
|
||||
[ "${AUTOPORT_CHROOT_ICECREAM[$i]}" ] && LANG=C /usr/sbin/chroot /var/autoport/${AUTOPORT_CHROOT[$i]} /etc/init.d/icecream start
|
||||
fi
|
||||
|
||||
@ -84,8 +83,7 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
|
||||
# a=${AUTOPORT_ARCH[$i]}
|
||||
# [[ "`/usr/bin/tty`" != "not a tty" ]] && echo "Updating packages in $a native environment"
|
||||
# echo "= Updating packages in $a native environment..." >> $LOGFILE
|
||||
# LANG=C smart update > /dev/null
|
||||
# LANG=C smart upgrade -y >> $LOGFILE
|
||||
# LANG=C dnf update -y >> $LOGFILE
|
||||
# echo "= Working on $r($a) in native mode" >> $LOGFILE
|
||||
# su -l autodist -c "autoport -b -r $r" >> $LOGFILE
|
||||
# cat /var/autodist/.autoport/$a/$r-current.log >> $LOGFILE
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# webbuild cgi script
|
||||
# Copyright (c) 2012-2015 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
# Copyright (c) 2012-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
#
|
||||
. /usr/share/autodist/webbuild-functions
|
||||
. /usr/share/autodist/webbuild-functions-private
|
||||
@ -379,7 +379,7 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then
|
||||
b=`ps ax|grep "rpmbuild .*\.spec$"|while read l; do basename "${l/.spec}"; done`
|
||||
echo -n "Load: <b>${u/*: }</b> | Disk: <b>$f</b> | "
|
||||
[ "$b" ] && echo -n "Building now: <b>$b</b> | "
|
||||
[ "`ps cax|grep smart`" ] && echo "<b style=\"color:red\">Updating</b> | "
|
||||
[ "`ps cax|grep dnf`" ] && echo "<b style=\"color:red\">Updating</b> | "
|
||||
if [ "$STATE_JOBSSHOWALL" != "1" ]; then
|
||||
echo "$USER's jobs: [<a href=# onclick=ajax_getvalues(\"REQUEST=refreshjobs&JOBSSHOWALL=true\");>Show all jobs</a>]"
|
||||
else
|
||||
@ -421,14 +421,15 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then
|
||||
if [ ! "$NOTIFIED" ]; then
|
||||
sed -i "s|^\($CMDPID $CMDUSER.* $PROCESSLOG $RETCODE\)|\1\+|" $WEBBUILD_STATEDIR/processes
|
||||
fi
|
||||
CMDEMAIL=`grep "USER_EMAIL" $WEBBUILD_STATEDIR/users/$CMDUSER.conf|sed "s|USER_EMAIL=||"`
|
||||
if [ $RETCODE -eq 0 ]; then
|
||||
[ "$NOTIFIED" ] || \
|
||||
social_log "SUSER=$USER STYPE=job SEMAIL=$USER_EMAIL STEXT=\"''$cmdline'' <b>succesfully completed</b>!\" STIME=`date +%s`" >> /tmp/y
|
||||
social_log "SUSER=$CMDUSER STYPE=job SEMAIL=$CMDEMAIL STEXT=\"''$cmdline'' <b>succesfully completed</b>!\" STIME=`date +%s`" >> /tmp/y
|
||||
# echo -n "<font color=lightgreen><b>OK</b></font>"
|
||||
echo -n "<img style=\"margin-top:-1px;margin-right:2px;\" src=\"/images/ok.png\" width=10 height=10 alt=\"OK\" title=\"Job successfully completed\">"
|
||||
else
|
||||
[ "$NOTIFIED" ] || \
|
||||
social_log "SUSER=$USER STYPE=job SEMAIL=$USER_EMAIL STEXT=\"''$cmdline'' <b>failed</b>\" STIME=`date +%s`"
|
||||
social_log "SUSER=$CMDUSER STYPE=job SEMAIL=$CMDEMAIL STEXT=\"''$cmdline'' <b>failed</b>\" STIME=`date +%s`"
|
||||
# echo -n "<font color=red><b>ERROR ($RETCODE)</b></font>"
|
||||
echo -n "<img style=\"margin-top:-1px;margin-right:2px;\" src=\"/images/fail.png\" width=10 height=10 alt=\"ERROR\" title=\"Job returned with error $RETCODE\">"
|
||||
fi
|
||||
@ -1676,7 +1677,7 @@ case $REQUEST in
|
||||
"savespec") echo "File <b>$PACKAGE.spec</b> saved."
|
||||
RET=-1
|
||||
;;
|
||||
"smartupgrade") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "export LANG=C;sudo smart update && sudo smart upgrade"
|
||||
"smartupgrade") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "export LANG=C;sudo dnf update -y"
|
||||
RET=$?
|
||||
;;
|
||||
"runldconfig") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "export LANG=C;sudo /sbin/ldconfig"
|
||||
|
Loading…
Reference in New Issue
Block a user