openmamba-headserver-tools/etc/cron.hourly/20-openmamba-apt

69 lines
2.0 KiB
Plaintext
Raw Permalink Normal View History

2012-03-12 15:18:41 +01:00
#!/bin/sh
#
# openmamba repository script for apt
# (c) 2006-2010 by Silvan Calarco <silvan.calarco@mambasoft.it>
2012-03-12 15:18:41 +01:00
#
# generate apt database
. /etc/sysconfig/openmamba-central
[ "$1" ] && rep=$1
DATE=`date -R`
for r in ${local_reps[*]} ${remote_reps[*]}; do
[ "`find $local_ftp/$r/SRPMS.base/ -cnewer $local_ftp/$r/base`" -o \
! -e $local_ftp/$r/base/release -o "$rep" = "$r" ] && {
echo -n "==> Generating APT database for $r repository..."
for a in ${archs[*]}; do
echo -n "$a "
genbasedir \
--flat \
--newhashfile \
--changelog-since="last month" \
--topdir=$local_ftp \
--origin="http://www.openmamba.org" \
--label="openmamba" \
--suite="GNU/Linux distribution" \
--codename="$r" \
--version="$DATE" \
--archive="$r" \
--description="openmamba $r repository" \
--architecture="$a" \
$r \
$a
# --architectures="${archs[*]}" \
done
echo
# create global release file (--hashonly)
genbasedir \
--flat \
--hashonly \
--architectures="${archs[*]}" \
--newhashfile \
--changelog-since="last month" \
--topdir=$local_ftp \
--origin="http://www.openmamba.org" \
--label="openmamba" \
--suite="GNU/Linux distribution" \
--codename="$r" \
--version="$DATE" \
--archive="$r" \
--description="openmamba $r repository" \
$r ${archs[*]}
# --bz2only \
# > /dev/null
# base >/dev/null
HOME=/root LANG=C gpg --sign --armour --batch --no-default-recipient --detach-sign --yes --no-tty \
--passphrase-file /etc/sysconfig/openmamba-central-secret \
-u $gpgsignkey $local_ftp/$r/base/release 2>&1
# openmamba-genbasedir-sign $local_ftp/$r/
cat $local_ftp/$r/base/release.asc >> $local_ftp/$r/base/release
rm -f $local_ftp/$r/base/release.asc
2012-03-12 15:18:41 +01:00
}
done
exit 0