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

Diff of /eclass/eutils.eclass

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

Revision 1.328 Revision 1.349
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2009 Gentoo Foundation
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.328 2010/01/10 15:58:58 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.349 2010/08/19 21:32:26 vapier Exp $
4 4
5# @ECLASS: eutils.eclass 5# @ECLASS: eutils.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# base-system@gentoo.org 7# base-system@gentoo.org
8# @BLURB: many extra (but common) functions that are used in ebuilds 8# @BLURB: many extra (but common) functions that are used in ebuilds
17 17
18inherit multilib portability 18inherit multilib portability
19 19
20DESCRIPTION="Based on the ${ECLASS} eclass" 20DESCRIPTION="Based on the ${ECLASS} eclass"
21 21
22if has "${EAPI:-0}" 0 1 2; then
23
22# @FUNCTION: epause 24# @FUNCTION: epause
23# @USAGE: [seconds] 25# @USAGE: [seconds]
24# @DESCRIPTION: 26# @DESCRIPTION:
25# Sleep for the specified number of seconds (default of 5 seconds). Useful when 27# Sleep for the specified number of seconds (default of 5 seconds). Useful when
26# printing a message the user should probably be reading and often used in 28# printing a message the user should probably be reading and often used in
27# conjunction with the ebeep function. If the EPAUSE_IGNORE env var is set, 29# conjunction with the ebeep function. If the EPAUSE_IGNORE env var is set,
28# don't wait at all. 30# don't wait at all. Defined in EAPIs 0 1 and 2.
29epause() { 31epause() {
30 [[ -z ${EPAUSE_IGNORE} ]] && sleep ${1:-5} 32 [[ -z ${EPAUSE_IGNORE} ]] && sleep ${1:-5}
31} 33}
32 34
33# @FUNCTION: ebeep 35# @FUNCTION: ebeep
34# @USAGE: [number of beeps] 36# @USAGE: [number of beeps]
35# @DESCRIPTION: 37# @DESCRIPTION:
36# Issue the specified number of beeps (default of 5 beeps). Useful when 38# Issue the specified number of beeps (default of 5 beeps). Useful when
37# printing a message the user should probably be reading and often used in 39# printing a message the user should probably be reading and often used in
38# conjunction with the epause function. If the EBEEP_IGNORE env var is set, 40# conjunction with the epause function. If the EBEEP_IGNORE env var is set,
39# don't beep at all. 41# don't beep at all. Defined in EAPIs 0 1 and 2.
40ebeep() { 42ebeep() {
41 local n 43 local n
42 if [[ -z ${EBEEP_IGNORE} ]] ; then 44 if [[ -z ${EBEEP_IGNORE} ]] ; then
43 for ((n=1 ; n <= ${1:-5} ; n++)) ; do 45 for ((n=1 ; n <= ${1:-5} ; n++)) ; do
44 echo -ne "\a" 46 echo -ne "\a"
47 sleep 1 49 sleep 1
48 done 50 done
49 fi 51 fi
50} 52}
51 53
54else
55
56ebeep() {
57 ewarn "QA Notice: ebeep is not defined in EAPI=${EAPI}, please file a bug at http://bugs.gentoo.org"
58}
59
60epause() {
61 ewarn "QA Notice: epause is not defined in EAPI=${EAPI}, please file a bug at http://bugs.gentoo.org"
62}
63
64fi
65
66# @FUNCTION: eqawarn
67# @USAGE: [message]
68# @DESCRIPTION:
69# Proxy to einfo for package managers that don't provide eqawarn and use the PM
70# implementation if available.
71if ! declare -F eqawarn >/dev/null ; then
72 eqawarn() {
73 einfo "$@"
74 }
75fi
76
52# @FUNCTION: ecvs_clean 77# @FUNCTION: ecvs_clean
53# @USAGE: [list of dirs] 78# @USAGE: [list of dirs]
54# @DESCRIPTION: 79# @DESCRIPTION:
55# Remove CVS directories recursiveley. Useful when a source tarball contains 80# Remove CVS directories recursiveley. Useful when a source tarball contains
56# internal CVS directories. Defaults to $PWD. 81# internal CVS directories. Defaults to $PWD.
69 [[ -z $* ]] && set -- . 94 [[ -z $* ]] && set -- .
70 find "$@" -type d -name '.svn' -prune -print0 | xargs -0 rm -rf 95 find "$@" -type d -name '.svn' -prune -print0 | xargs -0 rm -rf
71} 96}
72 97
73# @FUNCTION: eshopts_push 98# @FUNCTION: eshopts_push
74# @USAGE: [options to `set`] 99# @USAGE: [options to `set` or `shopt`]
75# @DESCRIPTION: 100# @DESCRIPTION:
76# Often times code will want to enable a shell option to change code behavior. 101# Often times code will want to enable a shell option to change code behavior.
77# Since changing shell options can easily break other pieces of code (which 102# Since changing shell options can easily break other pieces of code (which
78# assume the default state), eshopts_push is used to (1) push the current shell 103# assume the default state), eshopts_push is used to (1) push the current shell
79# options onto a stack and (2) pass the specified arguments to set. 104# options onto a stack and (2) pass the specified arguments to set.
105#
106# If the first argument is '-s' or '-u', we assume you want to call `shopt`
107# rather than `set` as there are some options only available via that.
80# 108#
81# A common example is to disable shell globbing so that special meaning/care 109# A common example is to disable shell globbing so that special meaning/care
82# may be used with variables/arguments to custom functions. That would be: 110# may be used with variables/arguments to custom functions. That would be:
83# @CODE 111# @CODE
84# eshopts_push -o noglob 112# eshopts_push -o noglob
92# @CODE 120# @CODE
93eshopts_push() { 121eshopts_push() {
94 # have to assume __ESHOPTS_SAVE__ isn't screwed with 122 # have to assume __ESHOPTS_SAVE__ isn't screwed with
95 # as a `declare -a` here will reset its value 123 # as a `declare -a` here will reset its value
96 local i=${#__ESHOPTS_SAVE__[@]} 124 local i=${#__ESHOPTS_SAVE__[@]}
125 if [[ $1 == -[su] ]] ; then
97 __ESHOPTS_SAVE__[$i]=$- 126 __ESHOPTS_SAVE__[$i]=$(shopt -p)
98 [[ $# -eq 0 ]] && return 0 127 [[ $# -eq 0 ]] && return 0
128 shopt "$@" || die "eshopts_push: bad options to shopt: $*"
129 else
130 __ESHOPTS_SAVE__[$i]=$-
131 [[ $# -eq 0 ]] && return 0
99 set "$@" || die "eshopts_push: bad options to set: $*" 132 set "$@" || die "eshopts_push: bad options to set: $*"
133 fi
100} 134}
101 135
102# @FUNCTION: eshopts_pop 136# @FUNCTION: eshopts_pop
103# @USAGE: 137# @USAGE:
104# @DESCRIPTION: 138# @DESCRIPTION:
108 [[ $# -ne 0 ]] && die "eshopts_pop takes no arguments" 142 [[ $# -ne 0 ]] && die "eshopts_pop takes no arguments"
109 local i=$(( ${#__ESHOPTS_SAVE__[@]} - 1 )) 143 local i=$(( ${#__ESHOPTS_SAVE__[@]} - 1 ))
110 [[ ${i} -eq -1 ]] && die "eshopts_{push,pop}: unbalanced pair" 144 [[ ${i} -eq -1 ]] && die "eshopts_{push,pop}: unbalanced pair"
111 local s=${__ESHOPTS_SAVE__[$i]} 145 local s=${__ESHOPTS_SAVE__[$i]}
112 unset __ESHOPTS_SAVE__[$i] 146 unset __ESHOPTS_SAVE__[$i]
147 if [[ ${s} == "shopt -"* ]] ; then
148 eval "${s}" || die "eshopts_pop: sanity: invalid shopt options: ${s}"
149 else
113 set +$- || die "eshopts_pop: sanity: invalid shell settings: $-" 150 set +$- || die "eshopts_pop: sanity: invalid shell settings: $-"
114 set -${s} || die "eshopts_pop: sanity: unable to restore saved shell settings: ${s}" 151 set -${s} || die "eshopts_pop: sanity: unable to restore saved shell settings: ${s}"
152 fi
115} 153}
116 154
117# @VARIABLE: EPATCH_SOURCE 155# @VARIABLE: EPATCH_SOURCE
118# @DESCRIPTION: 156# @DESCRIPTION:
119# Default directory to search for patches. 157# Default directory to search for patches.
395 EPATCH_SOURCE=${EPATCH_SOURCE} \ 433 EPATCH_SOURCE=${EPATCH_SOURCE} \
396 EPATCH_SUFFIX="patch" \ 434 EPATCH_SUFFIX="patch" \
397 EPATCH_FORCE="yes" \ 435 EPATCH_FORCE="yes" \
398 EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \ 436 EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \
399 epatch 437 epatch
400 break 438 return 0
401 fi 439 fi
402 done 440 done
441 return 1
403} 442}
404 443
405# @FUNCTION: emktemp 444# @FUNCTION: emktemp
406# @USAGE: [temp dir] 445# @USAGE: [temp dir]
407# @DESCRIPTION: 446# @DESCRIPTION:
679 fi 718 fi
680 ;; 719 ;;
681 720
682 *) 721 *)
683 if [[ -z $@ ]] ; then 722 if [[ -z $@ ]] ; then
684 useradd ${opts} \ 723 useradd -r ${opts} \
685 -c "added by portage for ${PN}" \ 724 -c "added by portage for ${PN}" \
686 ${euser} \ 725 ${euser} \
687 || die "enewuser failed" 726 || die "enewuser failed"
688 else 727 else
689 einfo " - Extra: $@" 728 einfo " - Extra: $@"
690 useradd ${opts} "$@" \ 729 useradd -r ${opts} "$@" \
691 ${euser} \ 730 ${euser} \
692 || die "enewuser failed" 731 || die "enewuser failed"
693 fi 732 fi
694 ;; 733 ;;
695 esac 734 esac
808 esac 847 esac
809 groupadd -g ${egid} ${egroup} || die "enewgroup failed" 848 groupadd -g ${egid} ${egroup} || die "enewgroup failed"
810 ;; 849 ;;
811 850
812 *) 851 *)
852 # We specify -r so that we get a GID in the system range from login.defs
813 groupadd ${opts} ${egroup} || die "enewgroup failed" 853 groupadd -r ${opts} ${egroup} || die "enewgroup failed"
814 ;; 854 ;;
815 esac 855 esac
816 export SANDBOX_ON="${oldsandbox}" 856 export SANDBOX_ON="${oldsandbox}"
817} 857}
818 858
829 869
830# Make a desktop file ! 870# Make a desktop file !
831# Great for making those icons in kde/gnome startmenu ! 871# Great for making those icons in kde/gnome startmenu !
832# Amaze your friends ! Get the women ! Join today ! 872# Amaze your friends ! Get the women ! Join today !
833# 873#
834# make_desktop_entry(<command>, [name], [icon], [type], [path]) 874# make_desktop_entry(<command>, [name], [icon], [type], [fields])
835# 875#
836# binary: what command does the app run with ? 876# binary: what command does the app run with ?
837# name: the name that will show up in the menu 877# name: the name that will show up in the menu
838# icon: give your little like a pretty little icon ... 878# icon: give your little like a pretty little icon ...
839# this can be relative (to /usr/share/pixmaps) or 879# this can be relative (to /usr/share/pixmaps) or
840# a full path to an icon 880# a full path to an icon
841# type: what kind of application is this ? for categories: 881# type: what kind of application is this ? for categories:
842# http://standards.freedesktop.org/menu-spec/latest/apa.html 882# http://standards.freedesktop.org/menu-spec/latest/apa.html
843# path: if your app needs to startup in a specific dir 883# fields: extra fields to append to the desktop file; a printf string
844make_desktop_entry() { 884make_desktop_entry() {
845 [[ -z $1 ]] && eerror "make_desktop_entry: You must specify the executable" && return 1 885 [[ -z $1 ]] && die "make_desktop_entry: You must specify the executable"
846 886
847 local exec=${1} 887 local exec=${1}
848 local name=${2:-${PN}} 888 local name=${2:-${PN}}
849 local icon=${3:-${PN}} 889 local icon=${3:-${PN}}
850 local type=${4} 890 local type=${4}
851 local path=${5} 891 local fields=${5}
852 892
853 if [[ -z ${type} ]] ; then 893 if [[ -z ${type} ]] ; then
854 local catmaj=${CATEGORY%%-*} 894 local catmaj=${CATEGORY%%-*}
855 local catmin=${CATEGORY##*-} 895 local catmin=${CATEGORY##*-}
856 case ${catmaj} in 896 case ${catmaj} in
857 app) 897 app)
858 case ${catmin} in 898 case ${catmin} in
859 accessibility) type=Accessibility;; 899 accessibility) type=Accessibility;;
860 admin) type=System;; 900 admin) type=System;;
861 antivirus) type=System;; 901 antivirus) type=System;;
862 arch) type=Archiving;; 902 arch) type=Archiving;;
863 backup) type=Archiving;; 903 backup) type=Archiving;;
864 cdr) type=DiscBurning;; 904 cdr) type=DiscBurning;;
865 dicts) type=Dictionary;; 905 dicts) type=Dictionary;;
866 doc) type=Documentation;; 906 doc) type=Documentation;;
867 editors) type=TextEditor;; 907 editors) type=TextEditor;;
868 emacs) type=TextEditor;; 908 emacs) type=TextEditor;;
869 emulation) type=Emulator;; 909 emulation) type=Emulator;;
870 laptop) type=HardwareSettings;; 910 laptop) type=HardwareSettings;;
871 office) type=Office;; 911 office) type=Office;;
872 pda) type=PDA;; 912 pda) type=PDA;;
873 vim) type=TextEditor;; 913 vim) type=TextEditor;;
874 xemacs) type=TextEditor;; 914 xemacs) type=TextEditor;;
875 *) type=;;
876 esac 915 esac
877 ;; 916 ;;
878 917
879 dev) 918 dev)
880 type="Development" 919 type="Development"
881 ;; 920 ;;
882 921
883 games) 922 games)
884 case ${catmin} in 923 case ${catmin} in
885 action|fps) type=ActionGame;; 924 action|fps) type=ActionGame;;
886 arcade) type=ArcadeGame;; 925 arcade) type=ArcadeGame;;
887 board) type=BoardGame;; 926 board) type=BoardGame;;
888 emulation) type=Emulator;; 927 emulation) type=Emulator;;
889 kids) type=KidsGame;; 928 kids) type=KidsGame;;
890 puzzle) type=LogicGame;; 929 puzzle) type=LogicGame;;
891 roguelike) type=RolePlaying;; 930 roguelike) type=RolePlaying;;
892 rpg) type=RolePlaying;; 931 rpg) type=RolePlaying;;
893 simulation) type=Simulation;; 932 simulation) type=Simulation;;
894 sports) type=SportsGame;; 933 sports) type=SportsGame;;
895 strategy) type=StrategyGame;; 934 strategy) type=StrategyGame;;
896 *) type=;;
897 esac 935 esac
898 type="Game;${type}" 936 type="Game;${type}"
899 ;; 937 ;;
900 938
901 gnome) 939 gnome)
910 type="Network;Email" 948 type="Network;Email"
911 ;; 949 ;;
912 950
913 media) 951 media)
914 case ${catmin} in 952 case ${catmin} in
953 gfx)
915 gfx) type=Graphics;; 954 type=Graphics
955 ;;
956 *)
957 case ${catmin} in
916 radio) type=Tuner;; 958 radio) type=Tuner;;
917 sound) type=Audio;; 959 sound) type=Audio;;
918 tv) type=TV;; 960 tv) type=TV;;
919 video) type=Video;; 961 video) type=Video;;
920 *) type=;; 962 esac
963 type="AudioVideo;${type}"
964 ;;
921 esac 965 esac
922 type="AudioVideo;${type}"
923 ;; 966 ;;
924 967
925 net) 968 net)
926 case ${catmin} in 969 case ${catmin} in
927 dialup) type=Dialup;; 970 dialup) type=Dialup;;
928 ftp) type=FileTransfer;; 971 ftp) type=FileTransfer;;
929 im) type=InstantMessaging;; 972 im) type=InstantMessaging;;
930 irc) type=IRCClient;; 973 irc) type=IRCClient;;
931 mail) type=Email;; 974 mail) type=Email;;
932 news) type=News;; 975 news) type=News;;
933 nntp) type=News;; 976 nntp) type=News;;
934 p2p) type=FileTransfer;; 977 p2p) type=FileTransfer;;
935 *) type=;; 978 voip) type=Telephony;;
936 esac 979 esac
937 type="Network;${type}" 980 type="Network;${type}"
938 ;; 981 ;;
939 982
940 sci) 983 sci)
941 case ${catmin} in 984 case ${catmin} in
942 astro*) type=Astronomy;; 985 astro*) type=Astronomy;;
943 bio*) type=Biology;; 986 bio*) type=Biology;;
944 calc*) type=Calculator;; 987 calc*) type=Calculator;;
945 chem*) type=Chemistry;; 988 chem*) type=Chemistry;;
946 elec*) type=Electronics;; 989 elec*) type=Electronics;;
947 geo*) type=Geology;; 990 geo*) type=Geology;;
948 math*) type=Math;; 991 math*) type=Math;;
949 physics) type=Physics;; 992 physics) type=Physics;;
950 visual*) type=DataVisualization;; 993 visual*) type=DataVisualization;;
951 *) type=;;
952 esac 994 esac
953 type="Science;${type}" 995 type="Education;Science;${type}"
954 ;; 996 ;;
955 997
956 sys) 998 sys)
957 type="System" 999 type="System"
958 ;; 1000 ;;
959 1001
960 www) 1002 www)
961 case ${catmin} in 1003 case ${catmin} in
962 client) type=WebBrowser;; 1004 client) type=WebBrowser;;
963 *) type=;;
964 esac 1005 esac
965 type="Network" 1006 type="Network;${type}"
966 ;; 1007 ;;
967 1008
968 *) 1009 *)
969 type= 1010 type=
970 ;; 1011 ;;
975 else 1016 else
976 local desktop_name="${PN}-${SLOT}" 1017 local desktop_name="${PN}-${SLOT}"
977 fi 1018 fi
978 local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop" 1019 local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop"
979 #local desktop=${T}/${exec%% *:-${desktop_name}}.desktop 1020 #local desktop=${T}/${exec%% *:-${desktop_name}}.desktop
1021
1022 # Don't append another ";" when a valid category value is provided.
1023 type=${type%;}${type:+;}
1024
1025 eshopts_push -s extglob
1026 if [[ -n ${icon} && ${icon} != /* ]] && [[ ${icon} == *.xpm || ${icon} == *.png || ${icon} == *.svg ]]; then
1027 ewarn "As described in the Icon Theme Specification, icon file extensions are not"
1028 ewarn "allowed in .desktop files if the value is not an absolute path."
1029 icon=${icon%.@(xpm|png|svg)}
1030 fi
1031 eshopts_pop
980 1032
981 cat <<-EOF > "${desktop}" 1033 cat <<-EOF > "${desktop}"
982 [Desktop Entry] 1034 [Desktop Entry]
983 Name=${name} 1035 Name=${name}
984 Type=Application 1036 Type=Application
985 Comment=${DESCRIPTION} 1037 Comment=${DESCRIPTION}
986 Exec=${exec} 1038 Exec=${exec}
987 TryExec=${exec%% *} 1039 TryExec=${exec%% *}
988 Icon=${icon} 1040 Icon=${icon}
989 Categories=${type}; 1041 Categories=${type}
990 EOF 1042 EOF
991 1043
992 [[ ${path} ]] && echo "Path=${path}" >> "${desktop}" 1044 if [[ ${fields:-=} != *=* ]] ; then
1045 # 5th arg used to be value to Path=
1046 ewarn "make_desktop_entry: update your 5th arg to read Path=${fields}"
1047 fields="Path=${fields}"
1048 fi
1049 [[ -n ${fields} ]] && printf '%b\n' "${fields}" >> "${desktop}"
993 1050
994 ( 1051 (
995 # wrap the env here so that the 'insinto' call 1052 # wrap the env here so that the 'insinto' call
996 # doesn't corrupt the env of the caller 1053 # doesn't corrupt the env of the caller
997 insinto /usr/share/applications 1054 insinto /usr/share/applications
998 doins "${desktop}" 1055 doins "${desktop}"
999 ) 1056 ) || die "installing desktop file failed"
1000} 1057}
1001 1058
1002# @FUNCTION: validate_desktop_entries 1059# @FUNCTION: validate_desktop_entries
1003# @USAGE: [directories] 1060# @USAGE: [directories]
1004# @MAINTAINER: 1061# @MAINTAINER:
1283 [[ -z ${src} ]] && die "Could not locate source for '${src_input}'" 1340 [[ -z ${src} ]] && die "Could not locate source for '${src_input}'"
1284 1341
1285 local shrtsrc=$(basename "${src}") 1342 local shrtsrc=$(basename "${src}")
1286 echo ">>> Unpacking ${shrtsrc} to ${PWD}" 1343 echo ">>> Unpacking ${shrtsrc} to ${PWD}"
1287 if [[ -z ${skip} ]] ; then 1344 if [[ -z ${skip} ]] ; then
1288 local ver=$(grep -a '#.*Makeself' "${src}" | awk '{print $NF}') 1345 local ver=$(grep -m1 -a '#.*Makeself' "${src}" | awk '{print $NF}')
1289 local skip=0 1346 local skip=0
1290 exe=tail 1347 exe=tail
1291 case ${ver} in 1348 case ${ver} in
1292 1.5.*|1.6.0-nv) # tested 1.5.{3,4,5} ... guessing 1.5.x series is same 1349 1.5.*|1.6.0-nv) # tested 1.5.{3,4,5} ... guessing 1.5.x series is same
1293 skip=$(grep -a ^skip= "${src}" | cut -d= -f2) 1350 skip=$(grep -a ^skip= "${src}" | cut -d= -f2)
1295 2.0|2.0.1) 1352 2.0|2.0.1)
1296 skip=$(grep -a ^$'\t'tail "${src}" | awk '{print $2}' | cut -b2-) 1353 skip=$(grep -a ^$'\t'tail "${src}" | awk '{print $2}' | cut -b2-)
1297 ;; 1354 ;;
1298 2.1.1) 1355 2.1.1)
1299 skip=$(grep -a ^offset= "${src}" | awk '{print $2}' | cut -b2-) 1356 skip=$(grep -a ^offset= "${src}" | awk '{print $2}' | cut -b2-)
1300 let skip="skip + 1" 1357 (( skip++ ))
1301 ;; 1358 ;;
1302 2.1.2) 1359 2.1.2)
1303 skip=$(grep -a ^offset= "${src}" | awk '{print $3}' | head -n 1) 1360 skip=$(grep -a ^offset= "${src}" | awk '{print $3}' | head -n 1)
1304 let skip="skip + 1" 1361 (( skip++ ))
1305 ;; 1362 ;;
1306 2.1.3) 1363 2.1.3)
1307 skip=`grep -a ^offset= "${src}" | awk '{print $3}'` 1364 skip=`grep -a ^offset= "${src}" | awk '{print $3}'`
1308 let skip="skip + 1" 1365 (( skip++ ))
1309 ;; 1366 ;;
1310 2.1.4|2.1.5) 1367 2.1.4|2.1.5)
1311 skip=$(grep -a offset=.*head.*wc "${src}" | awk '{print $3}' | head -n 1) 1368 skip=$(grep -a offset=.*head.*wc "${src}" | awk '{print $3}' | head -n 1)
1312 skip=$(head -n ${skip} "${src}" | wc -c) 1369 skip=$(head -n ${skip} "${src}" | wc -c)
1313 exe="dd" 1370 exe="dd"
1322 esac 1379 esac
1323 debug-print "Detected Makeself version ${ver} ... using ${skip} as offset" 1380 debug-print "Detected Makeself version ${ver} ... using ${skip} as offset"
1324 fi 1381 fi
1325 case ${exe} in 1382 case ${exe} in
1326 tail) exe="tail -n +${skip} '${src}'";; 1383 tail) exe="tail -n +${skip} '${src}'";;
1327 dd) exe="dd ibs=${skip} skip=1 obs=1024 conv=sync if='${src}'";; 1384 dd) exe="dd ibs=${skip} skip=1 if='${src}'";;
1328 *) die "makeself cant handle exe '${exe}'" 1385 *) die "makeself cant handle exe '${exe}'"
1329 esac 1386 esac
1330 1387
1331 # lets grab the first few bytes of the file to figure out what kind of archive it is 1388 # lets grab the first few bytes of the file to figure out what kind of archive it is
1332 local tmpfile=$(emktemp) 1389 local tmpfile=$(emktemp)
1465 export CDROM_ROOT=${CD_ROOT_1:-${CD_ROOT}} 1522 export CDROM_ROOT=${CD_ROOT_1:-${CD_ROOT}}
1466 einfo "Found CD #${CDROM_CURRENT_CD} root at ${CDROM_ROOT}" 1523 einfo "Found CD #${CDROM_CURRENT_CD} root at ${CDROM_ROOT}"
1467 export CDROM_SET=-1 1524 export CDROM_SET=-1
1468 for f in ${CDROM_CHECK_1//:/ } ; do 1525 for f in ${CDROM_CHECK_1//:/ } ; do
1469 ((++CDROM_SET)) 1526 ((++CDROM_SET))
1470 [[ -e ${CD_ROOT}/${f} ]] && break 1527 [[ -e ${CDROM_ROOT}/${f} ]] && break
1471 done 1528 done
1472 export CDROM_MATCH=${f} 1529 export CDROM_MATCH=${f}
1473 return 1530 return
1474 fi 1531 fi
1475 1532
1743} 1800}
1744 1801
1745# @FUNCTION: built_with_use 1802# @FUNCTION: built_with_use
1746# @USAGE: [--hidden] [--missing <action>] [-a|-o] <DEPEND ATOM> <List of USE flags> 1803# @USAGE: [--hidden] [--missing <action>] [-a|-o] <DEPEND ATOM> <List of USE flags>
1747# @DESCRIPTION: 1804# @DESCRIPTION:
1805#
1806# Deprecated: Use EAPI 2 use deps in DEPEND|RDEPEND and with has_version calls.
1807#
1748# A temporary hack until portage properly supports DEPENDing on USE 1808# A temporary hack until portage properly supports DEPENDing on USE
1749# flags being enabled in packages. This will check to see if the specified 1809# flags being enabled in packages. This will check to see if the specified
1750# DEPEND atom was built with the specified list of USE flags. The 1810# DEPEND atom was built with the specified list of USE flags. The
1751# --missing option controls the behavior if called on a package that does 1811# --missing option controls the behavior if called on a package that does
1752# not actually support the defined USE flags (aka listed in IUSE). 1812# not actually support the defined USE flags (aka listed in IUSE).

Legend:
Removed from v.1.328  
changed lines
  Added in v.1.349

  ViewVC Help
Powered by ViewVC 1.1.20