summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2014-05-28 09:48:01 +0000
committerJustin Lecher <jlec@gentoo.org>2014-05-28 09:48:01 +0000
commit7711462b376c5ba3f71556b024d90feca88461d5 (patch)
treeb4b217873db361b51141cc832decf90328ea9675 /eclass
parentVersion bump, wrt bug #511400 (diff)
downloadgentoo-2-7711462b376c5ba3f71556b024d90feca88461d5.tar.gz
gentoo-2-7711462b376c5ba3f71556b024d90feca88461d5.tar.bz2
gentoo-2-7711462b376c5ba3f71556b024d90feca88461d5.zip
Add documentation for man page; add missing die
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog5
-rw-r--r--eclass/portability.eclass50
2 files changed, 38 insertions, 17 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index fde5dd168ca8..74e1cc485246 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for eclass directory
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1275 2014/05/26 17:20:14 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1276 2014/05/28 09:48:01 jlec Exp $
+
+ 28 May 2014; Justin Lecher <jlec@gentoo.org> portability.eclass:
+ Add documentation for man page; add missing die
26 May 2014; Michał Górny <mgorny@gentoo.org>
+gnome-python-common-r1.eclass:
diff --git a/eclass/portability.eclass b/eclass/portability.eclass
index 800a11404631..889de540fcf6 100644
--- a/eclass/portability.eclass
+++ b/eclass/portability.eclass
@@ -1,18 +1,21 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/portability.eclass,v 1.24 2012/01/04 05:57:19 vapier Exp $
-#
-# Author: Diego Pettenò <flameeyes@gentoo.org>
-#
-# This eclass is created to avoid using non-portable GNUisms inside ebuilds
-#
-# NB: If you add anything, please comment it!
+# $Header: /var/cvsroot/gentoo-x86/eclass/portability.eclass,v 1.25 2014/05/28 09:48:01 jlec Exp $
+
+# @ECLASS: portability.eclass
+# @MAINTAINER:
+# base-system@gentoo.org
+# @AUTHOR:
+# Diego Pettenò <flameeyes@gentoo.org>
+# @BLURB: This eclass is created to avoid using non-portable GNUisms inside ebuilds
if [[ ${___ECLASS_ONCE_PORTABILITY} != "recur -_+^+_- spank" ]] ; then
___ECLASS_ONCE_PORTABILITY="recur -_+^+_- spank"
-# treecopy orig1 orig2 orig3 .... dest
-#
+# @FUNCTION: treecopy
+# @USAGE: <orig1> [orig2 orig3 ....] <dest>
+# @RETURN:
+# @DESCRIPTION:
# mimic cp --parents copy, but working on BSD userland as well
treecopy() {
local dest=${!#}
@@ -20,21 +23,23 @@ treecopy() {
while (( $# > 1 )); do
local dirstruct=$(dirname "$1")
- mkdir -p "${dest}/${dirstruct}"
- cp -pPR "$1" "${dest}/${dirstruct}"
+ mkdir -p "${dest}/${dirstruct}" || die
+ cp -pPR "$1" "${dest}/${dirstruct}" || die
shift
done
}
-# seq min max
-#
+# @FUNCTION: seq
+# @USAGE: [min] <max> [step]
+# @RETURN: sequence from min to max regardless of seq command being present on system
+# @DESCRIPTION:
# compatibility function that mimes seq command if not available
seq() {
# First try `seq`
local p=$(type -P seq)
if [[ -n ${p} ]] ; then
- "${p}" "$@"
+ "${p}" "$@" || die
return $?
fi
@@ -57,7 +62,7 @@ seq() {
reps=0
fi
- jot $reps $min $max $step
+ jot $reps $min $max $step || die
return $?
fi
@@ -71,6 +76,10 @@ seq() {
return 0
}
+# @FUNCTION: dlopen_lib
+# @USAGE:
+# @RETURN: linker flag if needed
+# @DESCRIPTION:
# Gets the linker flag to link to dlopen() function
dlopen_lib() {
# - Solaris needs nothing
@@ -85,6 +94,10 @@ dlopen_lib() {
esac
}
+# @FUNCTION: get_bmake
+# @USAGE:
+# @RETURN: system version of make
+# @DESCRIPTION:
# Gets the name of the BSD-ish make command (pmake from NetBSD)
#
# This will return make (provided by system packages) for BSD userlands,
@@ -103,6 +116,11 @@ get_bmake() {
fi
}
+# @FUNCTION: get_mounts
+# @USAGE:
+# @RETURN: table of mounts in form "point node fs opts"
+# @MAINTAINER:
+# @DESCRIPTION:
# Portable method of getting mount names and points.
# Returns as "point node fs options"
# Remember to convert 040 back to a space.