#!/bin/bash source "/usr/share/dar/dar-functions" daropts ":a:d:rs:" $@ set_dists set_tag #build_htaccess ### Sign first as we're starting the script. if [ "$GPG_NAME" -a "$GPG_PATH" ]; then echo "Signing (new) packages." touch "$STATEDIR/rpmfind" cd $PACKAGEDIR find . -newer $STATEDIR/rpmsign -name "*.rpm" -type f | xargs rpm --resign \ --define "_signature gpg" \ --define "_gpg_path $GPG_PATH" \ --define "_gpg_name $GPG_NAME" cd - if [ $? -eq 0 ]; then touch -r "$STATEDIR/rpmfind" "$STATEDIR/rpmsign" elif [ $? -gt 1 ]; then echo $? exit $? fi fi if [ "$CREATE_REPO" ]; then echo "Building SRPM repository." build_repo_srpms "source" fi for distname in $DISTS; do if [ -r "$CONFIGDIR/dists/$distname/config" ]; then source "$CONFIGDIR/dists/$distname/config" else warning "Configfile $CONFIGDIR/dists/$distname/config missing. Aborting." continue fi if [ "$CREATE_REPO" ]; then echo "Building $distname repository in $DISTPATH." ln -sf ../../../../source $FTPDIR/$DISTPATH/SRPMS.dag if [ "$REPO_APT" == "yes" ]; then build_tree_apt "$DISTNAME $DISTTAG" "$DISTPATH" fi if [ "$REPO_YUM" == "yes" -o "$REPO_CREATEREPO" == "yes" ]; then build_tree_yum "$DISTNAME $DISTTAG" "$DISTPATH" fi if [ "$REPO_APT" == "yes" ]; then build_repo_apt "$DISTPATH" fi if [ "$REPO_YUM" == "yes" ]; then build_repo_yum "$DISTPATH" fi if [ "$REPO_CREATEREPO" == "yes" ]; then build_repo "$DISTPATH" "$DISTDESC" fi fi build_env "$DISTNICK" "$DISTNAME" build_content "$DISTNAME" "$DISTPATH" if [ -f $STATEDIR/mirrors ]; then path="$(dirname $DISTPATH)" echo -n >$FTPDIR/$path/mirrors-rpmforge for mirror in $(cat "$STATEDIR/mirrors"); do echo "$mirror/$path/\$ARCH/dag" >>$FTPDIR/$path/mirrors-rpmforge done fi done echo -n "Building source package list." ( for TAG in $TAGS; do find $PACKAGEDIR/ -name "*.$TAG.src.rpm" | sed -e "s|.\+/\(.\+\)-[0-9].\+-[0-9].*\.$TAG\.src\.rpm|\1|" find $PACKAGEDIR/ -name "*.$TAG.nosrc.rpm" | sed -e "s|.\+/\(.\+\)-[0-9].\+-[0-9].*\.$TAG\.nosrc\.rpm|\1|" done ) | sort | uniq >$STATEDIR/packages-src.list echo -e "\t($(wc -l $STATEDIR/packages-src.list))" echo -n "Building package list." cat $STATEDIR/packages-*.list | sort | uniq > $STATEDIR/packages.list ln -f $STATEDIR/all-packages.list $STATEDIR/../packagelist-dag.txt for file in $STATEDIR/*.list; do base="$(basename $file .list)" wc -l $file >$STATEDIR/$(basename $file .list).count done echo -e "\t($(wc -l $STATEDIR/packages.list))" echo -n "Building summary list." rm -f $STATEDIR/summaries.list for app in $(cd $PACKAGEDIR; echo *); do app="$(basename $app)" SPECFILE="$PACKAGEDIR/$app/$app.spec" if [ -r "$SPECFILE" ]; then echo -e "$app\t$(rpmconf Summary "" nocheck)" >> $STATEDIR/summaries.list fi done echo -e "\t($(wc -l $STATEDIR/summaries.list))" echo -n "Building all package list." find $PACKAGEDIR/ -name "*.rpm" -printf "%P\n" | sort > $STATEDIR/all-packages.list echo -e "\t($(wc -l $STATEDIR/all-packages.list))" echo -n "$(date)" >$FTPDIR/TIMESTAMP echo -n "Press enter to start remote synchronisation." read echo "Starting remote synchronisation." if [ "$RSYNC_LIMIT" ]; then RSYNC_OPTIONS="$RSYNC_OPTIONS --bwlimit=$RSYNC_LIMIT" fi #rsync -anvzHL --progress --delete-after $RSYNC_OPTIONS -e /usr/bin/ssh $PACKAGEDIR $FTPDIR $RSYNC_TARGET #rsync -avHL --progress --delete-after $RSYNC_OPTIONS -e "/usr/bin/ssh -oCompression=no" $PACKAGEDIR $FTPDIR/ $RSYNC_TARGET rsync $RSYNC_OPTIONS -e "/usr/bin/ssh -oCompression=no" $PACKAGEDIR $FTPDIR/ $RSYNC_TARGET