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

Diff of /eclass/eutils.eclass

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

Revision 1.326 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.326 2010/01/10 05:53:36 vapier 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.
265 # let people use globs in the exclude 303 # let people use globs in the exclude
266 eshopts_push -o noglob 304 eshopts_push -o noglob
267 305
268 local ex 306 local ex
269 for ex in ${EPATCH_EXCLUDE} ; do 307 for ex in ${EPATCH_EXCLUDE} ; do
270 [[ ${patchname} == ${ex} ]] && continue 308 if [[ ${patchname} == ${ex} ]] ; then
309 eshopts_pop
310 continue 2
311 fi
271 done 312 done
272 313
273 eshopts_pop 314 eshopts_pop
274 fi 315 fi
275 316
392 EPATCH_SOURCE=${EPATCH_SOURCE} \ 433 EPATCH_SOURCE=${EPATCH_SOURCE} \
393 EPATCH_SUFFIX="patch" \ 434 EPATCH_SUFFIX="patch" \
394 EPATCH_FORCE="yes" \ 435 EPATCH_FORCE="yes" \
395 EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \ 436 EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \
396 epatch 437 epatch
397 break 438 return 0
398 fi 439 fi
399 done 440 done
441 return 1
400} 442}
401 443
402# @FUNCTION: emktemp 444# @FUNCTION: emktemp
403# @USAGE: [temp dir] 445# @USAGE: [temp dir]
404# @DESCRIPTION: 446# @DESCRIPTION:
676 fi 718 fi
677 ;; 719 ;;
678 720
679 *) 721 *)
680 if [[ -z $@ ]] ; then 722 if [[ -z $@ ]] ; then
681 useradd ${opts} \ 723 useradd -r ${opts} \
682 -c "added by portage for ${PN}" \ 724 -c "added by portage for ${PN}" \
683 ${euser} \ 725 ${euser} \
684 || die "enewuser failed" 726 || die "enewuser failed"
685 else 727 else
686 einfo " - Extra: $@" 728 einfo " - Extra: $@"
687 useradd ${opts} "$@" \ 729 useradd -r ${opts} "$@" \
688 ${euser} \ 730 ${euser} \
689 || die "enewuser failed" 731 || die "enewuser failed"
690 fi 732 fi
691 ;; 733 ;;
692 esac 734 esac
805 esac 847 esac
806 groupadd -g ${egid} ${egroup} || die "enewgroup failed" 848 groupadd -g ${egid} ${egroup} || die "enewgroup failed"
807 ;; 849 ;;
808 850
809 *) 851 *)
852 # We specify -r so that we get a GID in the system range from login.defs
810 groupadd ${opts} ${egroup} || die "enewgroup failed" 853 groupadd -r ${opts} ${egroup} || die "enewgroup failed"
811 ;; 854 ;;
812 esac 855 esac
813 export SANDBOX_ON="${oldsandbox}" 856 export SANDBOX_ON="${oldsandbox}"
814} 857}
815 858
826 869
827# Make a desktop file ! 870# Make a desktop file !
828# Great for making those icons in kde/gnome startmenu ! 871# Great for making those icons in kde/gnome startmenu !
829# Amaze your friends ! Get the women ! Join today ! 872# Amaze your friends ! Get the women ! Join today !
830# 873#
831# make_desktop_entry(<command>, [name], [icon], [type], [path]) 874# make_desktop_entry(<command>, [name], [icon], [type], [fields])
832# 875#
833# binary: what command does the app run with ? 876# binary: what command does the app run with ?
834# name: the name that will show up in the menu 877# name: the name that will show up in the menu
835# icon: give your little like a pretty little icon ... 878# icon: give your little like a pretty little icon ...
836# this can be relative (to /usr/share/pixmaps) or 879# this can be relative (to /usr/share/pixmaps) or
837# a full path to an icon 880# a full path to an icon
838# type: what kind of application is this ? for categories: 881# type: what kind of application is this ? for categories:
839# http://standards.freedesktop.org/menu-spec/latest/apa.html 882# http://standards.freedesktop.org/menu-spec/latest/apa.html
840# path: if your app needs to startup in a specific dir 883# fields: extra fields to append to the desktop file; a printf string
841make_desktop_entry() { 884make_desktop_entry() {
842 [[ -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"
843 886
844 local exec=${1} 887 local exec=${1}
845 local name=${2:-${PN}} 888 local name=${2:-${PN}}
846 local icon=${3:-${PN}} 889 local icon=${3:-${PN}}
847 local type=${4} 890 local type=${4}
848 local path=${5} 891 local fields=${5}
849 892
850 if [[ -z ${type} ]] ; then 893 if [[ -z ${type} ]] ; then
851 local catmaj=${CATEGORY%%-*} 894 local catmaj=${CATEGORY%%-*}
852 local catmin=${CATEGORY##*-} 895 local catmin=${CATEGORY##*-}
853 case ${catmaj} in 896 case ${catmaj} in
854 app) 897 app)
855 case ${catmin} in 898 case ${catmin} in
856 accessibility) type=Accessibility;; 899 accessibility) type=Accessibility;;
857 admin) type=System;; 900 admin) type=System;;
858 antivirus) type=System;; 901 antivirus) type=System;;
859 arch) type=Archiving;; 902 arch) type=Archiving;;
860 backup) type=Archiving;; 903 backup) type=Archiving;;
861 cdr) type=DiscBurning;; 904 cdr) type=DiscBurning;;
862 dicts) type=Dictionary;; 905 dicts) type=Dictionary;;
863 doc) type=Documentation;; 906 doc) type=Documentation;;
864 editors) type=TextEditor;; 907 editors) type=TextEditor;;
865 emacs) type=TextEditor;; 908 emacs) type=TextEditor;;
866 emulation) type=Emulator;; 909 emulation) type=Emulator;;
867 laptop) type=HardwareSettings;; 910 laptop) type=HardwareSettings;;
868 office) type=Office;; 911 office) type=Office;;
869 pda) type=PDA;; 912 pda) type=PDA;;
870 vim) type=TextEditor;; 913 vim) type=TextEditor;;
871 xemacs) type=TextEditor;; 914 xemacs) type=TextEditor;;
872 *) type=;;
873 esac 915 esac
874 ;; 916 ;;
875 917
876 dev) 918 dev)
877 type="Development" 919 type="Development"
878 ;; 920 ;;
879 921
880 games) 922 games)
881 case ${catmin} in 923 case ${catmin} in
882 action|fps) type=ActionGame;; 924 action|fps) type=ActionGame;;
883 arcade) type=ArcadeGame;; 925 arcade) type=ArcadeGame;;
884 board) type=BoardGame;; 926 board) type=BoardGame;;
885 emulation) type=Emulator;; 927 emulation) type=Emulator;;
886 kids) type=KidsGame;; 928 kids) type=KidsGame;;
887 puzzle) type=LogicGame;; 929 puzzle) type=LogicGame;;
888 roguelike) type=RolePlaying;; 930 roguelike) type=RolePlaying;;
889 rpg) type=RolePlaying;; 931 rpg) type=RolePlaying;;
890 simulation) type=Simulation;; 932 simulation) type=Simulation;;
891 sports) type=SportsGame;; 933 sports) type=SportsGame;;
892 strategy) type=StrategyGame;; 934 strategy) type=StrategyGame;;
893 *) type=;;
894 esac 935 esac
895 type="Game;${type}" 936 type="Game;${type}"
896 ;; 937 ;;
897 938
898 gnome) 939 gnome)
907 type="Network;Email" 948 type="Network;Email"
908 ;; 949 ;;
909 950
910 media) 951 media)
911 case ${catmin} in 952 case ${catmin} in
953 gfx)
912 gfx) type=Graphics;; 954 type=Graphics
955 ;;
956 *)
957 case ${catmin} in
913 radio) type=Tuner;; 958 radio) type=Tuner;;
914 sound) type=Audio;; 959 sound) type=Audio;;
915 tv) type=TV;; 960 tv) type=TV;;
916 video) type=Video;; 961 video) type=Video;;
917 *) type=;; 962 esac
963 type="AudioVideo;${type}"
964 ;;
918 esac 965 esac
919 type="AudioVideo;${type}"
920 ;; 966 ;;
921 967
922 net) 968 net)
923 case ${catmin} in 969 case ${catmin} in
924 dialup) type=Dialup;; 970 dialup) type=Dialup;;
925 ftp) type=FileTransfer;; 971 ftp) type=FileTransfer;;
926 im) type=InstantMessaging;; 972 im) type=InstantMessaging;;
927 irc) type=IRCClient;; 973 irc) type=IRCClient;;
928 mail) type=Email;; 974 mail) type=Email;;
929 news) type=News;; 975 news) type=News;;
930 nntp) type=News;; 976 nntp) type=News;;
931 p2p) type=FileTransfer;; 977 p2p) type=FileTransfer;;
932 *) type=;; 978 voip) type=Telephony;;
933 esac 979 esac
934 type="Network;${type}" 980 type="Network;${type}"
935 ;; 981 ;;
936 982
937 sci) 983 sci)
938 case ${catmin} in 984 case ${catmin} in
939 astro*) type=Astronomy;; 985 astro*) type=Astronomy;;
940 bio*) type=Biology;; 986 bio*) type=Biology;;
941 calc*) type=Calculator;; 987 calc*) type=Calculator;;
942 chem*) type=Chemistry;; 988 chem*) type=Chemistry;;
943 elec*) type=Electronics;; 989 elec*) type=Electronics;;
944 geo*) type=Geology;; 990 geo*) type=Geology;;
945 math*) type=Math;; 991 math*) type=Math;;
946 physics) type=Physics;; 992 physics) type=Physics;;
947 visual*) type=DataVisualization;; 993 visual*) type=DataVisualization;;
948 *) type=;;
949 esac 994 esac
950 type="Science;${type}" 995 type="Education;Science;${type}"
951 ;; 996 ;;
952 997
953 sys) 998 sys)
954 type="System" 999 type="System"
955 ;; 1000 ;;
956 1001
957 www) 1002 www)
958 case ${catmin} in 1003 case ${catmin} in
959 client) type=WebBrowser;; 1004 client) type=WebBrowser;;
960 *) type=;;
961 esac 1005 esac
962 type="Network" 1006 type="Network;${type}"
963 ;; 1007 ;;
964 1008
965 *) 1009 *)
966 type= 1010 type=
967 ;; 1011 ;;
972 else 1016 else
973 local desktop_name="${PN}-${SLOT}" 1017 local desktop_name="${PN}-${SLOT}"
974 fi 1018 fi
975 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"
976 #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
977 1032
978 cat <<-EOF > "${desktop}" 1033 cat <<-EOF > "${desktop}"
979 [Desktop Entry] 1034 [Desktop Entry]
980 Name=${name} 1035 Name=${name}
981 Type=Application 1036 Type=Application
982 Comment=${DESCRIPTION} 1037 Comment=${DESCRIPTION}
983 Exec=${exec} 1038 Exec=${exec}
984 TryExec=${exec%% *} 1039 TryExec=${exec%% *}
985 Icon=${icon} 1040 Icon=${icon}
986 Categories=${type}; 1041 Categories=${type}
987 EOF 1042 EOF
988 1043
989 [[ ${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}"
990 1050
991 ( 1051 (
992 # wrap the env here so that the 'insinto' call 1052 # wrap the env here so that the 'insinto' call
993 # doesn't corrupt the env of the caller 1053 # doesn't corrupt the env of the caller
994 insinto /usr/share/applications 1054 insinto /usr/share/applications
995 doins "${desktop}" 1055 doins "${desktop}"
996 ) 1056 ) || die "installing desktop file failed"
997} 1057}
998 1058
999# @FUNCTION: validate_desktop_entries 1059# @FUNCTION: validate_desktop_entries
1000# @USAGE: [directories] 1060# @USAGE: [directories]
1001# @MAINTAINER: 1061# @MAINTAINER:
1280 [[ -z ${src} ]] && die "Could not locate source for '${src_input}'" 1340 [[ -z ${src} ]] && die "Could not locate source for '${src_input}'"
1281 1341
1282 local shrtsrc=$(basename "${src}") 1342 local shrtsrc=$(basename "${src}")
1283 echo ">>> Unpacking ${shrtsrc} to ${PWD}" 1343 echo ">>> Unpacking ${shrtsrc} to ${PWD}"
1284 if [[ -z ${skip} ]] ; then 1344 if [[ -z ${skip} ]] ; then
1285 local ver=$(grep -a '#.*Makeself' "${src}" | awk '{print $NF}') 1345 local ver=$(grep -m1 -a '#.*Makeself' "${src}" | awk '{print $NF}')
1286 local skip=0 1346 local skip=0
1287 exe=tail 1347 exe=tail
1288 case ${ver} in 1348 case ${ver} in
1289 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
1290 skip=$(grep -a ^skip= "${src}" | cut -d= -f2) 1350 skip=$(grep -a ^skip= "${src}" | cut -d= -f2)
1292 2.0|2.0.1) 1352 2.0|2.0.1)
1293 skip=$(grep -a ^$'\t'tail "${src}" | awk '{print $2}' | cut -b2-) 1353 skip=$(grep -a ^$'\t'tail "${src}" | awk '{print $2}' | cut -b2-)
1294 ;; 1354 ;;
1295 2.1.1) 1355 2.1.1)
1296 skip=$(grep -a ^offset= "${src}" | awk '{print $2}' | cut -b2-) 1356 skip=$(grep -a ^offset= "${src}" | awk '{print $2}' | cut -b2-)
1297 let skip="skip + 1" 1357 (( skip++ ))
1298 ;; 1358 ;;
1299 2.1.2) 1359 2.1.2)
1300 skip=$(grep -a ^offset= "${src}" | awk '{print $3}' | head -n 1) 1360 skip=$(grep -a ^offset= "${src}" | awk '{print $3}' | head -n 1)
1301 let skip="skip + 1" 1361 (( skip++ ))
1302 ;; 1362 ;;
1303 2.1.3) 1363 2.1.3)
1304 skip=`grep -a ^offset= "${src}" | awk '{print $3}'` 1364 skip=`grep -a ^offset= "${src}" | awk '{print $3}'`
1305 let skip="skip + 1" 1365 (( skip++ ))
1306 ;; 1366 ;;
1307 2.1.4|2.1.5) 1367 2.1.4|2.1.5)
1308 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)
1309 skip=$(head -n ${skip} "${src}" | wc -c) 1369 skip=$(head -n ${skip} "${src}" | wc -c)
1310 exe="dd" 1370 exe="dd"
1319 esac 1379 esac
1320 debug-print "Detected Makeself version ${ver} ... using ${skip} as offset" 1380 debug-print "Detected Makeself version ${ver} ... using ${skip} as offset"
1321 fi 1381 fi
1322 case ${exe} in 1382 case ${exe} in
1323 tail) exe="tail -n +${skip} '${src}'";; 1383 tail) exe="tail -n +${skip} '${src}'";;
1324 dd) exe="dd ibs=${skip} skip=1 obs=1024 conv=sync if='${src}'";; 1384 dd) exe="dd ibs=${skip} skip=1 if='${src}'";;
1325 *) die "makeself cant handle exe '${exe}'" 1385 *) die "makeself cant handle exe '${exe}'"
1326 esac 1386 esac
1327 1387
1328 # 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
1329 local tmpfile=$(emktemp) 1389 local tmpfile=$(emktemp)
1462 export CDROM_ROOT=${CD_ROOT_1:-${CD_ROOT}} 1522 export CDROM_ROOT=${CD_ROOT_1:-${CD_ROOT}}
1463 einfo "Found CD #${CDROM_CURRENT_CD} root at ${CDROM_ROOT}" 1523 einfo "Found CD #${CDROM_CURRENT_CD} root at ${CDROM_ROOT}"
1464 export CDROM_SET=-1 1524 export CDROM_SET=-1
1465 for f in ${CDROM_CHECK_1//:/ } ; do 1525 for f in ${CDROM_CHECK_1//:/ } ; do
1466 ((++CDROM_SET)) 1526 ((++CDROM_SET))
1467 [[ -e ${CD_ROOT}/${f} ]] && break 1527 [[ -e ${CDROM_ROOT}/${f} ]] && break
1468 done 1528 done
1469 export CDROM_MATCH=${f} 1529 export CDROM_MATCH=${f}
1470 return 1530 return
1471 fi 1531 fi
1472 1532
1740} 1800}
1741 1801
1742# @FUNCTION: built_with_use 1802# @FUNCTION: built_with_use
1743# @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>
1744# @DESCRIPTION: 1804# @DESCRIPTION:
1805#
1806# Deprecated: Use EAPI 2 use deps in DEPEND|RDEPEND and with has_version calls.
1807#
1745# A temporary hack until portage properly supports DEPENDing on USE 1808# A temporary hack until portage properly supports DEPENDing on USE
1746# 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
1747# 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
1748# --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
1749# 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.326  
changed lines
  Added in v.1.349

  ViewVC Help
Powered by ViewVC 1.1.20