# Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ # # Author : Georgi Georgiev # # maildir eclass: makes sure a reasonable default for $MAILDIR is set ECLASS="maildir" INHERITED="$INHERITED $ECLASS" DEPEND="$DEPEND sys-apps/sed" [ -z "${MAILDIR}" ] && MAILDIR=".maildir" maildir_sed() { for file in $*; do sed -e "s|\.maildir|${MAILDIR}|g" < $file > $file.tmp # maybe we should use a smarter method; this will break if the file is # not writable; hopefully the need for this function will go away soon, # though cat $file.tmp > $file done } maildir_epatch() { basename="$(basename "$1")" cp "$1" "${WORKDIR}" maildir_sed "${WORKDIR}/${basename}" epatch "${WORKDIR}/${basename}" }