#!/bin/sh VAR_WWW=/tmp/tcos INCOMING=$VAR_WWW/incoming COPY_TO=unstable REMOTE=cls-tcos@forja.rediris.es:/htdocs/debian rm -rf $VAR_WWW && scripts/prepare_mirror.sh "$VAR_WWW" # build packages if [ "$1" = "--build" ]; then cd initramfs-tools-tcos && dpkg-buildpackage -rfakeroot -sa && cd .. cd tcosmonitor && dpkg-buildpackage -rfakeroot -sa && cd .. cd tcosconfig && dpkg-buildpackage -rfakeroot -sa && cd .. fi exit cp *.* $INCOMING ls $INCOMING # # Make sure we're in the tcos/ directory # cd $INCOMING cd .. # # See if we found any new packages # found=0 for i in $INCOMING/*.changes; do if [ -e $i ]; then found=`expr $found + 1` fi done # # If we found none then exit # if [ "$found" -lt 1 ]; then echo "No new packages!!!" exit fi # # Now import each new package that we *did* find # for i in $INCOMING/*.changes; do # Import package to 'unstable' distribution. reprepro -Vb . include unstable $i # Delete the referenced files sed '1,/Files:/d' $i | sed '/BEGIN PGP SIGNATURE/,$d' \ | while read MD SIZE SECTION PRIORITY NAME; do if [ -z "$NAME" ]; then continue fi # # Delete the referenced file # if [ -f "$INCOMING/$NAME" ]; then rm "$INCOMING/$NAME" || exit 1 fi done # Finally delete the .changes file itself. rm $i done # sign packages mirror for rel in /tmp/tcos/dists/*/Release; do cd $(dirname $rel) echo "" echo "##########################################" echo " Signing $(basename $(dirname $rel) )" echo "##########################################" echo "" rm -rf Release.gpg gpg -abs -o Release.gpg Release done echo "Using rsyn to upload packages, please input password of $REMOTE" rsync -avz $VAR_WWW/* -e ssh $REMOTE