Gentoo Archives: gentoo-commits

From: "Justin Lecher (jlec)" <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog portability.eclass
Date: Wed, 28 May 2014 09:48:07
Message-Id: 20140528094802.096772004E@flycatcher.gentoo.org
1 jlec 14/05/28 09:48:01
2
3 Modified: ChangeLog portability.eclass
4 Log:
5 Add documentation for man page; add missing die
6
7 Revision Changes Path
8 1.1276 eclass/ChangeLog
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1276&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1276&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1275&r2=1.1276
13
14 Index: ChangeLog
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
17 retrieving revision 1.1275
18 retrieving revision 1.1276
19 diff -u -r1.1275 -r1.1276
20 --- ChangeLog 26 May 2014 17:20:14 -0000 1.1275
21 +++ ChangeLog 28 May 2014 09:48:01 -0000 1.1276
22 @@ -1,6 +1,9 @@
23 # ChangeLog for eclass directory
24 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1275 2014/05/26 17:20:14 mgorny Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1276 2014/05/28 09:48:01 jlec Exp $
27 +
28 + 28 May 2014; Justin Lecher <jlec@g.o> portability.eclass:
29 + Add documentation for man page; add missing die
30
31 26 May 2014; Michał Górny <mgorny@g.o>
32 +gnome-python-common-r1.eclass:
33
34
35
36 1.25 eclass/portability.eclass
37
38 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/portability.eclass?rev=1.25&view=markup
39 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/portability.eclass?rev=1.25&content-type=text/plain
40 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/portability.eclass?r1=1.24&r2=1.25
41
42 Index: portability.eclass
43 ===================================================================
44 RCS file: /var/cvsroot/gentoo-x86/eclass/portability.eclass,v
45 retrieving revision 1.24
46 retrieving revision 1.25
47 diff -u -r1.24 -r1.25
48 --- portability.eclass 4 Jan 2012 05:57:19 -0000 1.24
49 +++ portability.eclass 28 May 2014 09:48:01 -0000 1.25
50 @@ -1,18 +1,21 @@
51 -# Copyright 1999-2011 Gentoo Foundation
52 +# Copyright 1999-2014 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 -# $Header: /var/cvsroot/gentoo-x86/eclass/portability.eclass,v 1.24 2012/01/04 05:57:19 vapier Exp $
55 -#
56 -# Author: Diego Pettenò <flameeyes@g.o>
57 -#
58 -# This eclass is created to avoid using non-portable GNUisms inside ebuilds
59 -#
60 -# NB: If you add anything, please comment it!
61 +# $Header: /var/cvsroot/gentoo-x86/eclass/portability.eclass,v 1.25 2014/05/28 09:48:01 jlec Exp $
62 +
63 +# @ECLASS: portability.eclass
64 +# @MAINTAINER:
65 +# base-system@g.o
66 +# @AUTHOR:
67 +# Diego Pettenò <flameeyes@g.o>
68 +# @BLURB: This eclass is created to avoid using non-portable GNUisms inside ebuilds
69
70 if [[ ${___ECLASS_ONCE_PORTABILITY} != "recur -_+^+_- spank" ]] ; then
71 ___ECLASS_ONCE_PORTABILITY="recur -_+^+_- spank"
72
73 -# treecopy orig1 orig2 orig3 .... dest
74 -#
75 +# @FUNCTION: treecopy
76 +# @USAGE: <orig1> [orig2 orig3 ....] <dest>
77 +# @RETURN:
78 +# @DESCRIPTION:
79 # mimic cp --parents copy, but working on BSD userland as well
80 treecopy() {
81 local dest=${!#}
82 @@ -20,21 +23,23 @@
83
84 while (( $# > 1 )); do
85 local dirstruct=$(dirname "$1")
86 - mkdir -p "${dest}/${dirstruct}"
87 - cp -pPR "$1" "${dest}/${dirstruct}"
88 + mkdir -p "${dest}/${dirstruct}" || die
89 + cp -pPR "$1" "${dest}/${dirstruct}" || die
90
91 shift
92 done
93 }
94
95 -# seq min max
96 -#
97 +# @FUNCTION: seq
98 +# @USAGE: [min] <max> [step]
99 +# @RETURN: sequence from min to max regardless of seq command being present on system
100 +# @DESCRIPTION:
101 # compatibility function that mimes seq command if not available
102 seq() {
103 # First try `seq`
104 local p=$(type -P seq)
105 if [[ -n ${p} ]] ; then
106 - "${p}" "$@"
107 + "${p}" "$@" || die
108 return $?
109 fi
110
111 @@ -57,7 +62,7 @@
112 reps=0
113 fi
114
115 - jot $reps $min $max $step
116 + jot $reps $min $max $step || die
117 return $?
118 fi
119
120 @@ -71,6 +76,10 @@
121 return 0
122 }
123
124 +# @FUNCTION: dlopen_lib
125 +# @USAGE:
126 +# @RETURN: linker flag if needed
127 +# @DESCRIPTION:
128 # Gets the linker flag to link to dlopen() function
129 dlopen_lib() {
130 # - Solaris needs nothing
131 @@ -85,6 +94,10 @@
132 esac
133 }
134
135 +# @FUNCTION: get_bmake
136 +# @USAGE:
137 +# @RETURN: system version of make
138 +# @DESCRIPTION:
139 # Gets the name of the BSD-ish make command (pmake from NetBSD)
140 #
141 # This will return make (provided by system packages) for BSD userlands,
142 @@ -103,6 +116,11 @@
143 fi
144 }
145
146 +# @FUNCTION: get_mounts
147 +# @USAGE:
148 +# @RETURN: table of mounts in form "point node fs opts"
149 +# @MAINTAINER:
150 +# @DESCRIPTION:
151 # Portable method of getting mount names and points.
152 # Returns as "point node fs options"
153 # Remember to convert 040 back to a space.