#!/bin/bash source /etc/mage.rc.global source /etc/mage.rc die() { echo "Error: $@"; exit 1; } CURRENT_TIME="$(date +%Y%m%d-%H%M)" add2mage() { echo "$@" >> ${MAGEFILE} || die "adding '$@' to ${MAGEFILE}" } generate_fake_everything() { local DEPEND local MAGEFILE="${MAGEDIR}/fake/everything/everything-1-r1.mage" local i if [[ ! -d ${MAGEDIR}/fake/everything ]] then install -dv ${MAGEDIR}/fake/everything || die fi # create an empty file :> ${MAGEFILE} || die add2mage 'PKGNAME="everything-1-${ARCH}-r1"' add2mage 'STATE="unstable"' add2mage 'DESCRIPTION="fake everythin"' add2mage 'HOMEPAGE="http://www.magellan-linux.net/"' add2mage 'PKGTYPE="virtual"' add2mage 'MAGE_TARGETS=""' add2mage 'SPLIT_PACKAGE_BASE=""' pushd ${MAGEDIR} for i in */* do case ${i} in fake/*) continue ;; profiles/*) continue ;; include/*) continue ;; *) DEPEND="${DEPEND} >= ${i}-1" ;; esac done popd #echo "DEPEND='${DEPEND}'" add2mage "DEPEND=\"${DEPEND}\"" } if [[ -d ${INSTALLDB} ]] then echo "Backing up database to ${INSTALLDB}-${CURRENT_TIME} ..." mv "${INSTALLDB}" "${INSTALLDB}"-"${CURRENT_TIME}" || die install -d ${INSTALLDB} || die fi if [[ -d ${MAGEDIR} ]] then echo "Backing up database to ${MAGEDIR}-${CURRENT_TIME} ..." mv "${MAGEDIR}" "${MAGEDIR}"-"${CURRENT_TIME}" || die install -d ${MAGEDIR} || die # get includes and profiles rsync --recursive ${RSYNC}/include ${MAGEDIR} || die "rsync includes from '${RSYNC}'" rsync --recursive ${RSYNC}/profiles ${MAGEDIR} || die "rsync profiles from '${RSYNC}'" fi # regen mage-tre mage regen-mage-tree # generate fake pkg generate_fake_everything # pretend everything mage srcpretend everything if [[ ${REALLY_BUILD_ME} = 1 ]] then # install everything mage srcinstall everything # last but not least, uninstall the fake package mage uninstall everything fi echo "Everything done!" [[ ${REALLY_BUILD_ME} = 1 ]] && echo "All packages can be found in '${PKGDIR}'" echo