openmamba-headserver-tools/etc/cron.hourly/30-openmamba-distromatic
2012-03-12 15:18:41 +01:00

75 lines
2.2 KiB
Bash
Executable File

#!/bin/sh
#
. /etc/sysconfig/openmamba-central
function distromatic_genhtml()
{
REP=$1
shift
TMPDIR=/tmp/distromatic-tmp-$REP
TMPFILE=`mktemp`
LOGFILE=$local_ftp/$REP/distromatic.log
[ -e $TMPDIR ] && rm -rf $TMPDIR
mkdir -p $TMPDIR
[ ! $local_ftp/$REP/SRPMS.base -nt $local_ftp/$REP/distromatic.log 2>/dev/null -a \
! $local_ftp/$REP/RPMS.i586 -nt $local_ftp/$REP/distromatic.log 2>/dev/null -a \
! $local_distromatic/$REP/warnings -nt $local_ftp/$REP/distromatic.log 2>/dev/null -a \
-e $local_distromatic/$REP/deps-i586 -a ! "$FORCE" ] && return
echo "==> Executing distromatic on $REP repository"
(cd $local_distromatic/$REP/
# for a in *; do
# cp -a $a $TMPDIR/
# done
echo "\
# distromatic log for the $REP repository (`date`)
# ====================================================================
" > $LOGFILE
distromatic -q -t $REP --genhtml --gendatatables --gensrcpkglist 1>$local_ftp/$REP/srcpkglist 2>$TMPFILE
cat $TMPFILE | grep -v "Warning: skipping unhandled requirement" >> $LOGFILE
/usr/sbin/openmamba-repository distromatic $REP
if [ "${REP:0:6}" = "devel-" ]; then
echo "==> Checking packages integrity"
echo "\
# ============================================================================
# INTEGRITY VERIFICATION for the $REP openmamba repository (`date`)
# ============================================================================
" >> $LOGFILE
/usr/sbin/openmamba-repository verify $REP >> $LOGFILE
echo "==> Checking package contents"
echo "\
# ============================================================================
# PACKAGES CHECK for the $REP openmamba repository (`date`)
# ============================================================================
" >> $LOGFILE
/usr/sbin/openmamba-repository diff $REP >> $LOGFILE
fi
# for a in *; do#
# # set date t#o past for files which are identical
# diff $a $TMPDIR/$a &>/dev/null || touch -d "Jan 01 2007 00:00" $a
# done
)
# rm -rf $TMPDIR
}
JOB=$1
if [ "$JOB" ]; then
FORCE=1
distromatic_genhtml $JOB
else
for a in ${local_reps[*]} ${remote_reps[*]}; do
distromatic_genhtml $a
done
fi
exit 0