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

Diff of /eclass/eutils.eclass

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

Revision 1.282 Revision 1.296
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 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.282 2007/06/16 07:11:43 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.296 2008/02/13 20:50:06 wolf31o2 Exp $
4
5# @ECLASS: eutils.eclass
6# @MAINTAINER:
7# base-system@gentoo.org
8# @BLURB: many extra (but common) functions that are used in ebuilds
9# @DESCRIPTION:
10# The eutils eclass contains a suite of functions that complement
11# the ones that ebuild.sh already contain. The idea is that the functions
12# are not required in all ebuilds but enough utilize them to have a common
13# home rather than having multiple ebuilds implementing the same thing.
4# 14#
5# This eclass is for general purpose functions that most ebuilds 15# Due to the nature of this eclass, some functions may have maintainers
6# have to implement themselves. 16# different from the overall eclass!
7#
8# NB: If you add anything, please comment it!
9#
10# Maintainer: see each individual function, base-system@gentoo.org as default
11 17
12inherit multilib portability 18inherit multilib portability
13 19
14DESCRIPTION="Based on the ${ECLASS} eclass" 20DESCRIPTION="Based on the ${ECLASS} eclass"
15 21
16# Wait for the supplied number of seconds. If no argument is supplied, defaults 22# @FUNCTION: epause
17# to five seconds. If the EPAUSE_IGNORE env var is set, don't wait. If we're not 23# @USAGE: [seconds]
18# outputting to a terminal, don't wait. For compatability purposes, the argument 24# @DESCRIPTION:
19# must be an integer greater than zero. 25# Sleep for the specified number of seconds (default of 5 seconds). Useful when
20# Bug 62950, Ciaran McCreesh <ciaranm@gentoo.org> (05 Sep 2004) 26# 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,
28# don't wait at all.
21epause() { 29epause() {
22 [[ -z ${EPAUSE_IGNORE} ]] && sleep ${1:-5} 30 [[ -z ${EPAUSE_IGNORE} ]] && sleep ${1:-5}
23} 31}
24 32
25# Beep the specified number of times (defaults to five). If our output 33# @FUNCTION: ebeep
26# is not a terminal, don't beep. If the EBEEP_IGNORE env var is set, 34# @USAGE: [number of beeps]
35# @DESCRIPTION:
36# 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
38# conjunction with the epause function. If the EBEEP_IGNORE env var is set,
27# don't beep. 39# don't beep at all.
28# Bug 62950, Ciaran McCreesh <ciaranm@gentoo.org> (05 Sep 2004)
29ebeep() { 40ebeep() {
30 local n 41 local n
31 if [[ -z ${EBEEP_IGNORE} ]] ; then 42 if [[ -z ${EBEEP_IGNORE} ]] ; then
32 for ((n=1 ; n <= ${1:-5} ; n++)) ; do 43 for ((n=1 ; n <= ${1:-5} ; n++)) ; do
33 echo -ne "\a" 44 echo -ne "\a"
132 local EPATCH_SOURCE="$1/*" 143 local EPATCH_SOURCE="$1/*"
133 else 144 else
134 local EPATCH_SOURCE="$1/*.${EPATCH_SUFFIX}" 145 local EPATCH_SOURCE="$1/*.${EPATCH_SUFFIX}"
135 fi 146 fi
136 else 147 else
137 if [ ! -d ${EPATCH_SOURCE} ] || [ -n "$1" ] 148 if [[ ! -d ${EPATCH_SOURCE} ]] || [[ -n $1 ]] ; then
138 then
139 if [ -n "$1" -a "${EPATCH_SOURCE}" = "${WORKDIR}/patch" ] 149 if [ -n "$1" -a "${EPATCH_SOURCE}" = "${WORKDIR}/patch" ]
140 then 150 then
141 EPATCH_SOURCE="$1" 151 EPATCH_SOURCE="$1"
142 fi 152 fi
143 153
302 then 312 then
303 einfo "Done with patching" 313 einfo "Done with patching"
304 fi 314 fi
305} 315}
306 316
317# @FUNCTION: emktemp
318# @USAGE: [temp dir]
319# @DESCRIPTION:
307# Cheap replacement for when debianutils (and thus mktemp) 320# Cheap replacement for when debianutils (and thus mktemp)
308# does not exist on the users system 321# does not exist on the users system.
309# vapier@gentoo.org
310#
311# Takes just 1 optional parameter (the directory to create tmpfile in)
312emktemp() { 322emktemp() {
313 local exe="touch" 323 local exe="touch"
314 [[ $1 == -d ]] && exe="mkdir" && shift 324 [[ $1 == -d ]] && exe="mkdir" && shift
315 local topdir=$1 325 local topdir=$1
316 326
337 TMPDIR="${topdir}" mktemp -dt tmp.XXXXXXXXXX 347 TMPDIR="${topdir}" mktemp -dt tmp.XXXXXXXXXX
338 fi 348 fi
339 fi 349 fi
340} 350}
341 351
352# @FUNCTION: egetent
353# @USAGE: <database> <key>
354# @MAINTAINER:
355# base-system@gentoo.org (Linux)
356# Joe Jezak <josejx@gmail.com> (OS X)
357# usata@gentoo.org (OS X)
358# Aaron Walker <ka0ttic@gentoo.org> (FreeBSD)
359# @DESCRIPTION:
342# Small wrapper for getent (Linux), nidump (Mac OS X), 360# Small wrapper for getent (Linux), nidump (Mac OS X),
343# and pw (FreeBSD) used in enewuser()/enewgroup() 361# and pw (FreeBSD) used in enewuser()/enewgroup()
344# Joe Jezak <josejx@gmail.com> and usata@gentoo.org
345# FBSD stuff: Aaron Walker <ka0ttic@gentoo.org>
346#
347# egetent(database, key)
348egetent() { 362egetent() {
349 case ${CHOST} in 363 case ${CHOST} in
350 *-darwin*) 364 *-darwin*)
351 case "$2" in 365 case "$2" in
352 *[!0-9]*) # Non numeric 366 *[!0-9]*) # Non numeric
376 getent "$1" "$2" 390 getent "$1" "$2"
377 ;; 391 ;;
378 esac 392 esac
379} 393}
380 394
381# Simplify/standardize adding users to the system 395# @FUNCTION: enewuser
382# vapier@gentoo.org 396# @USAGE: <user> [uid] [shell] [homedir] [groups] [params]
383# 397# @DESCRIPTION:
384# enewuser(username, uid, shell, homedir, groups, extra options) 398# Same as enewgroup, you are not required to understand how to properly add
385# 399# a user to the system. The only required parameter is the username.
386# Default values if you do not specify any: 400# Default uid is (pass -1 for this) next available, default shell is
387# username: REQUIRED ! 401# /bin/false, default homedir is /dev/null, there are no default groups,
388# uid: next available (see useradd(8)) 402# and default params sets the comment as 'added by portage for ${PN}'.
389# note: pass -1 to get default behavior
390# shell: /bin/false
391# homedir: /dev/null
392# groups: none
393# extra: comment of 'added by portage for ${PN}'
394enewuser() { 403enewuser() {
395 case ${EBUILD_PHASE} in 404 case ${EBUILD_PHASE} in
396 unpack|compile|test|install) 405 unpack|compile|test|install)
397 eerror "'enewuser()' called from '${EBUILD_PHASE}()' which is not a pkg_* function." 406 eerror "'enewuser()' called from '${EBUILD_PHASE}()' which is not a pkg_* function."
398 eerror "Package fails at QA and at life. Please file a bug." 407 eerror "Package fails at QA and at life. Please file a bug."
587 fi 596 fi
588 597
589 export SANDBOX_ON=${oldsandbox} 598 export SANDBOX_ON=${oldsandbox}
590} 599}
591 600
592# Simplify/standardize adding groups to the system 601# @FUNCTION: enewgroup
593# vapier@gentoo.org 602# @USAGE: <group> [gid]
594# 603# @DESCRIPTION:
595# enewgroup(group, gid) 604# This function does not require you to understand how to properly add a
596# 605# group to the system. Just give it a group name to add and enewgroup will
597# Default values if you do not specify any: 606# do the rest. You may specify the gid for the group or allow the group to
598# groupname: REQUIRED ! 607# allocate the next available one.
599# gid: next available (see groupadd(8))
600# extra: none
601enewgroup() { 608enewgroup() {
602 case ${EBUILD_PHASE} in 609 case ${EBUILD_PHASE} in
603 unpack|compile|test|install) 610 unpack|compile|test|install)
604 eerror "'enewgroup()' called from '${EBUILD_PHASE}()' which is not a pkg_* function." 611 eerror "'enewgroup()' called from '${EBUILD_PHASE}()' which is not a pkg_* function."
605 eerror "Package fails at QA and at life. Please file a bug." 612 eerror "Package fails at QA and at life. Please file a bug."
701 ;; 708 ;;
702 esac 709 esac
703 export SANDBOX_ON="${oldsandbox}" 710 export SANDBOX_ON="${oldsandbox}"
704} 711}
705 712
706# Simple script to replace 'dos2unix' binaries 713# @FUNCTION: edos2unix
707# vapier@gentoo.org 714# @USAGE: <file> [more files ...]
708# 715# @DESCRIPTION:
709# edos2unix(file, <more files> ...) 716# A handy replacement for dos2unix, recode, fixdos, etc... This allows you
717# to remove all of these text utilities from DEPEND variables because this
718# is a script based solution. Just give it a list of files to convert and
719# they will all be changed from the DOS CRLF format to the UNIX LF format.
710edos2unix() { 720edos2unix() {
711 echo "$@" | xargs sed -i 's/\r$//' 721 echo "$@" | xargs sed -i 's/\r$//'
712} 722}
713
714
715##############################################################
716# START: Handle .desktop files and menu entries #
717# maybe this should be separated into a new eclass some time #
718# lanius@gentoo.org #
719##############################################################
720 723
721# Make a desktop file ! 724# Make a desktop file !
722# Great for making those icons in kde/gnome startmenu ! 725# Great for making those icons in kde/gnome startmenu !
723# Amaze your friends ! Get the women ! Join today ! 726# Amaze your friends ! Get the women ! Join today !
724# 727#
728# name: the name that will show up in the menu 731# name: the name that will show up in the menu
729# icon: give your little like a pretty little icon ... 732# icon: give your little like a pretty little icon ...
730# this can be relative (to /usr/share/pixmaps) or 733# this can be relative (to /usr/share/pixmaps) or
731# a full path to an icon 734# a full path to an icon
732# type: what kind of application is this ? for categories: 735# type: what kind of application is this ? for categories:
733# http://www.freedesktop.org/Standards/desktop-entry-spec 736# http://standards.freedesktop.org/menu-spec/latest/apa.html
734# path: if your app needs to startup in a specific dir 737# path: if your app needs to startup in a specific dir
735make_desktop_entry() { 738make_desktop_entry() {
736 [[ -z $1 ]] && eerror "make_desktop_entry: You must specify the executable" && return 1 739 [[ -z $1 ]] && eerror "make_desktop_entry: You must specify the executable" && return 1
737 740
738 local exec=${1} 741 local exec=${1}
739 local name=${2:-${PN}} 742 local name=${2:-${PN}}
740 local icon=${3:-${PN}.png} 743 local icon=${3:-${PN}}
741 local type=${4} 744 local type=${4}
742 local path=${5} 745 local path=${5}
743 746
744 if [[ -z ${type} ]] ; then 747 if [[ -z ${type} ]] ; then
745 local catmaj=${CATEGORY%%-*} 748 local catmaj=${CATEGORY%%-*}
746 local catmin=${CATEGORY##*-} 749 local catmin=${CATEGORY##*-}
747 case ${catmaj} in 750 case ${catmaj} in
748 app) 751 app)
749 case ${catmin} in 752 case ${catmin} in
753 accessibility) type=Accessibility;;
750 admin) type=System;; 754 admin) type=System;;
755 antivirus) type=System;;
756 arch) type=Archiving;;
757 backup) type=Archiving;;
751 cdr) type=DiscBurning;; 758 cdr) type=DiscBurning;;
752 dicts) type=Dictionary;; 759 dicts) type=Dictionary;;
760 doc) type=Documentation;;
753 editors) type=TextEditor;; 761 editors) type=TextEditor;;
754 emacs) type=TextEditor;; 762 emacs) type=TextEditor;;
755 emulation) type=Emulator;; 763 emulation) type=Emulator;;
756 laptop) type=HardwareSettings;; 764 laptop) type=HardwareSettings;;
757 office) type=Office;; 765 office) type=Office;;
766 pda) type=PDA;;
758 vim) type=TextEditor;; 767 vim) type=TextEditor;;
759 xemacs) type=TextEditor;; 768 xemacs) type=TextEditor;;
760 *) type=;; 769 *) type=;;
761 esac 770 esac
762 ;; 771 ;;
768 games) 777 games)
769 case ${catmin} in 778 case ${catmin} in
770 action|fps) type=ActionGame;; 779 action|fps) type=ActionGame;;
771 arcade) type=ArcadeGame;; 780 arcade) type=ArcadeGame;;
772 board) type=BoardGame;; 781 board) type=BoardGame;;
782 emulation) type=Emulator;;
773 kids) type=KidsGame;; 783 kids) type=KidsGame;;
774 emulation) type=Emulator;;
775 puzzle) type=LogicGame;; 784 puzzle) type=LogicGame;;
785 roguelike) type=RolePlaying;;
776 rpg) type=RolePlaying;; 786 rpg) type=RolePlaying;;
777 roguelike) type=RolePlaying;;
778 simulation) type=Simulation;; 787 simulation) type=Simulation;;
779 sports) type=SportsGame;; 788 sports) type=SportsGame;;
780 strategy) type=StrategyGame;; 789 strategy) type=StrategyGame;;
781 *) type=;; 790 *) type=;;
782 esac 791 esac
783 type="Game;${type}" 792 type="Game;${type}"
793 ;;
794
795 gnome)
796 type="Gnome;GTK"
797 ;;
798
799 kde)
800 type="KDE;Qt"
784 ;; 801 ;;
785 802
786 mail) 803 mail)
787 type="Network;Email" 804 type="Network;Email"
788 ;; 805 ;;
814 type="Network;${type}" 831 type="Network;${type}"
815 ;; 832 ;;
816 833
817 sci) 834 sci)
818 case ${catmin} in 835 case ${catmin} in
819 astro*) type=Astronomy;; 836 astro*) type=Astronomy;;
820 bio*) type=Biology;; 837 bio*) type=Biology;;
821 calc*) type=Calculator;; 838 calc*) type=Calculator;;
822 chem*) type=Chemistry;; 839 chem*) type=Chemistry;;
840 elec*) type=Electronics;;
823 geo*) type=Geology;; 841 geo*) type=Geology;;
824 math*) type=Math;; 842 math*) type=Math;;
843 physics) type=Physics;;
844 visual*) type=DataVisualization;;
825 *) type=;; 845 *) type=;;
826 esac 846 esac
827 type="Science;${type}" 847 type="Science;${type}"
848 ;;
849
850 sys)
851 type="System"
828 ;; 852 ;;
829 853
830 www) 854 www)
831 case ${catmin} in 855 case ${catmin} in
832 client) type=WebBrowser;; 856 client) type=WebBrowser;;
848 local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop" 872 local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop"
849 #local desktop=${T}/${exec%% *:-${desktop_name}}.desktop 873 #local desktop=${T}/${exec%% *:-${desktop_name}}.desktop
850 874
851 cat <<-EOF > "${desktop}" 875 cat <<-EOF > "${desktop}"
852 [Desktop Entry] 876 [Desktop Entry]
853 Encoding=UTF-8
854 Version=0.9.2 877 Version=1.0
855 Name=${name} 878 Name=${name}
856 Type=Application 879 Type=Application
857 Comment=${DESCRIPTION} 880 Comment=${DESCRIPTION}
858 Exec=${exec} 881 Exec=${exec}
859 TryExec=${exec%% *} 882 TryExec=${exec%% *}
860 Path=${path}
861 Icon=${icon} 883 Icon=${icon}
862 Categories=Application;${type}; 884 Categories=${type};
863 EOF 885 EOF
886
887 [[ ${path} ]] && echo "Path=${path}" >> "${desktop}"
864 888
865 ( 889 (
866 # wrap the env here so that the 'insinto' call 890 # wrap the env here so that the 'insinto' call
867 # doesn't corrupt the env of the caller 891 # doesn't corrupt the env of the caller
868 insinto /usr/share/applications 892 insinto /usr/share/applications
869 doins "${desktop}" 893 doins "${desktop}"
870 ) 894 )
871} 895}
872 896
873 897# @FUNCTION: validate_desktop_entries
898# @USAGE: [directories]
899# @MAINTAINER:
900# Carsten Lohrke <carlo@gentoo.org>
901# @DESCRIPTION:
874# Validate desktop entries using desktop-file-utils 902# Validate desktop entries using desktop-file-utils
875# Carsten Lohrke <carlo@gentoo.org>
876#
877# Usage: validate_desktop_entries [directory ...]
878
879validate_desktop_entries() { 903validate_desktop_entries() {
880 if [[ -x /usr/bin/desktop-file-validate ]] ; then 904 if [[ -x /usr/bin/desktop-file-validate ]] ; then
881 einfo "Checking desktop entry validity" 905 einfo "Checking desktop entry validity"
882 local directories="" 906 local directories=""
883 for d in /usr/share/applications $@ ; do 907 for d in /usr/share/applications $@ ; do
896 else 920 else
897 einfo "Passing desktop entry validity check. Install dev-util/desktop-file-utils, if you want to help to improve Gentoo." 921 einfo "Passing desktop entry validity check. Install dev-util/desktop-file-utils, if you want to help to improve Gentoo."
898 fi 922 fi
899} 923}
900 924
901 925# @FUNCTION: make_session_desktop
902# Make a GDM/KDM Session file 926# @USAGE: <title> <command>
903# 927# @DESCRIPTION:
904# make_session_desktop(<title>, <command>) 928# Make a GDM/KDM Session file. The title is the file to execute to start the
905# title: File to execute to start the Window Manager 929# Window Manager. The command is the name of the Window Manager.
906# command: Name of the Window Manager
907
908make_session_desktop() { 930make_session_desktop() {
909 [[ -z $1 ]] && eerror "make_session_desktop: You must specify the title" && return 1 931 [[ -z $1 ]] && eerror "make_session_desktop: You must specify the title" && return 1
910 [[ -z $2 ]] && eerror "make_session_desktop: You must specify the command" && return 1 932 [[ -z $2 ]] && eerror "make_session_desktop: You must specify the command" && return 1
911 933
912 local title=$1 934 local title=$1
913 local command=$2 935 local command=$2
914 local desktop=${T}/${wm}.desktop 936 local desktop=${T}/${wm}.desktop
915 937
916 cat <<-EOF > "${desktop}" 938 cat <<-EOF > "${desktop}"
917 [Desktop Entry] 939 [Desktop Entry]
918 Encoding=UTF-8
919 Name=${title} 940 Name=${title}
920 Comment=This session logs you into ${title} 941 Comment=This session logs you into ${title}
921 Exec=${command} 942 Exec=${command}
922 TryExec=${command} 943 TryExec=${command}
923 Type=Application 944 Type=Application
929 insinto /usr/share/xsessions 950 insinto /usr/share/xsessions
930 doins "${desktop}" 951 doins "${desktop}"
931 ) 952 )
932} 953}
933 954
955# @FUNCTION: domenu
956# @USAGE: <menus>
957# @DESCRIPTION:
958# Install the list of .desktop menu files into the appropriate directory
959# (/usr/share/applications).
934domenu() { 960domenu() {
935 ( 961 (
936 # wrap the env here so that the 'insinto' call 962 # wrap the env here so that the 'insinto' call
937 # doesn't corrupt the env of the caller 963 # doesn't corrupt the env of the caller
938 local i j ret=0 964 local i j ret=0
944 elif [[ -d ${i} ]] ; then 970 elif [[ -d ${i} ]] ; then
945 for j in "${i}"/*.desktop ; do 971 for j in "${i}"/*.desktop ; do
946 doins "${j}" 972 doins "${j}"
947 ((ret+=$?)) 973 ((ret+=$?))
948 done 974 done
975 else
976 ((++ret))
949 fi 977 fi
950 done 978 done
951 exit ${ret} 979 exit ${ret}
952 ) 980 )
953} 981}
982
983# @FUNCTION: newmenu
984# @USAGE: <menu> <newname>
985# @DESCRIPTION:
986# Like all other new* functions, install the specified menu as newname.
954newmenu() { 987newmenu() {
955 ( 988 (
956 # wrap the env here so that the 'insinto' call 989 # wrap the env here so that the 'insinto' call
957 # doesn't corrupt the env of the caller 990 # doesn't corrupt the env of the caller
958 insinto /usr/share/applications 991 insinto /usr/share/applications
959 newins "$@" 992 newins "$@"
960 ) 993 )
961} 994}
962 995
996# @FUNCTION: doicon
997# @USAGE: <list of icons>
998# @DESCRIPTION:
999# Install the list of icons into the icon directory (/usr/share/pixmaps).
1000# This is useful in conjunction with creating desktop/menu files.
963doicon() { 1001doicon() {
964 ( 1002 (
965 # wrap the env here so that the 'insinto' call 1003 # wrap the env here so that the 'insinto' call
966 # doesn't corrupt the env of the caller 1004 # doesn't corrupt the env of the caller
967 local i j ret 1005 local i j ret
973 elif [[ -d ${i} ]] ; then 1011 elif [[ -d ${i} ]] ; then
974 for j in "${i}"/*.png ; do 1012 for j in "${i}"/*.png ; do
975 doins "${j}" 1013 doins "${j}"
976 ((ret+=$?)) 1014 ((ret+=$?))
977 done 1015 done
1016 else
1017 ((++ret))
978 fi 1018 fi
979 done 1019 done
980 exit ${ret} 1020 exit ${ret}
981 ) 1021 )
982} 1022}
1023
1024# @FUNCTION: newicon
1025# @USAGE: <icon> <newname>
1026# @DESCRIPTION:
1027# Like all other new* functions, install the specified icon as newname.
983newicon() { 1028newicon() {
984 ( 1029 (
985 # wrap the env here so that the 'insinto' call 1030 # wrap the env here so that the 'insinto' call
986 # doesn't corrupt the env of the caller 1031 # doesn't corrupt the env of the caller
987 insinto /usr/share/pixmaps 1032 insinto /usr/share/pixmaps
988 newins "$@" 1033 newins "$@"
989 ) 1034 )
990} 1035}
991
992##############################################################
993# END: Handle .desktop files and menu entries #
994##############################################################
995
996 1036
997# for internal use only (unpack_pdv and unpack_makeself) 1037# for internal use only (unpack_pdv and unpack_makeself)
998find_unpackable_file() { 1038find_unpackable_file() {
999 local src=$1 1039 local src=$1
1000 if [[ -z ${src} ]] ; then 1040 if [[ -z ${src} ]] ; then
1010 fi 1050 fi
1011 [[ ! -e ${src} ]] && return 1 1051 [[ ! -e ${src} ]] && return 1
1012 echo "${src}" 1052 echo "${src}"
1013} 1053}
1014 1054
1055# @FUNCTION: unpack_pdv
1056# @USAGE: <file to unpack> <size of off_t>
1057# @DESCRIPTION:
1015# Unpack those pesky pdv generated files ... 1058# Unpack those pesky pdv generated files ...
1016# They're self-unpacking programs with the binary package stuffed in 1059# They're self-unpacking programs with the binary package stuffed in
1017# the middle of the archive. Valve seems to use it a lot ... too bad 1060# the middle of the archive. Valve seems to use it a lot ... too bad
1018# it seems to like to segfault a lot :(. So lets take it apart ourselves. 1061# it seems to like to segfault a lot :(. So lets take it apart ourselves.
1019# 1062#
1020# Usage: unpack_pdv [file to unpack] [size of off_t]
1021# - you have to specify the off_t size ... i have no idea how to extract that 1063# You have to specify the off_t size ... I have no idea how to extract that
1022# information out of the binary executable myself. basically you pass in 1064# information out of the binary executable myself. Basically you pass in
1023# the size of the off_t type (in bytes) on the machine that built the pdv 1065# the size of the off_t type (in bytes) on the machine that built the pdv
1066# archive.
1067#
1024# archive. one way to determine this is by running the following commands: 1068# One way to determine this is by running the following commands:
1069#
1070# @CODE
1025# strings <pdv archive> | grep lseek 1071# strings <pdv archive> | grep lseek
1026# strace -elseek <pdv archive> 1072# strace -elseek <pdv archive>
1073# @CODE
1074#
1027# basically look for the first lseek command (we do the strings/grep because 1075# Basically look for the first lseek command (we do the strings/grep because
1028# sometimes the function call is _llseek or something) and steal the 2nd 1076# sometimes the function call is _llseek or something) and steal the 2nd
1029# parameter. here is an example: 1077# parameter. Here is an example:
1078#
1079# @CODE
1030# root@vapier 0 pdv_unpack # strings hldsupdatetool.bin | grep lseek 1080# vapier@vapier 0 pdv_unpack # strings hldsupdatetool.bin | grep lseek
1031# lseek 1081# lseek
1032# root@vapier 0 pdv_unpack # strace -elseek ./hldsupdatetool.bin 1082# vapier@vapier 0 pdv_unpack # strace -elseek ./hldsupdatetool.bin
1033# lseek(3, -4, SEEK_END) = 2981250 1083# lseek(3, -4, SEEK_END) = 2981250
1084# @CODE
1085#
1034# thus we would pass in the value of '4' as the second parameter. 1086# Thus we would pass in the value of '4' as the second parameter.
1035unpack_pdv() { 1087unpack_pdv() {
1036 local src=$(find_unpackable_file "$1") 1088 local src=$(find_unpackable_file "$1")
1037 local sizeoff_t=$2 1089 local sizeoff_t=$2
1038 1090
1039 [[ -z ${src} ]] && die "Could not locate source for '$1'" 1091 [[ -z ${src} ]] && die "Could not locate source for '$1'"
1101 true 1153 true
1102 #[ -s "${datafile}" ] || die "failure unpacking pdv ('${metaskip}' '${tailskip}' '${datafile}')" 1154 #[ -s "${datafile}" ] || die "failure unpacking pdv ('${metaskip}' '${tailskip}' '${datafile}')"
1103 #assert "failure unpacking pdv ('${metaskip}' '${tailskip}' '${datafile}')" 1155 #assert "failure unpacking pdv ('${metaskip}' '${tailskip}' '${datafile}')"
1104} 1156}
1105 1157
1158# @FUNCTION: unpack_makeself
1159# @USAGE: [file to unpack] [offset] [tail|dd]
1160# @DESCRIPTION:
1106# Unpack those pesky makeself generated files ... 1161# Unpack those pesky makeself generated files ...
1107# They're shell scripts with the binary package tagged onto 1162# They're shell scripts with the binary package tagged onto
1108# the end of the archive. Loki utilized the format as does 1163# the end of the archive. Loki utilized the format as does
1109# many other game companies. 1164# many other game companies.
1110# 1165#
1111# Usage: unpack_makeself [file to unpack] [offset] [tail|dd] 1166# If the file is not specified, then ${A} is used. If the
1112# - If the file is not specified then unpack will utilize ${A}.
1113# - If the offset is not specified then we will attempt to extract 1167# offset is not specified then we will attempt to extract
1114# the proper offset from the script itself. 1168# the proper offset from the script itself.
1115unpack_makeself() { 1169unpack_makeself() {
1116 local src_input=${1:-${A}} 1170 local src_input=${1:-${A}}
1117 local src=$(find_unpackable_file "${src_input}") 1171 local src=$(find_unpackable_file "${src_input}")
1118 local skip=$2 1172 local skip=$2
1119 local exe=$3 1173 local exe=$3
1189 ;; 1243 ;;
1190 esac 1244 esac
1191 assert "failure unpacking (${filetype}) makeself ${shrtsrc} ('${ver}' +${skip})" 1245 assert "failure unpacking (${filetype}) makeself ${shrtsrc} ('${ver}' +${skip})"
1192} 1246}
1193 1247
1248# @FUNCTION: check_license
1249# @USAGE: [license]
1250# @DESCRIPTION:
1194# Display a license for user to accept. 1251# Display a license for user to accept. If no license is
1195#
1196# Usage: check_license [license]
1197# - If the file is not specified then ${LICENSE} is used. 1252# specified, then ${LICENSE} is used.
1198check_license() { 1253check_license() {
1199 local lic=$1 1254 local lic=$1
1200 if [ -z "${lic}" ] ; then 1255 if [ -z "${lic}" ] ; then
1201 lic="${PORTDIR}/licenses/${LICENSE}" 1256 lic="${PORTDIR}/licenses/${LICENSE}"
1202 else 1257 else
1230 The following license outlines the terms of use of this 1285 The following license outlines the terms of use of this
1231 package. You MUST accept this license for installation to 1286 package. You MUST accept this license for installation to
1232 continue. When you are done viewing, hit 'q'. If you 1287 continue. When you are done viewing, hit 'q'. If you
1233 CTRL+C out of this, the install will not run! 1288 CTRL+C out of this, the install will not run!
1234 ********************************************************** 1289 **********************************************************
1235 1290
1236 EOF 1291 EOF
1237 cat ${lic} >> ${licmsg} 1292 cat ${lic} >> ${licmsg}
1238 ${PAGER:-less} ${licmsg} || die "Could not execute pager (${PAGER}) to accept ${lic}" 1293 ${PAGER:-less} ${licmsg} || die "Could not execute pager (${PAGER}) to accept ${lic}"
1239 einfon "Do you accept the terms of this license (${l})? [yes/no] " 1294 einfon "Do you accept the terms of this license (${l})? [yes/no] "
1240 read alic 1295 read alic
1248 die "Failed to accept license" 1303 die "Failed to accept license"
1249 ;; 1304 ;;
1250 esac 1305 esac
1251} 1306}
1252 1307
1308# @FUNCTION: cdrom_get_cds
1309# @USAGE: <file on cd1> [file on cd2] [file on cd3] [...]
1310# @DESCRIPTION:
1253# Aquire cd(s) for those lovely cd-based emerges. Yes, this violates 1311# Aquire cd(s) for those lovely cd-based emerges. Yes, this violates
1254# the whole 'non-interactive' policy, but damnit I want CD support ! 1312# the whole 'non-interactive' policy, but damnit I want CD support !
1255# 1313#
1256# with these cdrom functions we handle all the user interaction and 1314# With these cdrom functions we handle all the user interaction and
1257# standardize everything. all you have to do is call cdrom_get_cds() 1315# standardize everything. All you have to do is call cdrom_get_cds()
1258# and when the function returns, you can assume that the cd has been 1316# and when the function returns, you can assume that the cd has been
1259# found at CDROM_ROOT. 1317# found at CDROM_ROOT.
1260# 1318#
1319# The function will attempt to locate a cd based upon a file that is on
1320# the cd. The more files you give this function, the more cds
1321# the cdrom functions will handle.
1322#
1261# normally the cdrom functions will refer to the cds as 'cd #1', 'cd #2', 1323# Normally the cdrom functions will refer to the cds as 'cd #1', 'cd #2',
1262# etc... if you want to give the cds better names, then just export 1324# etc... If you want to give the cds better names, then just export
1263# the appropriate CDROM_NAME variable before calling cdrom_get_cds(). 1325# the appropriate CDROM_NAME variable before calling cdrom_get_cds().
1264# - CDROM_NAME="fooie cd" - for when you only want 1 cd 1326# Use CDROM_NAME for one cd, or CDROM_NAME_# for multiple cds. You can
1265# - CDROM_NAME_1="install cd" - for when you want more than 1 cd 1327# also use the CDROM_NAME_SET bash array.
1266# CDROM_NAME_2="data cd"
1267# - CDROM_NAME_SET=( "install cd" "data cd" ) - short hand for CDROM_NAME_#
1268# 1328#
1269# for those multi cd ebuilds, see the cdrom_load_next_cd() below. 1329# For those multi cd ebuilds, see the cdrom_load_next_cd() function.
1270#
1271# Usage: cdrom_get_cds <file on cd1> [file on cd2] [file on cd3] [...]
1272# - this will attempt to locate a cd based upon a file that is on
1273# the cd ... the more files you give this function, the more cds
1274# the cdrom functions will handle
1275cdrom_get_cds() { 1330cdrom_get_cds() {
1276 # first we figure out how many cds we're dealing with by 1331 # first we figure out how many cds we're dealing with by
1277 # the # of files they gave us 1332 # the # of files they gave us
1278 local cdcnt=0 1333 local cdcnt=0
1279 local f= 1334 local f=
1365 export CDROM_SET="" 1420 export CDROM_SET=""
1366 export CDROM_CURRENT_CD=0 1421 export CDROM_CURRENT_CD=0
1367 cdrom_load_next_cd 1422 cdrom_load_next_cd
1368} 1423}
1369 1424
1370# this is only used when you need access to more than one cd. 1425# @FUNCTION: cdrom_load_next_cd
1371# when you have finished using the first cd, just call this function. 1426# @DESCRIPTION:
1372# when it returns, CDROM_ROOT will be pointing to the second cd. 1427# Some packages are so big they come on multiple CDs. When you're done reading
1373# remember, you can only go forward in the cd chain, you can't go back. 1428# files off a CD and want access to the next one, just call this function.
1429# Again, all the messy details of user interaction are taken care of for you.
1430# Once this returns, just read the variable CDROM_ROOT for the location of the
1431# mounted CD. Note that you can only go forward in the CD list, so make sure
1432# you only call this function when you're done using the current CD.
1374cdrom_load_next_cd() { 1433cdrom_load_next_cd() {
1375 local var 1434 local var
1376 ((++CDROM_CURRENT_CD)) 1435 ((++CDROM_CURRENT_CD))
1377 1436
1378 unset CDROM_ROOT 1437 unset CDROM_ROOT
1395# displayed and we'll hang out here until: 1454# displayed and we'll hang out here until:
1396# (1) the file is found on a mounted cdrom 1455# (1) the file is found on a mounted cdrom
1397# (2) the user hits CTRL+C 1456# (2) the user hits CTRL+C
1398_cdrom_locate_file_on_cd() { 1457_cdrom_locate_file_on_cd() {
1399 local mline="" 1458 local mline=""
1400 local showedmsg=0 1459 local showedmsg=0 showjolietmsg=0
1401 1460
1402 while [[ -z ${CDROM_ROOT} ]] ; do 1461 while [[ -z ${CDROM_ROOT} ]] ; do
1403 local i=0 1462 local i=0
1404 local -a cdset=(${*//:/ }) 1463 local -a cdset=(${*//:/ })
1405 if [[ -n ${CDROM_SET} ]] ; then 1464 if [[ -n ${CDROM_SET} ]] ; then
1414 while read point node fs foo ; do 1473 while read point node fs foo ; do
1415 [[ " cd9660 iso9660 udf " != *" ${fs} "* ]] && \ 1474 [[ " cd9660 iso9660 udf " != *" ${fs} "* ]] && \
1416 ! [[ ${fs} == "subfs" && ",${opts}," == *",fs=cdfss,"* ]] \ 1475 ! [[ ${fs} == "subfs" && ",${opts}," == *",fs=cdfss,"* ]] \
1417 && continue 1476 && continue
1418 point=${point//\040/ } 1477 point=${point//\040/ }
1478 [[ ! -d ${point}/${dir} ]] && continue
1419 [[ -z $(find "${point}/${dir}" -maxdepth 1 -iname "${file}") ]] && continue 1479 [[ -z $(find "${point}/${dir}" -maxdepth 1 -iname "${file}") ]] && continue
1420 export CDROM_ROOT=${point} 1480 export CDROM_ROOT=${point}
1421 export CDROM_SET=${i} 1481 export CDROM_SET=${i}
1422 export CDROM_MATCH=${cdset[${i}]} 1482 export CDROM_MATCH=${cdset[${i}]}
1423 return 1483 return
1445 showedmsg=1 1505 showedmsg=1
1446 fi 1506 fi
1447 einfo "Press return to scan for the cd again" 1507 einfo "Press return to scan for the cd again"
1448 einfo "or hit CTRL+C to abort the emerge." 1508 einfo "or hit CTRL+C to abort the emerge."
1449 echo 1509 echo
1510 if [[ ${showjolietmsg} -eq 0 ]] ; then
1511 showjolietmsg=1
1512 else
1450 einfo "If you are having trouble with the detection" 1513 ewarn "If you are having trouble with the detection"
1451 einfo "of your CD, it is possible that you do not have" 1514 ewarn "of your CD, it is possible that you do not have"
1452 einfo "Joliet support enabled in your kernel. Please" 1515 ewarn "Joliet support enabled in your kernel. Please"
1453 einfo "check that CONFIG_JOLIET is enabled in your kernel." 1516 ewarn "check that CONFIG_JOLIET is enabled in your kernel."
1517 ebeep 5
1518 fi
1454 read || die "something is screwed with your system" 1519 read || die "something is screwed with your system"
1455 done 1520 done
1456} 1521}
1457 1522
1523# @FUNCTION: strip-linguas
1524# @USAGE: [<allow LINGUAS>|<-i|-u> <directories of .po files>]
1525# @DESCRIPTION:
1458# Make sure that LINGUAS only contains languages that 1526# Make sure that LINGUAS only contains languages that
1459# a package can support 1527# a package can support. The first form allows you to
1460# 1528# specify a list of LINGUAS. The -i builds a list of po
1461# usage: strip-linguas <allow LINGUAS> 1529# files found in all the directories and uses the
1462# strip-linguas -i <directories of .po files> 1530# intersection of the lists. The -u builds a list of po
1463# strip-linguas -u <directories of .po files> 1531# files found in all the directories and uses the union
1464# 1532# of the lists.
1465# The first form allows you to specify a list of LINGUAS.
1466# The -i builds a list of po files found in all the
1467# directories and uses the intersection of the lists.
1468# The -u builds a list of po files found in all the
1469# directories and uses the union of the lists.
1470strip-linguas() { 1533strip-linguas() {
1471 local ls newls nols 1534 local ls newls nols
1472 if [[ $1 == "-i" ]] || [[ $1 == "-u" ]] ; then 1535 if [[ $1 == "-i" ]] || [[ $1 == "-u" ]] ; then
1473 local op=$1; shift 1536 local op=$1; shift
1474 ls=$(find "$1" -name '*.po' -exec basename {} .po \;); shift 1537 ls=$(find "$1" -name '*.po' -exec basename {} .po \;); shift
1504 [[ -n ${nols} ]] \ 1567 [[ -n ${nols} ]] \
1505 && ewarn "Sorry, but ${PN} does not support the LINGUAs:" ${nols} 1568 && ewarn "Sorry, but ${PN} does not support the LINGUAs:" ${nols}
1506 export LINGUAS=${newls:1} 1569 export LINGUAS=${newls:1}
1507} 1570}
1508 1571
1509# moved from kernel.eclass since they are generally useful outside of 1572# @FUNCTION: preserve_old_lib
1510# kernel.eclass -iggy (20041002) 1573# @USAGE: <libs to preserve> [more libs]
1511 1574# @DESCRIPTION:
1512# the following functions are useful in kernel module ebuilds, etc.
1513# for an example see ivtv or drbd ebuilds
1514
1515# set's ARCH to match what the kernel expects
1516set_arch_to_kernel() {
1517 i=10
1518 while ((i--)) ; do
1519 ewarn "PLEASE UPDATE TO YOUR PACKAGE TO USE linux-info.eclass"
1520 done
1521 export EUTILS_ECLASS_PORTAGE_ARCH="${ARCH}"
1522 case ${ARCH} in
1523 x86) export ARCH="i386";;
1524 amd64) export ARCH="x86_64";;
1525 hppa) export ARCH="parisc";;
1526 mips) export ARCH="mips";;
1527 sparc) export ARCH="$(tc-arch-kernel)";; # Yeah this is ugly, but it's even WORSE if you don't do this. linux-info.eclass's set_arch_to_kernel is fixed, but won't get used over this one!
1528 *) export ARCH="${ARCH}";;
1529 esac
1530}
1531
1532# set's ARCH back to what portage expects
1533set_arch_to_portage() {
1534 i=10
1535 while ((i--)) ; do
1536 ewarn "PLEASE UPDATE TO YOUR PACKAGE TO USE linux-info.eclass"
1537 done
1538 export ARCH="${EUTILS_ECLASS_PORTAGE_ARCH}"
1539}
1540
1541# Jeremy Huddleston <eradicator@gentoo.org>:
1542# preserve_old_lib /path/to/libblah.so.0
1543# preserve_old_lib_notify /path/to/libblah.so.0
1544#
1545# These functions are useful when a lib in your package changes --library. Such 1575# These functions are useful when a lib in your package changes ABI SONAME.
1546# an example might be from libogg.so.0 to libogg.so.1. Removing libogg.so.0 1576# An example might be from libogg.so.0 to libogg.so.1. Removing libogg.so.0
1547# would break packages that link against it. Most people get around this 1577# would break packages that link against it. Most people get around this
1548# by using the portage SLOT mechanism, but that is not always a relevant 1578# by using the portage SLOT mechanism, but that is not always a relevant
1549# solution, so instead you can add the following to your ebuilds: 1579# solution, so instead you can call this from pkg_preinst. See also the
1550# 1580# preserve_old_lib_notify function.
1551# pkg_preinst() {
1552# ...
1553# preserve_old_lib /usr/$(get_libdir)/libogg.so.0
1554# ...
1555# }
1556#
1557# pkg_postinst() {
1558# ...
1559# preserve_old_lib_notify /usr/$(get_libdir)/libogg.so.0
1560# ...
1561# }
1562
1563preserve_old_lib() { 1581preserve_old_lib() {
1564 if [[ ${EBUILD_PHASE} != "preinst" ]] ; then 1582 if [[ ${EBUILD_PHASE} != "preinst" ]] ; then
1565 eerror "preserve_old_lib() must be called from pkg_preinst() only" 1583 eerror "preserve_old_lib() must be called from pkg_preinst() only"
1566 die "Invalid preserve_old_lib() usage" 1584 die "Invalid preserve_old_lib() usage"
1567 fi 1585 fi
1575 cp "${ROOT}"/${lib} "${D}"/${lib} || die "cp ${lib} failed" 1593 cp "${ROOT}"/${lib} "${D}"/${lib} || die "cp ${lib} failed"
1576 touch "${D}"/${lib} 1594 touch "${D}"/${lib}
1577 done 1595 done
1578} 1596}
1579 1597
1598# @FUNCTION: preserve_old_lib_notify
1599# @USAGE: <libs to notify> [more libs]
1600# @DESCRIPTION:
1601# Spit helpful messages about the libraries preserved by preserve_old_lib.
1580preserve_old_lib_notify() { 1602preserve_old_lib_notify() {
1581 if [[ ${EBUILD_PHASE} != "postinst" ]] ; then 1603 if [[ ${EBUILD_PHASE} != "postinst" ]] ; then
1582 eerror "preserve_old_lib_notify() must be called from pkg_postinst() only" 1604 eerror "preserve_old_lib_notify() must be called from pkg_postinst() only"
1583 die "Invalid preserve_old_lib_notify() usage" 1605 die "Invalid preserve_old_lib_notify() usage"
1584 fi 1606 fi
1595 ewarn "helper program, simply emerge the 'gentoolkit' package." 1617 ewarn "helper program, simply emerge the 'gentoolkit' package."
1596 ewarn 1618 ewarn
1597 fi 1619 fi
1598 ewarn " # revdep-rebuild --library ${lib##*/}" 1620 ewarn " # revdep-rebuild --library ${lib##*/}"
1599 done 1621 done
1622 if [[ ${notice} -eq 1 ]] ; then
1623 ewarn
1624 ewarn "Once you've finished running revdep-rebuild, it should be safe to"
1625 ewarn "delete the old libraries."
1626 fi
1600} 1627}
1601 1628
1602# Hack for people to figure out if a package was built with 1629# @FUNCTION: built_with_use
1603# certain USE flags
1604#
1605# Usage: built_with_use [--missing <action>] [-a|-o] <DEPEND ATOM> <List of USE flags> 1630# @USAGE: [--hidden] [--missing <action>] [-a|-o] <DEPEND ATOM> <List of USE flags>
1606# ex: built_with_use xchat gtk2 1631# @DESCRIPTION:
1632# A temporary hack until portage properly supports DEPENDing on USE
1633# flags being enabled in packages. This will check to see if the specified
1634# DEPEND atom was built with the specified list of USE flags. The
1635# --missing option controls the behavior if called on a package that does
1636# not actually support the defined USE flags (aka listed in IUSE).
1637# The default is to abort (call die). The -a and -o flags control
1638# the requirements of the USE flags. They correspond to "and" and "or"
1639# logic. So the -a flag means all listed USE flags must be enabled
1640# while the -o flag means at least one of the listed fIUSE flags must be
1641# enabled. The --hidden option is really for internal use only as it
1642# means the USE flag we're checking is hidden expanded, so it won't be found
1643# in IUSE like normal USE flags.
1607# 1644#
1608# Flags: -a all USE flags should be utilized 1645# Remember that this function isn't terribly intelligent so order of optional
1609# -o at least one USE flag should be utilized 1646# flags matter.
1610# --missing peform the specified action if the flag is not in IUSE (true/false/die)
1611# --hidden USE flag we're checking is hidden expanded so it isnt in IUSE
1612# Note: the default flag is '-a'
1613built_with_use() { 1647built_with_use() {
1614 local hidden="no" 1648 local hidden="no"
1615 if [[ $1 == "--hidden" ]] ; then 1649 if [[ $1 == "--hidden" ]] ; then
1616 hidden="yes" 1650 hidden="yes"
1617 shift 1651 shift
1678 shift 1712 shift
1679 done 1713 done
1680 [[ ${opt} = "-a" ]] 1714 [[ ${opt} = "-a" ]]
1681} 1715}
1682 1716
1717# @FUNCTION: epunt_cxx
1718# @USAGE: [dir to scan]
1719# @DESCRIPTION:
1683# Many configure scripts wrongly bail when a C++ compiler 1720# Many configure scripts wrongly bail when a C++ compiler could not be
1684# could not be detected. #73450 1721# detected. If dir is not specified, then it defaults to ${S}.
1722#
1723# http://bugs.gentoo.org/73450
1685epunt_cxx() { 1724epunt_cxx() {
1686 local dir=$1 1725 local dir=$1
1687 [[ -z ${dir} ]] && dir=${S} 1726 [[ -z ${dir} ]] && dir=${S}
1688 ebegin "Removing useless C++ checks" 1727 ebegin "Removing useless C++ checks"
1689 local f 1728 local f
1690 for f in $(find ${dir} -name configure) ; do 1729 find "${dir}" -name configure | while read f ; do
1691 patch -p0 "${f}" "${PORTDIR}/eclass/ELT-patches/nocxx/nocxx.patch" > /dev/null 1730 patch --no-backup-if-mismatch -p0 "${f}" "${PORTDIR}/eclass/ELT-patches/nocxx/nocxx.patch" > /dev/null
1692 done 1731 done
1693 eend 0 1732 eend 0
1694} 1733}
1695 1734
1696# make a wrapper script ... 1735# @FUNCTION: make_wrapper
1697# NOTE: this was originally games_make_wrapper, but I noticed other places where 1736# @USAGE: <wrapper> <target> [chdir] [libpaths] [installpath]
1698# this could be used, so I have moved it here and made it not games-specific 1737# @DESCRIPTION:
1699# -- wolf31o2 1738# Create a shell wrapper script named wrapper in installpath
1700# $1 == wrapper name 1739# (defaults to the bindir) to execute target (default of wrapper) by
1701# $2 == binary to run 1740# first optionally setting LD_LIBRARY_PATH to the colon-delimited
1702# $3 == directory to chdir before running binary 1741# libpaths followed by optionally changing directory to chdir.
1703# $4 == extra LD_LIBRARY_PATH's (make it : delimited)
1704# $5 == path for wrapper
1705make_wrapper() { 1742make_wrapper() {
1706 local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5 1743 local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5
1707 local tmpwrapper=$(emktemp) 1744 local tmpwrapper=$(emktemp)
1708 # We don't want to quote ${bin} so that people can pass complex 1745 # We don't want to quote ${bin} so that people can pass complex
1709 # things as $bin ... "./someprog --args" 1746 # things as $bin ... "./someprog --args"
1719fi 1756fi
1720exec ${bin} "\$@" 1757exec ${bin} "\$@"
1721EOF 1758EOF
1722 chmod go+rx "${tmpwrapper}" 1759 chmod go+rx "${tmpwrapper}"
1723 if [[ -n ${path} ]] ; then 1760 if [[ -n ${path} ]] ; then
1761 (
1724 exeinto "${path}" 1762 exeinto "${path}"
1725 newexe "${tmpwrapper}" "${wrapper}" 1763 newexe "${tmpwrapper}" "${wrapper}"
1764 ) || die
1726 else 1765 else
1727 newbin "${tmpwrapper}" "${wrapper}" 1766 newbin "${tmpwrapper}" "${wrapper}" || die
1728 fi 1767 fi
1729} 1768}

Legend:
Removed from v.1.282  
changed lines
  Added in v.1.296

  ViewVC Help
Powered by ViewVC 1.1.20