#! /bin/sh . ~apt-get/apt-scripts/mkapt.conf XIMIANDIR=$MIRRORDIR/linux/ximian # The idea of full/all/quick is: # * the first time you create the apt repository, choose "full". # * each night (when updates are downloaded), relaunch with "quick" # * if extra packages are put in 'extra' repository, relaunch with "quick" # * if the main os packages change (should not), use "all" if [ $# -ne 1 -o \( "$1" != "full" -a "$1" != "all" -a "$1" != "quick" \) ]; then echo "Usage: $0 [full|all|quick]" echo " full: full apt repository creation" echo " all: no apt repository creation, but full indexes regeneration" echo " quick: no apt repository creation, only updates indexes regeneration" exit 1 fi MODE=$1 ######################################################################## # each of the database definitions will contain: # # ximain_directory:apt_database:apt_package # # ximain_directory is relative to the ximian tree # apt_database is of format ximian-$distribution-$version-$architecture # apt_package is the ximian package name # XIMIAN_DBS=" evolution-snapshot/redhat-70-i386:ximian-redhat-7.0-i386:evolution-snapshot gnome-2-snapshot/redhat-72-i386:ximian-redhat-7.2-i386:gnome-2-snapshot gnome-2-snapshot/redhat-73-i386:ximian-redhat-7.3-i386:gnome-2-snapshot rc-autopull/redhat-70-i386:ximian-redhat-7.0-i386:rc-autopull rc-autopull/redhat-71-i386:ximian-redhat-7.1-i386:rc-autopull rc-autopull/redhat-72-i386:ximian-redhat-7.2-i386:rc-autopull ximian-gnome/redhat-70-i386:ximian-redhat-7.0-i386:gnome ximian-gnome/redhat-71-i386:ximian-redhat-7.1-i386:gnome ximian-gnome/redhat-72-i386:ximian-redhat-7.2-i386:gnome ximian-gnome/redhat-73-i386:ximian-redhat-7.3-i386:gnome ximian-preview/redhat-70-i386:ximian-redhat-7.0-i386:preview ximian-preview/redhat-71-i386:ximian-redhat-7.1-i386:preview ximian-preview/redhat-72-i386:ximian-redhat-7.2-i386:preview" ######################################################################## for conf_line in ${XIMIAN_DBS} ; do echo echo "> $conf_line" # parse out stuff from the db name xdir=$(echo ${conf_line} | cut -d : -f 1) # ximian dir adir=$(echo ${conf_line} | cut -d : -f 2) # apt dir comp=$(echo ${conf_line} | cut -d : -f 3) # component if test -z "$xdir" -o -z "$adir" -o -z "$comp" ; then echo "$0: could not parse ximian database from list" >&2 echo " $conf_line" >&2 echo "$0 terminating!" >&2 exit 1 fi # pull out the version and architecture ver=$(echo ${adir} | sed -e 's,^.*-\([0-9].[0-9]\)-.*$,\1,;') arc=$(echo ${adir} | sed -e 's,^.*-\([^-]*\)$,\1,;') if test -z "$ver" -o -z "$arc" ; then echo "$0: could not parse apt directory parts" >&2 echo " $adir" >&2 echo "$0 terminating!" >&2 exit 1 fi # create the database case "$MODE" in full) # Create directories mkdir -p $APTDIR/$adir/ximian/base || exit 1 # Create the release file RELFILE=$APTDIR/$adir/ximian/base/release.${comp} echo "Archive: stable" > $RELFILE echo "Component: $comp" >> $RELFILE echo "Version: $ver" >> $RELFILE echo "Origin: Ximain" >> $RELFILE echo "Label: $comp" >> $RELFILE echo "Architecture: $arc" >> $RELFILE # Put the symlinks for the base OS packages cd $APTDIR/$adir/ rm -f SRPMS.${comp} if test -d "../$XIMIANDIR/$xdir/source" ; then ln -sf ../$XIMIANDIR/$xdir/source SRPMS.${comp} else echo "cannot find SRPMS.... faking it" >&2 mkdir -p SRPMS.${comp} fi cd $APTDIR/$adir/ximian/ rm -f RPMS.${comp} ln -sf ../../$XIMIANDIR/$xdir RPMS.${comp} ;; all|quick) # TODO: some error checking; are the dirs there? ;; *) echo "$0: don't know mode '$MODE'." >&2 echo "$0 terminating!" >&2 exit 1 ;; esac # test to make sure that the source dir exists. it is ok for # this dir not to exist (a binary only package tree) but the # genbasedir will complain if it's not if ! test -d $APTDIR/$adir/SRPMS.${comp} ; then mkdir -p $APTDIR/$adir/SRPMS.${comp} fi # Generate APT indexes if test "$comp" != "os" -o "$MODE" == "full" ; then genbasedir --topdir=$APTDIR --bloat --bz2only $adir/ximian \ ${comp} fi done ########################################################################### # done echo echo done. echo