/[gentoo-x86]/eclass/eutils.eclass
Gentoo

Diff of /eclass/eutils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.60 Revision 1.65
1# Copyright 1999-2003 Gentoo Technologies, Inc. 1# Copyright 1999-2003 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.60 2003/09/23 01:26:58 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.65 2003/11/10 22:18:04 wolf31o2 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.
665# Simple script to replace 'dos2unix' binaries 665# Simple script to replace 'dos2unix' binaries
666# vapier@gentoo.org 666# vapier@gentoo.org
667# 667#
668# edos2unix(file, <more files>...) 668# edos2unix(file, <more files>...)
669edos2unix() { 669edos2unix() {
670 for f in $@ 670 for f in "$@"
671 do 671 do
672 cp ${f} ${T}/edos2unix 672 cp "${f}" ${T}/edos2unix
673 sed 's/\r$//' ${T}/edos2unix > ${f} 673 sed 's/\r$//' ${T}/edos2unix > "${f}"
674 done 674 done
675} 675}
676 676
677# Make a desktop file ! 677# Make a desktop file !
678# Great for making those icons in kde/gnome startmenu ! 678# Great for making those icons in kde/gnome startmenu !
705 "app-emulation") 705 "app-emulation")
706 type=Emulator 706 type=Emulator
707 ;; 707 ;;
708 "games-"*) 708 "games-"*)
709 type=Game 709 type=Game
710 ;;
711 "net-"*)
712 type=Network;
710 ;; 713 ;;
711 *) 714 *)
712 type= 715 type=
713 ;; 716 ;;
714 esac 717 esac
961 debug-print "Detected Makeself version ${ver} ... using ${skip} as offset" 964 debug-print "Detected Makeself version ${ver} ... using ${skip} as offset"
962 fi 965 fi
963 966
964 # we do this because otherwise a failure in gzip will cause 0 bytes to be sent 967 # we do this because otherwise a failure in gzip will cause 0 bytes to be sent
965 # to tar which will make tar not extract anything and exit with 0 968 # to tar which will make tar not extract anything and exit with 0
966 tail -n +${skip} ${src} | gzip -cd | tar -x --no-same-owner -f - 2>/dev/null 969 tail -n +${skip} ${src} 2>/dev/null \
970 | gzip -cd 2>/dev/null \
971 | tar -x --no-same-owner -f - 2>/dev/null
967 local pipestatus="${PIPESTATUS[*]}" 972 local pipestatus="${PIPESTATUS[*]}"
968 pipestatus="${pipestatus// }" 973 pipestatus="${pipestatus// }"
969 if [ "${pipestatus//0}" != "" ] 974 if [ "${pipestatus//0}" != "" ]
970 then 975 then
971 # maybe it isnt gzipped ... they usually are, but not always ... 976 # maybe it isnt gzipped ... they usually are, but not always ...
990 elif [ -e "${src}" ] ; then 995 elif [ -e "${src}" ] ; then
991 lic="${src}" 996 lic="${src}"
992 fi 997 fi
993 fi 998 fi
994 [ ! -f "${lic}" ] && die "Could not find requested license ${src}" 999 [ ! -f "${lic}" ] && die "Could not find requested license ${src}"
1000 local l="`basename ${lic}`"
995 1001
996 # here is where we check for the licenses the user already 1002 # here is where we check for the licenses the user already
997 # accepted ... if we don't find a match, we make the user accept 1003 # accepted ... if we don't find a match, we make the user accept
998 local alic 1004 local alic
999 for alic in ${ACCEPT_LICENSE} ; do 1005 for alic in ${ACCEPT_LICENSE} ; do
1000 [ "${alic}" == "*" ] && return 0 1006 [ "${alic}" == "*" ] && return 0
1001 [ "${alic}" == "${lic}" ] && return 0 1007 [ "${alic}" == "${l}" ] && return 0
1002 done 1008 done
1003 1009
1004 local licmsg="`mymktemp ${T}`" 1010 local licmsg="`mymktemp ${T}`"
1005 cat << EOF > ${licmsg} 1011 cat << EOF > ${licmsg}
1006********************************************************** 1012**********************************************************
1011********************************************************** 1017**********************************************************
1012 1018
1013EOF 1019EOF
1014 cat ${lic} >> ${licmsg} 1020 cat ${lic} >> ${licmsg}
1015 ${PAGER:-less} ${licmsg} || die "Could not execute pager (${PAGER}) to accept ${lic}" 1021 ${PAGER:-less} ${licmsg} || die "Could not execute pager (${PAGER}) to accept ${lic}"
1016 einfon "Do you accept the terms of this license? [yes/no] " 1022 einfon "Do you accept the terms of this license (${l})? [yes/no] "
1017 read alic 1023 read alic
1018 case ${alic} in 1024 case ${alic} in
1019 yes|Yes|y|Y) 1025 yes|Yes|y|Y)
1020 return 0 1026 return 0
1021 ;; 1027 ;;

Legend:
Removed from v.1.60  
changed lines
  Added in v.1.65

  ViewVC Help
Powered by ViewVC 1.1.20