| 1 | # Copyright 1999-2004 Gentoo Technologies, Inc. |
1 | # Copyright 1999-2004 Gentoo Technologies, Inc. |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.78 2004/02/09 17:08:44 brad_mssw Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.81 2004/02/24 03:53:26 vapier Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Martin Schlemmer <azarah@gentoo.org> |
5 | # Author: Martin Schlemmer <azarah@gentoo.org> |
| 6 | # |
6 | # |
| 7 | # This eclass is for general purpose functions that most ebuilds |
7 | # This eclass is for general purpose functions that most ebuilds |
| 8 | # have to implement themselves. |
8 | # have to implement themselves. |
| … | |
… | |
| 456 | fi |
456 | fi |
| 457 | fi |
457 | fi |
| 458 | } |
458 | } |
| 459 | |
459 | |
| 460 | # Cheap replacement for when debianutils (and thus mktemp) |
460 | # Cheap replacement for when debianutils (and thus mktemp) |
| 461 | # do not exist on the users system |
461 | # does not exist on the users system |
| 462 | # vapier@gentoo.org |
462 | # vapier@gentoo.org |
| 463 | # |
463 | # |
| 464 | # Takes just 1 parameter (the directory to create tmpfile in) |
464 | # Takes just 1 parameter (the directory to create tmpfile in) |
| 465 | mymktemp() { |
465 | mymktemp() { |
| 466 | local topdir="$1" |
466 | local topdir="$1" |
| … | |
… | |
| 696 | |
696 | |
| 697 | local exec="${1}" |
697 | local exec="${1}" |
| 698 | local name="${2:-${PN}}" |
698 | local name="${2:-${PN}}" |
| 699 | local icon="${3:-${PN}.png}" |
699 | local icon="${3:-${PN}.png}" |
| 700 | local type="${4}" |
700 | local type="${4}" |
|
|
701 | local subdir="${6}" |
| 701 | local path="${5:-${GAMES_PREFIX}}" |
702 | local path="${5:-${GAMES_PREFIX}}" |
| 702 | if [ -z "${type}" ] |
703 | if [ -z "${type}" ] |
| 703 | then |
704 | then |
| 704 | case ${CATEGORY} in |
705 | case ${CATEGORY} in |
| 705 | "app-emulation") |
706 | "app-emulation") |
| 706 | type=Emulator |
707 | type=Emulator |
|
|
708 | subdir="Games" |
| 707 | ;; |
709 | ;; |
| 708 | "games-"*) |
710 | "games-"*) |
| 709 | type=Game |
711 | type=Game |
|
|
712 | subdir="Games" |
| 710 | ;; |
713 | ;; |
| 711 | "net-"*) |
714 | "net-"*) |
| 712 | type=Network; |
715 | type=Network |
|
|
716 | subdir="${type}" |
| 713 | ;; |
717 | ;; |
| 714 | *) |
718 | *) |
| 715 | type= |
719 | type= |
|
|
720 | subdir= |
| 716 | ;; |
721 | ;; |
| 717 | esac |
722 | esac |
| 718 | fi |
723 | fi |
| 719 | local desktop="${T}/${exec}.desktop" |
724 | local desktop="${T}/${exec}.desktop" |
| 720 | |
725 | |
| … | |
… | |
| 750 | # done |
755 | # done |
| 751 | #fi |
756 | #fi |
| 752 | |
757 | |
| 753 | if [ -d "/usr/share/applnk" ] |
758 | if [ -d "/usr/share/applnk" ] |
| 754 | then |
759 | then |
| 755 | insinto /usr/share/applnk/${type} |
760 | insinto /usr/share/applnk/${subdir} |
| 756 | doins ${desktop} |
761 | doins ${desktop} |
| 757 | fi |
762 | fi |
| 758 | |
763 | |
| 759 | return 0 |
764 | return 0 |
| 760 | } |
765 | } |
| … | |
… | |
| 1100 | # remember, you can only go forward in the cd chain, you can't go back. |
1105 | # remember, you can only go forward in the cd chain, you can't go back. |
| 1101 | cdrom_load_next_cd() { |
1106 | cdrom_load_next_cd() { |
| 1102 | export CDROM_CURRENT_CD=$((CDROM_CURRENT_CD + 1)) |
1107 | export CDROM_CURRENT_CD=$((CDROM_CURRENT_CD + 1)) |
| 1103 | local var= |
1108 | local var= |
| 1104 | |
1109 | |
|
|
1110 | if [ ! -z "${CD_ROOT}" ] ; then |
|
|
1111 | einfo "Using same root as before for CD #${CDROM_CURRENT_CD}" |
|
|
1112 | return |
|
|
1113 | fi |
|
|
1114 | |
| 1105 | unset CDROM_ROOT |
1115 | unset CDROM_ROOT |
| 1106 | var=CDROM_ROOTS_${CDROM_CURRENT_CD} |
1116 | var=CDROM_ROOTS_${CDROM_CURRENT_CD} |
| 1107 | if [ -z "${!var}" ] ; then |
1117 | if [ -z "${!var}" ] ; then |
| 1108 | var="CDROM_CHECK_${CDROM_CURRENT_CD}" |
1118 | var="CDROM_CHECK_${CDROM_CURRENT_CD}" |
| 1109 | cdrom_locate_file_on_cd ${!var} |
1119 | cdrom_locate_file_on_cd ${!var} |