diff options
author | Mike Frysinger <vapier@gentoo.org> | 2003-06-29 05:26:01 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2003-06-29 05:26:01 +0000 |
commit | 73bd1f0550bb901a17b3b13d687ade394387fc44 (patch) | |
tree | dc79c2b9251010536e40d7e90d549f0f24b0b390 /eclass | |
parent | license for quake2 (diff) | |
download | gentoo-2-73bd1f0550bb901a17b3b13d687ade394387fc44.tar.gz gentoo-2-73bd1f0550bb901a17b3b13d687ade394387fc44.tar.bz2 gentoo-2-73bd1f0550bb901a17b3b13d687ade394387fc44.zip |
cd support funcs
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/games.eclass | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/eclass/games.eclass b/eclass/games.eclass index f4f97ac9556f..ff3ad40c6f44 100644 --- a/eclass/games.eclass +++ b/eclass/games.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/games.eclass,v 1.29 2003/06/26 22:24:41 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/games.eclass,v 1.30 2003/06/29 05:26:01 vapier Exp $ # # devlist: {bass,phoenix,vapier}@gentoo.org # @@ -98,6 +98,7 @@ games_pkg_setup() { enewuser ${GAMES_USER} 35 /bin/false /usr/games ${GAMES_GROUP} } +# pkg_postinst function ... create env.d entry and warn about games group games_pkg_postinst() { gamesenv echo @@ -105,3 +106,30 @@ games_pkg_postinst() { ewarn "be in the '${GAMES_GROUP}' group." echo } + +# some games require cdrom's to install datafiles ... +# $1: directory to check for on cdrom +# after function call, cdrom should be in ${GAMES_CD} +games_get_cd() { + export GAMES_CD=${GAMES_CDROM} + if [ -z "${GAMES_CD}" ] ; then + for mline in `mount | egrep -e '(iso|cdrom)' | awk '{print $3}'` ; do + [ -d ${mline}/${1} ] && GAMES_CD=${mline} + done + fi + [ ! -z "${GAMES_CD}" ] && einfo "Using ${GAMES_CD} as the data source" +} +# Pass a description of the cd to the function +games_verify_cd() { + if [ -z "${GAMES_CD}" ] ; then + echo + eerror "You must mount the $* CD first!" + echo + ewarn "If you do not have the CD, but have the data files" + ewarn "mounted somewhere on your filesystem, just export" + ewarn "the variable GAMES_CDROM so that it points to the" + ewarn "directory containing the files." + echo + die "You must provide the $* data before running the install" + fi +} |