[gentoo-commits] dev/heroxbd:master commit in: eclass/

2016-07-20 Thread Benda XU
commit: 476e3eade829ef401bcc2eaf8ae7d0262f3d121f
Author: Benda Xu  gentoo  org>
AuthorDate: Tue Jun 14 01:59:53 2016 +
Commit: Benda XU  gentoo  org>
CommitDate: Tue Jun 14 01:59:53 2016 +
URL:https://gitweb.gentoo.org/dev/heroxbd.git/commit/?id=476e3ead

user.eclass: gracefully return early on for enewgroup and enewuser.

 eclass/user.eclass | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/eclass/user.eclass b/eclass/user.eclass
index 860aba0..9fddbbb 100644
--- a/eclass/user.eclass
+++ b/eclass/user.eclass
@@ -107,6 +107,10 @@ egetent() {
 # Default uid is (pass -1 for this) next available, default shell is
 # /bin/false, default homedir is /dev/null, and there are no default groups.
 enewuser() {
+   if [[ ${EUID} != 0 ]] ; then
+   einfo "Donot have enough privilege to execute ${FUNCNAME[0]}"
+   return 0
+   fi
_assert_pkg_ebuild_phase ${FUNCNAME}
 
# get the username
@@ -247,7 +251,7 @@ enewuser() {
;;
 
*)
-   useradd -r "${opts[@]}" "${euser}" || use prefix || die
+   useradd -r "${opts[@]}" "${euser}" || die
;;
esac
 
@@ -267,6 +271,10 @@ enewuser() {
 # do the rest.  You may specify the gid for the group or allow the group to
 # allocate the next available one.
 enewgroup() {
+   if [[ ${EUID} != 0 ]] ; then
+   einfo "Donot have enough privilege to execute ${FUNCNAME[0]}"
+   return 0
+   fi
_assert_pkg_ebuild_phase ${FUNCNAME}
 
# get the group
@@ -340,7 +348,7 @@ enewgroup() {
opts="-g ${egid}"
fi
# We specify -r so that we get a GID in the system range from 
login.defs
-   groupadd -r ${opts} "${egroup}" || use prefix || die
+   groupadd -r ${opts} "${egroup}" || die
;;
esac
 }



[gentoo-commits] dev/heroxbd:master commit in: eclass/, app-shells/bash/

2016-07-20 Thread Benda XU
commit: 6add7b7321aab0f6797dcf4b472fbedd0b12ab85
Author: Benda Xu  gentoo  org>
AuthorDate: Wed Jun 15 10:56:21 2016 +
Commit: Benda XU  gentoo  org>
CommitDate: Wed Jun 15 11:48:27 2016 +
URL:https://gitweb.gentoo.org/dev/heroxbd.git/commit/?id=6add7b73

app-shells/bash: introduce fprefixify.

 app-shells/bash/Manifest   |   2 +-
 app-shells/bash/bash-4.3_p42-r2.ebuild |   8 +-
 eclass/prefix.eclass   |  73 +--
 eclass/toolchain.eclass| 337 -
 4 files changed, 265 insertions(+), 155 deletions(-)

diff --git a/app-shells/bash/Manifest b/app-shells/bash/Manifest
index 95012e3..ce1bf27 100644
--- a/app-shells/bash/Manifest
+++ b/app-shells/bash/Manifest
@@ -55,6 +55,6 @@ DIST bash43-039 1531 SHA256 
ab94dced2215541097691f60c3eb323cc28ef2549463e6a5334b
 DIST bash43-040 1532 SHA256 
84bb396b9262992ca5424feab6ed3ec39f193ef5c76dfe4a62b551bd8dd9d76b SHA512 
25a0696f1f0e78cb971afa404e0b7fe634b70d49d6a5a9d6ff5506c42063968e8ede83ad80bd0b79601363676fe3abfedc3b76984f6f9ad2e7798790682e21d0
 WHIRLPOOL 
a435f25ae432161f676b4965cc20cc096fa18af8a191dca7cb311a41e3504e5d27c668fb3430fece1de45e0eed9cb34357dc887e83ace9819f24d585eddf6720
 DIST bash43-041 2362 SHA256 
4ec432966e4198524a7e0cd685fe222e96043769c9613e66742ac475db132c1a SHA512 
d75cdd6a1fb8aeb1a4e88f046cfea3ec493b994b96f60f27d5577b59408422bb7c51cc4525cadab821fd8c57f44fb07f811b087d077359242caff3b54cfc6819
 WHIRLPOOL 
c88e754d694b69bcb3ce390ab3e29932b30a74f8f15b75b570cc46699c072b0f872824766c45bc2a98627529896bdf5aaf6493a493ffd33932d9ed6a362defb3
 DIST bash43-042 1535 SHA256 
ac219322db2791da87a496ee6e8e5544846494bdaaea2626270c2f73c1044919 SHA512 
01a6601029c0a55c9bf1a4ace3f387f9d094a9b9ee3511e2113c000123d85b1d5813c369e62d5a6dd329f515ef0d67d11394a6c0e4516956387556c13d13009a
 WHIRLPOOL 
790b15282a81f5717fb675ea4ae752382ddb1b101766e32c68deb1ec1d64fcf8841b3da556b87ac685e18b528a1de31bc4b94900369f6386f8e3991ed76232c1
-EBUILD bash-4.3_p42-r2.ebuild 7456 SHA256 
2c3e289168f86fccadfc98a3d12ecc2e455c380fb0bf9bbaeda8e743a7b243f7 SHA512 
f1795707bc2889992b3ce2b3da9ac7c3c8128694dee7ee3a3119404ea714ee3359460bc26697d70eddb1b4af740530871959b833b518ce1d214e885f3f1271af
 WHIRLPOOL 
edc9669b7f0aa214a743cd9feb719255cd4e8e5de925df05227406790e8b7c1f6084655d2b8bb918cdede7e92e1b23e7a1d9a0c8da4a54bb9e55b2fcd2a76753
+EBUILD bash-4.3_p42-r2.ebuild 7355 SHA256 
9e3e57dd0af1f66e27493a1e2f31d404084846ddc82dbbef6c67e25d6b4e2280 SHA512 
58a5931cfcd89c2587ab336ad87b334127df65f5818cec1b6a3b7871e3b8173a7a46dd0c0956104b9d270351dd873e10c1e3666a37df168725f039edea1b32e0
 WHIRLPOOL 
72d9a680334722fd0a326c388495cbf77b9776d6ad3497117cffc075ad3acfca2d6677e1fe735ec70b96a6acf2318075be3a91f00ea9278db056cc5c215fd2e0
 EBUILD bash-4.4_rc1.ebuild 6959 SHA256 
d92507283358f9f797f7e125e7a58a650d8b53c24af2d99adcd61c73f359da9e SHA512 
c180b33b87da6ddedec29dd064c97524e02fd0d44b4e848a0a5cfb36cfbc5efdb68f1c256bee25bbbc4c8588fbbd284fc3cef8d314686a2dc27aa5375e8298cb
 WHIRLPOOL 
b9617eab24f0a7ecfeb532019c09579cd5517ed914a4aa751e8b67cf1248e3b7ee7dc326943d3ea6667a88d7d194ad529a23586096c6397081e31da7d2dc0c4a
 MISC metadata.xml 734 SHA256 
7850abd55e656b9360deafb278c98598922eb3b6f884d024d199110afdcf6ff0 SHA512 
a9301e8d2347e0cf90a97325d9a705076150c00609d28338e5d7d72c135468e4f0531b2a4077b69679ae6ccf89eee691e0e5f0748caab60689f5f017afb544f1
 WHIRLPOOL 
ce0e36bc0ae83b73aee7abee391d1b0a384f0277dfb7f7282043624a523699685d866ef3291a02e9ad1bde3abf196b47e1351f646e0149f942a40ed4dc940a37

diff --git a/app-shells/bash/bash-4.3_p42-r2.ebuild 
b/app-shells/bash/bash-4.3_p42-r2.ebuild
index 80d2094..5e590c6 100644
--- a/app-shells/bash/bash-4.3_p42-r2.ebuild
+++ b/app-shells/bash/bash-4.3_p42-r2.ebuild
@@ -88,11 +88,7 @@ src_prepare() {
epatch 
"${FILESDIR}"/${PN}-4.3-mapfile-improper-array-name-validation.patch
epatch "${FILESDIR}"/${PN}-4.3-arrayfunc.patch
 
-   epatch "${FILESDIR}"/${PN}-4.0-configs-prefix.patch
-   eprefixify pathnames.h.in
-   # modify the bashrc file for prefix
-   cp "${FILESDIR}"/bashrc "${T}"/ || die
-   eprefixify "${T}"/bashrc
+   fprefixify epatch "${FILESDIR}"/${PN}-4.0-configs-prefix.patch
 
epatch_user
 }
@@ -183,7 +179,7 @@ src_install() {
 
insinto /etc/bash
doins "${FILESDIR}"/bash_logout
-   doins "${T}"/bashrc
+   fprefixify doins "${FILESDIR}"/bashrc
keepdir /etc/bash/bashrc.d
insinto /etc/skel
for f in bash{_logout,_profile,rc} ; do

diff --git a/eclass/prefix.eclass b/eclass/prefix.eclass
index 101cce2..40e5097 100644
--- a/eclass/prefix.eclass
+++ b/eclass/prefix.eclass
@@ -12,8 +12,6 @@
 # located somewhere in the filesystem.  Prefix ebuilds require
 # additional functions and variables which are defined by this eclass.
 
-inherit eutils
-
 # @ECLASS-VARIABLE: EPREFIX
 # @DESCRIPTION:
 # The offset prefix of a Gentoo Prefix installation.  When Gentoo Prefix
@@ -30,6 +28,7 @@ fi
 # @USAGE: 
 # @DESCRIPTION:
 

[gentoo-commits] dev/heroxbd:master commit in: eclass/

2016-07-20 Thread Benda XU
commit: da9025cda8eacec9f8a6eb4cedb0567f7523bea7
Author: Benda Xu  gentoo  org>
AuthorDate: Wed Jun 15 10:55:39 2016 +
Commit: Benda XU  gentoo  org>
CommitDate: Wed Jun 15 11:40:04 2016 +
URL:https://gitweb.gentoo.org/dev/heroxbd.git/commit/?id=da9025cd

kernel-2.eclass, toolchain-funcs.eclass: merged.

 eclass/kernel-2.eclass| 1321 -
 eclass/toolchain-funcs.eclass |  840 --
 2 files changed, 2161 deletions(-)

diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
deleted file mode 100644
index e8cb8f2..000
--- a/eclass/kernel-2.eclass
+++ /dev/null
@@ -1,1321 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.297 2014/11/28 
17:40:20 mpagano Exp $
-
-# Description: kernel.eclass rewrite for a clean base regarding the 2.6
-#  series of kernel with back-compatibility for 2.4
-#
-# Original author: John Mylchreest 
-# Maintainer: kernel-m...@gentoo.org
-#
-# Please direct your bugs to the current eclass maintainer :)
-
-# added functionality:
-# unipatch - a flexible, singular method to extract, add and 
remove patches.
-
-# A Couple of env vars are available to effect usage of this eclass
-# These are as follows:
-#
-# K_USEPV  - When setting the EXTRAVERSION 
variable, it should
-#add PV to the end.
-#this is useful for thigns 
like wolk. IE:
-#EXTRAVERSION would be 
something like : -wolk-4.19-r1
-# K_NOSETEXTRAVERSION  - if this is set then EXTRAVERSION will not be
-#automatically set within the 
kernel Makefile
-# K_NOUSENAME  - if this is set then EXTRAVERSION will not 
include the
-#first part of ${PN} in 
EXTRAVERSION
-# K_NOUSEPR- if this is set then EXTRAVERSION will 
not include the
-#anything based on ${PR}.
-# K_PREPATCHED - if the patchset is prepatched (ie: mm-sources,
-#ck-sources, ac-sources) it 
will use PR (ie: -r5) as
-#the patchset version for
-#and not use it as a true 
package revision
-# K_EXTRAEINFO - this is a new-line seperated list of einfo 
displays in
-#postinst and can be used to 
carry additional postinst
-#messages
-# K_EXTRAELOG  - same as K_EXTRAEINFO except using elog 
instead of einfo
-# K_EXTRAEWARN - same as K_EXTRAEINFO except using ewarn 
instead of einfo
-# K_SYMLINK- if this is set, then forcably create 
symlink anyway
-#
-# K_DEFCONFIG  - Allow specifying a different defconfig target.
-#If length zero, defaults to 
"defconfig".
-# K_WANT_GENPATCHES- Apply genpatches to kernel source. Provide any
-#combination of "base", 
"extras" or "experimental".
-# K_EXP_GENPATCHES_PULL- If set, we pull "experimental" regardless of 
the USE FLAG
-#but expect the ebuild 
maintainer to use K_EXP_GENPATCHES_LIST.
-# K_EXP_GENPATCHES_NOUSE   - If set, no USE flag will be provided for 
"experimental";
-#as a result the user cannot 
choose to apply those patches.
-# K_EXP_GENPATCHES_LIST- A list of patches to pick from "experimental" 
to apply when
-#the USE flag is unset and 
K_EXP_GENPATCHES_PULL is set.
-# K_GENPATCHES_VER - The version of the genpatches tarball(s) to 
apply.
-#A value of "5" would apply 
genpatches-2.6.12-5 to
-#my-sources-2.6.12.ebuild
-# K_SECURITY_UNSUPPORTED- If set, this kernel is unsupported by Gentoo Security
-# K_DEBLOB_AVAILABLE   - A value of "0" will disable all of the optional deblob
-#code. If empty, will be set 
to "1" if deblobbing is
-#possible. Test ONLY for "1".
-# K_PREDEBLOBBED   - This kernel was already deblobbed elsewhere.
-#If false, either optional 
deblobbing will be available
-#or the license will note the 
inc

[gentoo-commits] dev/heroxbd:master commit in: eclass/

2016-07-20 Thread Benda XU
commit: c147c553072030cd06f55f6bde6360199bb1c9f9
Author: Benda Xu  gentoo  org>
AuthorDate: Fri Jun 24 03:07:13 2016 +
Commit: Benda XU  gentoo  org>
CommitDate: Fri Jun 24 03:07:13 2016 +
URL:https://gitweb.gentoo.org/dev/heroxbd.git/commit/?id=c147c553

toolchain.eclass: prefixify cross compile parts.

 eclass/toolchain.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 44ec160..b6df2da 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1833,8 +1833,8 @@ gcc_movelibs() {
# that you want to link against when building tools rather than building
# code to run on the target.
if tc_version_is_at_least 5 && is_crosscompile ; then
-   dodir "${HOSTLIBPATH}"
-   mv "${D}"/usr/$(get_libdir)/libcc1* "${D}${HOSTLIBPATH}" || die
+   dodir "${HOSTLIBPATH#${EPREFIX}}"
+   mv "${ED}"/usr/$(get_libdir)/libcc1* "${D}${HOSTLIBPATH}" || die
fi
 
# For all the libs that are built for CTARGET, move them into the



[gentoo-commits] dev/heroxbd:master commit in: eclass/

2016-05-25 Thread Benda XU
commit: e3dbf227fb7126e54e7b151aac2ec4fe5e24
Author: Benda Xu  gentoo  org>
AuthorDate: Thu May 26 04:03:51 2016 +
Commit: Benda XU  gentoo  org>
CommitDate: Thu May 26 04:03:51 2016 +
URL:https://gitweb.gentoo.org/dev/heroxbd.git/commit/?id=e3dbf227

db.eclass: import from prefix tree.

 eclass/db.eclass | 210 +++
 1 file changed, 210 insertions(+)

diff --git a/eclass/db.eclass b/eclass/db.eclass
new file mode 100644
index 000..f7070d4
--- /dev/null
+++ b/eclass/db.eclass
@@ -0,0 +1,210 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/db.eclass,v 1.49 2013/07/21 09:23:45 
pacho Exp $
+# This is a common location for functions used in the sys-libs/db ebuilds
+#
+# Bugs: maintainer-nee...@gentoo.org
+
+inherit eutils multilib
+
+IUSE="doc test examples"
+
+EXPORT_FUNCTIONS src_test
+
+DEPEND="test? ( >=dev-lang/tcl-8.4 )"
+
+RDEPEND=""
+
+db_fix_so() {
+   has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
+   LIB="${EROOT}/usr/$(get_libdir)"
+
+   cd "${LIB}"
+
+   # first clean up old symlinks
+   find "${LIB}" -maxdepth 1 -type l -name 'libdb[1_-]*'"$(get_libname)" 
-delete
+   find "${LIB}" -maxdepth 1 -type l -name 'libdb[1_-]*'"$(get_libname 
"[23]")" -delete
+   find "${LIB}" -maxdepth 1 -type l -name "libdb$(get_libname)" -delete 
#519364
+   find "${LIB}" -maxdepth 1 -type l -name "libdb$(get_libname "[23]")" 
-delete #519364
+   find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*a' -delete
+
+   # now rebuild all the correct ones
+   for ext in so a dylib sl; do
+   for name in libdb libdb_{cxx,tcl,java,sql,stl}; do
+   target=`find . -maxdepth 1 -type f -name 
"${name}-*.${ext}" |sort -n |tail -n 1`
+   [ -n "${target}" ] || continue;
+   case ${CHOST} in 
+   *-aix*)
+   aixdll --merge-runtime \
+   --keepdir=false \
+   --target="${name}.${ext}" \
+   --current="${target}" \
+   `find . -maxdepth 1 -type f -name 
"${name}-*.${ext}"`
+   ;;
+   *)
+   ln -sf ${target//.\//} ${name}.${ext}
+   ;;
+   esac;
+   done;
+   done;
+
+   # db[23] gets some extra-special stuff
+   if [ -f libdb1$(get_libname 2) ]; then
+   ln -sf libdb1$(get_libname 2) libdb$(get_libname 2)
+   ln -sf libdb1$(get_libname 2) libdb1$(get_libname)
+   ln -sf libdb1$(get_libname 2) libdb-1$(get_libame)
+   fi
+   # what do we do if we ever get 3.3 ?
+   for i in libdb libdb_{cxx,tcl,java,sql,stl}; do
+   if [ -f $i-3$(get_libname 2) ]; then
+   ln -sf $i-3$(get_libname 2) $i-3$(get_libname)
+   ln -sf $i-3$(get_libname 2) $i$(get_libname 3)
+   fi
+   done
+
+   # do the same for headers now
+   # but since there are only two of them, just overwrite them
+   cd "${EROOT}"/usr/include
+   target=`find . -maxdepth 1 -type d -name 'db[0-9]*' | sort -n |cut -d/ 
-f2- | tail -n1`
+   if [ -n "${target}" ] && [ -e "${target}/db.h" ] && ( ! [[ -e db.h ]] 
|| [[ -h db.h ]] ); then
+   einfo "Creating db.h symlinks to ${target}"
+   ln -sf "${target}"/db.h .
+   ln -sf "${target}"/db_185.h .
+   elif [ ! -e "${target}/db.h" ]; then
+   if [ -n "${target}" ]; then
+   ewarn "Could not find ${target}/db.h"
+   elif [ -h db.h ]; then
+   einfo "Apparently you just removed the last instance of 
$PN. Removing the symlinks"
+   rm -f db.h db_185.h
+   fi
+   fi
+}
+
+db_src_install_doc() {
+   has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
+   # not everybody wants this wad of documentation as it is primarily API 
docs
+   if use doc; then
+   dodir /usr/share/doc/${PF}/html
+   mv "${ED}"/usr/docs/* "${ED}"/usr/share/doc/${PF}/html/
+   rm -rf "${ED}"/usr/docs
+   else
+   rm -rf "${ED}"/usr/docs
+   fi
+
+   db_src_install_examples
+}
+
+db_src_install_examples() {
+   has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
+   if use examples ; then
+   local langs="c cxx stl"
+   [[ "${IUSE/java}" != "${IUSE}" ]] \
+   && use java \
+   && langs="${langs} java"
+   for i in $langs ; do
+   destdir="/usr/share/doc/${PF}/"
+ 

[gentoo-commits] dev/heroxbd:master commit in: eclass/

2016-05-25 Thread Benda XU
commit: 57177c6d001b16b81ed164de16b328d3a67cac08
Author: Benda Xu  gentoo  org>
AuthorDate: Thu May 26 04:03:20 2016 +
Commit: Benda XU  gentoo  org>
CommitDate: Thu May 26 04:03:20 2016 +
URL:https://gitweb.gentoo.org/dev/heroxbd.git/commit/?id=57177c6d

user.eclass: not to fail under prefix.

 eclass/user.eclass | 466 +
 1 file changed, 466 insertions(+)

diff --git a/eclass/user.eclass b/eclass/user.eclass
new file mode 100644
index 000..860aba0
--- /dev/null
+++ b/eclass/user.eclass
@@ -0,0 +1,466 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# @ECLASS: user.eclass
+# @MAINTAINER:
+# base-sys...@gentoo.org (Linux)
+# Joe Jezak  (OS X)
+# us...@gentoo.org (OS X)
+# Aaron Walker  (FreeBSD)
+# @BLURB: user management in ebuilds
+# @DESCRIPTION:
+# The user eclass contains a suite of functions that allow ebuilds
+# to quickly make sure users in the installed system are sane.
+
+if [[ -z ${_USER_ECLASS} ]]; then
+_USER_ECLASS=1
+
+# @FUNCTION: _assert_pkg_ebuild_phase
+# @INTERNAL
+# @USAGE: 
+_assert_pkg_ebuild_phase() {
+   case ${EBUILD_PHASE} in
+   setup|preinst|postinst) ;;
+   *)
+   eerror "'$1()' called from '${EBUILD_PHASE}' phase which is not 
OK:"
+   eerror "You may only call from pkg_{setup,preinst,postinst} 
functions."
+   eerror "Package fails at QA and at life.  Please file a bug."
+   die "Bad package!  $1 is only for use in some pkg_* functions!"
+   esac
+}
+
+# @FUNCTION: egetent
+# @USAGE:  
+# @DESCRIPTION:
+# Small wrapper for getent (Linux), nidump (< Mac OS X 10.5),
+# dscl (Mac OS X 10.5), and pw (FreeBSD) used in enewuser()/enewgroup().
+#
+# Supported databases: group passwd
+egetent() {
+   local db=$1 key=$2
+
+   [[ $# -ge 3 ]] && die "usage: egetent  "
+
+   case ${db} in
+   passwd|group) ;;
+   *) die "sorry, database '${db}' not yet supported; file a bug" ;;
+   esac
+
+   case ${CHOST} in
+   *-darwin[678])
+   case ${key} in
+   *[!0-9]*) # Non numeric
+   nidump ${db} . | awk -F: "(\$1 ~ /^${key}\$/) 
{print;exit;}"
+   ;;
+   *)  # Numeric
+   nidump ${db} . | awk -F: "(\$3 == ${key}) {print;exit;}"
+   ;;
+   esac
+   ;;
+   *-darwin*)
+   local mykey
+   case ${db} in
+   passwd) db="Users"  mykey="UniqueID" ;;
+   group)  db="Groups" mykey="PrimaryGroupID" ;;
+   esac
+
+   case ${key} in
+   *[!0-9]*) # Non numeric
+   dscl . -read /${db}/${key} 2>/dev/null |grep RecordName
+   ;;
+   *)  # Numeric
+   dscl . -search /${db} ${mykey} ${key} 2>/dev/null
+   ;;
+   esac
+   ;;
+   *-freebsd*|*-dragonfly*)
+   case ${db} in
+   passwd) db="user" ;;
+   *) ;;
+   esac
+
+   # lookup by uid/gid
+   local opts
+   if [[ ${key} == [[:digit:]]* ]] ; then
+   [[ ${db} == "user" ]] && opts="-u" || opts="-g"
+   fi
+
+   pw show ${db} ${opts} "${key}" -q
+   ;;
+   *-netbsd*|*-openbsd*)
+   grep "${key}:\*:" /etc/${db}
+   ;;
+   *)
+   # ignore output if nscd doesn't exist, or we're not running as 
root
+   nscd -i "${db}" 2>/dev/null
+   getent "${db}" "${key}"
+   ;;
+   esac
+}
+
+# @FUNCTION: enewuser
+# @USAGE:  [uid] [shell] [homedir] [groups]
+# @DESCRIPTION:
+# Same as enewgroup, you are not required to understand how to properly add
+# a user to the system.  The only required parameter is the username.
+# Default uid is (pass -1 for this) next available, default shell is
+# /bin/false, default homedir is /dev/null, and there are no default groups.
+enewuser() {
+   _assert_pkg_ebuild_phase ${FUNCNAME}
+
+   # get the username
+   local euser=$1; shift
+   if [[ -z ${euser} ]] ; then
+   eerror "No username specified !"
+   die "Cannot call enewuser without a username"
+   fi
+
+   # lets see if the username already exists
+   if [[ -n $(egetent passwd "${euser}") ]] ; then
+   return 0
+   fi
+   einfo "Adding user '${euser}' to your system ..."
+
+   # options to pass to useradd
+   local opts=()
+
+   # handle uid
+   local euid=$1; shift
+   if [[ -n ${euid} && ${euid} != -1 ]] ; then
+   if [[ ${euid} -gt 0 ]] ; then
+   if [[ -n $(egetent passwd ${euid}) ]] ; then
+   euid="next"
+ 

[gentoo-commits] dev/heroxbd:master commit in: eclass/

2016-05-23 Thread Benda XU
commit: 81fc154277582961526722e099fb8d38751000fd
Author: Benda Xu  gentoo  org>
AuthorDate: Mon May 23 16:14:35 2016 +
Commit: Benda XU  gentoo  org>
CommitDate: Mon May 23 16:14:35 2016 +
URL:https://gitweb.gentoo.org/dev/heroxbd.git/commit/?id=81fc1542

kernel-2.eclass: track.

Bug: 478436

 eclass/kernel-2.eclass | 1321 
 1 file changed, 1321 insertions(+)

diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
new file mode 100644
index 000..e8cb8f2
--- /dev/null
+++ b/eclass/kernel-2.eclass
@@ -0,0 +1,1321 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.297 2014/11/28 
17:40:20 mpagano Exp $
+
+# Description: kernel.eclass rewrite for a clean base regarding the 2.6
+#  series of kernel with back-compatibility for 2.4
+#
+# Original author: John Mylchreest 
+# Maintainer: kernel-m...@gentoo.org
+#
+# Please direct your bugs to the current eclass maintainer :)
+
+# added functionality:
+# unipatch - a flexible, singular method to extract, add and 
remove patches.
+
+# A Couple of env vars are available to effect usage of this eclass
+# These are as follows:
+#
+# K_USEPV  - When setting the EXTRAVERSION 
variable, it should
+#add PV to the end.
+#this is useful for thigns 
like wolk. IE:
+#EXTRAVERSION would be 
something like : -wolk-4.19-r1
+# K_NOSETEXTRAVERSION  - if this is set then EXTRAVERSION will not be
+#automatically set within the 
kernel Makefile
+# K_NOUSENAME  - if this is set then EXTRAVERSION will not 
include the
+#first part of ${PN} in 
EXTRAVERSION
+# K_NOUSEPR- if this is set then EXTRAVERSION will 
not include the
+#anything based on ${PR}.
+# K_PREPATCHED - if the patchset is prepatched (ie: mm-sources,
+#ck-sources, ac-sources) it 
will use PR (ie: -r5) as
+#the patchset version for
+#and not use it as a true 
package revision
+# K_EXTRAEINFO - this is a new-line seperated list of einfo 
displays in
+#postinst and can be used to 
carry additional postinst
+#messages
+# K_EXTRAELOG  - same as K_EXTRAEINFO except using elog 
instead of einfo
+# K_EXTRAEWARN - same as K_EXTRAEINFO except using ewarn 
instead of einfo
+# K_SYMLINK- if this is set, then forcably create 
symlink anyway
+#
+# K_DEFCONFIG  - Allow specifying a different defconfig target.
+#If length zero, defaults to 
"defconfig".
+# K_WANT_GENPATCHES- Apply genpatches to kernel source. Provide any
+#combination of "base", 
"extras" or "experimental".
+# K_EXP_GENPATCHES_PULL- If set, we pull "experimental" regardless of 
the USE FLAG
+#but expect the ebuild 
maintainer to use K_EXP_GENPATCHES_LIST.
+# K_EXP_GENPATCHES_NOUSE   - If set, no USE flag will be provided for 
"experimental";
+#as a result the user cannot 
choose to apply those patches.
+# K_EXP_GENPATCHES_LIST- A list of patches to pick from "experimental" 
to apply when
+#the USE flag is unset and 
K_EXP_GENPATCHES_PULL is set.
+# K_GENPATCHES_VER - The version of the genpatches tarball(s) to 
apply.
+#A value of "5" would apply 
genpatches-2.6.12-5 to
+#my-sources-2.6.12.ebuild
+# K_SECURITY_UNSUPPORTED- If set, this kernel is unsupported by Gentoo Security
+# K_DEBLOB_AVAILABLE   - A value of "0" will disable all of the optional deblob
+#code. If empty, will be set 
to "1" if deblobbing is
+#possible. Test ONLY for "1".
+# K_PREDEBLOBBED   - This kernel was already deblobbed elsewhere.
+#If false, either optional 
deblobbing will be available
+#or the license will note the 
inclusion of freedist
+#code.
+# K_L

[gentoo-commits] dev/heroxbd:master commit in: eclass/

2016-05-22 Thread Benda XU
commit: da66246c68be060ea7484110fac298ac7fa4363d
Author: Benda Xu  gentoo  org>
AuthorDate: Sun May 22 04:03:48 2016 +
Commit: Benda XU  gentoo  org>
CommitDate: Sun May 22 04:03:48 2016 +
URL:https://gitweb.gentoo.org/dev/heroxbd.git/commit/?id=da66246c

prefix.eclass: add eprefixify_patch.

 eclass/prefix.eclass | 25 +
 1 file changed, 25 insertions(+)

diff --git a/eclass/prefix.eclass b/eclass/prefix.eclass
index 1f3c4b0..101cce2 100644
--- a/eclass/prefix.eclass
+++ b/eclass/prefix.eclass
@@ -12,6 +12,8 @@
 # located somewhere in the filesystem.  Prefix ebuilds require
 # additional functions and variables which are defined by this eclass.
 
+inherit eutils
+
 # @ECLASS-VARIABLE: EPREFIX
 # @DESCRIPTION:
 # The offset prefix of a Gentoo Prefix installation.  When Gentoo Prefix
@@ -48,5 +50,28 @@ eprefixify() {
return 0
 }
 
+# @FUNCTION: eprefixify_patch
+# @USAGE: 
+# @DESCRIPTION:
+# copies the patch files to ${T} and eprefixify before applying.
+# dies if no arguments are given, a file does not exist, or changing a
+# file failed.
+eprefixity_patch() {
+   [[ $# -lt 1 ]] && die "at least one argument required"
+
+   local x f
+   for x in "$@" ; do
+   if [[ -e ${x} ]] ; then
+   f=${x##*/}
+   cp "${x}" "${T}" || die "failed to copy patch"
+   eprefixify "${T}"/${f}
+   epatch "${T}"/${f}
+   else
+   die "${x} does not exist"
+   fi
+   done
+
+   return 0
+}
 
 # vim: tw=72:



[gentoo-commits] dev/heroxbd:master commit in: eclass/

2016-05-22 Thread Benda XU
commit: eae808b55c1155d75825122ed5d875f7bf277c86
Author: Benda Xu  gentoo  org>
AuthorDate: Sun May 22 04:03:01 2016 +
Commit: Benda XU  gentoo  org>
CommitDate: Sun May 22 04:03:01 2016 +
URL:https://gitweb.gentoo.org/dev/heroxbd.git/commit/?id=eae808b5

Revert "prefix.eclass: merged"

This reverts commit abe0e1cb5fc08292397e3c38895185ec9481c9dc.

 eclass/prefix.eclass | 52 
 1 file changed, 52 insertions(+)

diff --git a/eclass/prefix.eclass b/eclass/prefix.eclass
new file mode 100644
index 000..1f3c4b0
--- /dev/null
+++ b/eclass/prefix.eclass
@@ -0,0 +1,52 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# @ECLASS: prefix.eclass
+# @MAINTAINER:
+# Feel free to contact the Prefix team through  if
+# you have problems, suggestions or questions.
+# @BLURB: Eclass to provide Prefix functionality
+# @DESCRIPTION:
+# Gentoo Prefix allows users to install into a self defined offset
+# located somewhere in the filesystem.  Prefix ebuilds require
+# additional functions and variables which are defined by this eclass.
+
+# @ECLASS-VARIABLE: EPREFIX
+# @DESCRIPTION:
+# The offset prefix of a Gentoo Prefix installation.  When Gentoo Prefix
+# is not used, ${EPREFIX} should be "".  Prefix Portage sets EPREFIX,
+# hence this eclass has nothing to do here in that case.
+# Note that setting EPREFIX in the environment with Prefix Portage sets
+# Portage into cross-prefix mode.
+if [[ ! ${EPREFIX+set} ]]; then
+   export EPREFIX=''
+fi
+
+
+# @FUNCTION: eprefixify
+# @USAGE: 
+# @DESCRIPTION:
+# replaces @GENTOO_PORTAGE_EPREFIX@ with ${EPREFIX} for the given files,
+# dies if no arguments are given, a file does not exist, or changing a
+# file failed.
+eprefixify() {
+   [[ $# -lt 1 ]] && die "at least one argument required"
+
+   einfo "Adjusting to prefix ${EPREFIX:-/}"
+   local x
+   for x in "$@" ; do
+   if [[ -e ${x} ]] ; then
+   ebegin "  ${x##*/}"
+   sed -i -e "s|@GENTOO_PORTAGE_EPREFIX@|${EPREFIX}|g" 
"${x}"
+   eend $? || die "failed to eprefixify ${x}"
+   else
+   die "${x} does not exist"
+   fi
+   done
+
+   return 0
+}
+
+
+# vim: tw=72:



[gentoo-commits] dev/heroxbd:master commit in: eclass/

2016-05-22 Thread Benda XU
commit: f9104e06308a2f4ffe402469af42a4931dae3297
Author: Benda Xu  gentoo  org>
AuthorDate: Sun May 22 07:45:28 2016 +
Commit: Benda XU  gentoo  org>
CommitDate: Sun May 22 07:45:28 2016 +
URL:https://gitweb.gentoo.org/dev/heroxbd.git/commit/?id=f9104e06

toolchain-binutils.eclass: merged.
toolchain.eclass: move the tricks into profiles.

 eclass/toolchain-binutils.eclass | 507 ---
 eclass/toolchain.eclass  |   2 +-
 2 files changed, 1 insertion(+), 508 deletions(-)

diff --git a/eclass/toolchain-binutils.eclass b/eclass/toolchain-binutils.eclass
deleted file mode 100644
index e8ceca4..000
--- a/eclass/toolchain-binutils.eclass
+++ /dev/null
@@ -1,507 +0,0 @@
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-binutils.eclass,v 1.137 
2014/11/08 17:12:09 vapier Exp $
-#
-# Maintainer: Toolchain Ninjas 
-#
-# We install binutils into CTARGET-VERSION specific directories.  This lets
-# us easily merge multiple versions for multiple targets (if we wish) and
-# then switch the versions on the fly (with `binutils-config`).
-#
-# binutils-   -> live cvs
-# binutils-   -> live git
-# binutils-_preYYMMDD -> nightly snapshot date YYMMDD
-# binutils-#  -> normal release
-
-extra_eclass=""
-if [[ -n ${BINUTILS_TYPE} ]] ; then
-   BTYPE=${BINUTILS_TYPE}
-else
-   case ${PV} in
-   )  BTYPE="cvs";;
-   )  BTYPE="git";;
-   _pre*) BTYPE="snap";;
-   *.*.90)BTYPE="snap";;
-   *.*.*.*.*) BTYPE="hjlu";;
-   *) BTYPE="rel";;
-   esac
-fi
-
-case ${BTYPE} in
-cvs)
-   extra_eclass="cvs"
-   ECVS_SERVER="sourceware.org:/cvs/src"
-   ECVS_MODULE="binutils"
-   ECVS_USER="anoncvs"
-   ECVS_PASS="anoncvs"
-   BVER="cvs"
-   ;;
-git)
-   extra_eclass="git-2"
-   BVER="git"
-   EGIT_REPO_URI="git://sourceware.org/git/binutils-gdb.git"
-   ;;
-snap)
-   BVER=${PV/_pre}
-   ;;
-*)
-   BVER=${BINUTILS_VER:-${PV}}
-   ;;
-esac
-
-inherit eutils libtool flag-o-matic gnuconfig multilib versionator unpacker 
${extra_eclass}
-case ${EAPI:-0} in
-0|1)
-   EXPORT_FUNCTIONS src_unpack src_compile src_test src_install 
pkg_postinst pkg_postrm ;;
-2|3|4|5)
-   EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile 
src_test src_install pkg_postinst pkg_postrm ;;
-*) die "unsupported EAPI ${EAPI}" ;;
-esac
-
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
-   if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
-   export CTARGET=${CATEGORY/cross-}
-   fi
-fi
-is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
-
-DESCRIPTION="Tools necessary to build programs"
-HOMEPAGE="http://sourceware.org/binutils/";
-
-case ${BTYPE} in
-   cvs|git) SRC_URI="" ;;
-   snap)
-   
SRC_URI="ftp://gcc.gnu.org/pub/binutils/snapshots/binutils-${BVER}.tar.bz2
-   
ftp://sourceware.org/pub/binutils/snapshots/binutils-${BVER}.tar.bz2"; ;;
-   hjlu)
-   
SRC_URI="mirror://kernel/linux/devel/binutils/binutils-${BVER}.tar."
-   version_is_at_least 2.21.51.0.5 && SRC_URI+="xz" || 
SRC_URI+="bz2" ;;
-   rel) SRC_URI="mirror://gnu/binutils/binutils-${BVER}.tar.bz2" ;;
-esac
-add_src_uri() {
-   [[ -z $2 ]] && return
-   local a=$1
-   if version_is_at_least 2.22.52.0.2 ; then
-   a+=".xz"
-   else
-   a+=".bz2"
-   fi
-   set -- mirror://gentoo http://dev.gentoo.org/~vapier/dist
-   SRC_URI="${SRC_URI} ${@/%//${a}}"
-}
-add_src_uri binutils-${BVER}-patches-${PATCHVER}.tar ${PATCHVER}
-add_src_uri binutils-${BVER}-uclibc-patches-${UCLIBC_PATCHVER}.tar 
${UCLIBC_PATCHVER}
-add_src_uri elf2flt-${ELF2FLT_VER}.tar ${ELF2FLT_VER}
-
-if version_is_at_least 2.18 ; then
-   LICENSE="|| ( GPL-3 LGPL-3 )"
-else
-   LICENSE="|| ( GPL-2 LGPL-2 )"
-fi
-IUSE="cxx multislot multitarget nls static-libs test vanilla"
-if version_is_at_least 2.19 ; then
-   IUSE+=" zlib"
-fi
-if ! version_is_at_least 2.23.90 || [[ ${PV} == "" ]] || use multislot ; 
then
-   SLOT="${BVER}"
-else
-   SLOT="0"
-fi
-
-RDEPEND=">=sys-devel/binutils-config-3"
-in_iuse zlib && RDEPEND+=" zlib? ( sys-libs/zlib )"
-DEPEND="${RDEPEND}
-   test? ( dev-util/dejagnu )
-   nls? ( sys-devel/gettext )
-   sys-devel/flex
-   virtual/yacc"
-
-S=${WORKDIR}/binutils
-case ${BVER} in
-cvs|git) ;;
-*) S=${S}-${BVER} ;;
-esac
-
-LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${BVER}
-INCPATH=${LIBPATH}/include
-DATAPATH=/usr/share/binutils-data/${CTARGET}/${BVER}
-MY_BUILDDIR=${WORKDIR}/build
-if is_cross ; then
-   BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${BVER}
-else
-   BINPATH=/usr/${CTARGET}/binutils-bin/${BVER}
-fi
-
-tc-binutils_unpack() {

[gentoo-commits] dev/heroxbd:master commit in: eclass/

2016-05-22 Thread Benda XU
commit: 3041a9deec4adf30339aec0b37f440af19e7334a
Author: Benda Xu  gentoo  org>
AuthorDate: Sun May 22 04:00:33 2016 +
Commit: Benda XU  gentoo  org>
CommitDate: Sun May 22 04:00:33 2016 +
URL:https://gitweb.gentoo.org/dev/heroxbd.git/commit/?id=3041a9de

toolchain.eclass: no need to use flag rap anymore.

 eclass/toolchain.eclass | 23 +--
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index d24e810..b9088ca 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -139,7 +139,7 @@ IUSE="multislot regression-test vanilla"
 IUSE_DEF=( nls nptl )
 
 if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
-   IUSE+=" altivec rap"
+   IUSE+=" altivec"
IUSE_DEF+=( cxx fortran )
[[ -n ${PIE_VER} ]] && IUSE+=" nopie"
[[ -n ${HTB_VER} ]] && IUSE+=" boundschecking"
@@ -990,15 +990,6 @@ toolchain_src_configure() {
confgcc+=( --enable-shared )
fi
 
-   if use rap ; then
-   # use sysroot of toolchain to get currect include and 
library at compile time
-   confgcc+=( --with-sysroot="${EPREFIX}" )
-
-   # when doing cross compiling native for target, the 
build sysroot
-   # should be pointed to SYSROOT of the cross compiler.
-   tc-is-cross-compiler && confgcc+=( 
--with-build-sysroot="${ROOT}" )
-   fi
-
case ${CHOST} in
mingw*|*-mingw*|*-cygwin)
confgcc+=( --enable-threads=win32 ) ;;
@@ -1855,18 +1846,6 @@ fix_libtool_libdir_paths() {
popd >/dev/null
 }
 
-prefix_gcc_dynamic_loader() {
-   local dlf
-
-   case $(tc-arch) in
-   amd64) dlf=i386/linux64.h ;;
-   arm) dlf=arm/linux-eabi.h ;;
-   x86) dlf=i386/linux.h ;;
-   esac
-
-   eprefixify gcc/config/${dlf}
-}
-
 create_gcc_env_entry() {
dodir /etc/env.d/gcc
local gcc_envd_base="/etc/env.d/gcc/${CTARGET}-${GCC_CONFIG_VER}"



[gentoo-commits] dev/heroxbd:master commit in: eclass/

2016-05-22 Thread Benda XU
commit: abe0e1cb5fc08292397e3c38895185ec9481c9dc
Author: Benda Xu  gentoo  org>
AuthorDate: Sun May 22 04:01:45 2016 +
Commit: Benda XU  gentoo  org>
CommitDate: Sun May 22 04:01:45 2016 +
URL:https://gitweb.gentoo.org/dev/heroxbd.git/commit/?id=abe0e1cb

prefix.eclass: merged

 eclass/prefix.eclass | 52 
 1 file changed, 52 deletions(-)

diff --git a/eclass/prefix.eclass b/eclass/prefix.eclass
deleted file mode 100644
index 1f3c4b0..000
--- a/eclass/prefix.eclass
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-# @ECLASS: prefix.eclass
-# @MAINTAINER:
-# Feel free to contact the Prefix team through  if
-# you have problems, suggestions or questions.
-# @BLURB: Eclass to provide Prefix functionality
-# @DESCRIPTION:
-# Gentoo Prefix allows users to install into a self defined offset
-# located somewhere in the filesystem.  Prefix ebuilds require
-# additional functions and variables which are defined by this eclass.
-
-# @ECLASS-VARIABLE: EPREFIX
-# @DESCRIPTION:
-# The offset prefix of a Gentoo Prefix installation.  When Gentoo Prefix
-# is not used, ${EPREFIX} should be "".  Prefix Portage sets EPREFIX,
-# hence this eclass has nothing to do here in that case.
-# Note that setting EPREFIX in the environment with Prefix Portage sets
-# Portage into cross-prefix mode.
-if [[ ! ${EPREFIX+set} ]]; then
-   export EPREFIX=''
-fi
-
-
-# @FUNCTION: eprefixify
-# @USAGE: 
-# @DESCRIPTION:
-# replaces @GENTOO_PORTAGE_EPREFIX@ with ${EPREFIX} for the given files,
-# dies if no arguments are given, a file does not exist, or changing a
-# file failed.
-eprefixify() {
-   [[ $# -lt 1 ]] && die "at least one argument required"
-
-   einfo "Adjusting to prefix ${EPREFIX:-/}"
-   local x
-   for x in "$@" ; do
-   if [[ -e ${x} ]] ; then
-   ebegin "  ${x##*/}"
-   sed -i -e "s|@GENTOO_PORTAGE_EPREFIX@|${EPREFIX}|g" 
"${x}"
-   eend $? || die "failed to eprefixify ${x}"
-   else
-   die "${x} does not exist"
-   fi
-   done
-
-   return 0
-}
-
-
-# vim: tw=72:



[gentoo-commits] dev/heroxbd:master commit in: eclass/, sys-devel/gcc/files/

2014-12-10 Thread Benda XU
commit: 0662c6fe9c0f3da03f11403a145edd6113d65585
Author: Benda Xu  gentoo  org>
AuthorDate: Wed Dec 10 02:51:09 2014 +
Commit: Benda XU  gentoo  org>
CommitDate: Wed Dec 10 02:51:09 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=dev/heroxbd.git;a=commit;h=0662c6fe

sys-devel/gcc: Prefixify fix_libtool_files.sh

---
 eclass/toolchain.eclass  | 14 +++---
 sys-devel/gcc/files/fix_libtool_files.sh | 20 +++-
 2 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 3e422c6..d24e810 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1728,16 +1728,24 @@ toolchain_src_install() {
# Rather install the script, else portage with changing $FILESDIR
# between binary and source package borks things 
if ! is_crosscompile ; then
+cp "${GCC_FILESDIR}"/fix_libtool_files.sh "${T}"
+cp "${GCC_FILESDIR}"/awk/fixlafiles.awk-no_gcc_la "${T}"
+cp "${GCC_FILESDIR}"/awk/fixlafiles.awk "${T}"
+   eprefixify \
+"${T}"/fix_libtool_files.sh \
+"${T}"/fixlafiles.awk-no_gcc_la \
+"${T}"/fixlafiles.awk
+
insinto "${DATAPATH#${EPREFIX}}"
if tc_version_is_at_least 4.0 ; then
-   newins "${GCC_FILESDIR}"/awk/fixlafiles.awk-no_gcc_la 
fixlafiles.awk || die
+   newins "${T}"/fixlafiles.awk-no_gcc_la fixlafiles.awk 
|| die
find "${D}/${LIBPATH}" -name libstdc++.la -type f -exec 
rm "{}" \;
find "${D}/${LIBPATH}" -name "lib?san.la" -type f -exec 
rm "{}" \; # 487550
else
-   doins "${GCC_FILESDIR}"/awk/fixlafiles.awk || die
+   doins "${T}"/fixlafiles.awk || die
fi
exeinto "${DATAPATH#${EPREFIX}}"
-   doexe "${GCC_FILESDIR}"/fix_libtool_files.sh || die
+   doexe "${T}"/fix_libtool_files.sh || die
doexe "${GCC_FILESDIR}"/c{89,99} || die
fi
 

diff --git a/sys-devel/gcc/files/fix_libtool_files.sh 
b/sys-devel/gcc/files/fix_libtool_files.sh
index 0c8a42b..4a89bae 100644
--- a/sys-devel/gcc/files/fix_libtool_files.sh
+++ b/sys-devel/gcc/files/fix_libtool_files.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@GENTOO_PORTAGE_EPREFIX@/bin/sh
 # Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/fix_libtool_files.sh,v 
1.17 2014/05/20 08:00:40 rhill Exp $
@@ -37,12 +37,14 @@ ARGV1=$1
 ARGV2=$2
 ARGV3=$3
 
-. /etc/profile || exit 1
+. "@GENTOO_PORTAGE_EPREFIX@"/etc/profile || exit 1
+. "@GENTOO_PORTAGE_EPREFIX@"/etc/init.d/functions.sh || exit 1
 
-if [ ${EUID:-0} -ne 0 ] ; then
-   echo "${0##*/}: Must be root."
-   exit 1
-fi
+# Prefix: no!
+#if [ ${EUID:-0} -ne 0 ] ; then
+#  eerror "${0##*/}: Must be root."
+#  exit 1
+#fi
 
 # make sure the files come out sane
 umask 0022
@@ -50,10 +52,10 @@ umask 0022
 OLDCHOST=
 [ "${ARGV2}" = "--oldarch" ] && OLDCHOST=${ARGV3}
 
-AWKDIR="/usr/share/gcc-data"
+AWKDIR="@GENTOO_PORTAGE_EPREFIX@/usr/share/gcc-data"
 
 if [ ! -r "${AWKDIR}/fixlafiles.awk" ] ; then
-   echo "${0##*/}: ${AWKDIR}/fixlafiles.awk does not exist!"
+   eerror "${0##*/}: ${AWKDIR}/fixlafiles.awk does not exist!"
exit 1
 fi
 
@@ -61,7 +63,7 @@ OLDVER=${ARGV1}
 
 export OLDVER OLDCHOST
 
-echo "Scanning libtool files for hardcoded gcc library paths..."
+einfo "Scanning libtool files for hardcoded gcc library paths..."
 exec gawk -f "${AWKDIR}/fixlafiles.awk"
 
 # vim:ts=4



[gentoo-commits] dev/heroxbd:master commit in: eclass/

2014-12-04 Thread Benda XU
commit: b78f7e2d073c2e7d8e4b75f0d955ebc51be20764
Author: Benda Xu  gentoo  org>
AuthorDate: Thu Dec  4 02:09:36 2014 +
Commit: Benda XU  gentoo  org>
CommitDate: Thu Dec  4 02:09:36 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=dev/heroxbd.git;a=commit;h=b78f7e2d

toolchain.eclass: compatible variables ED and EROOT for EAPI 0,1,2.

---
 eclass/toolchain.eclass | 5 +
 1 file changed, 5 insertions(+)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 73421f7..3e422c6 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -49,6 +49,11 @@ is_crosscompile() {
[[ ${CHOST} != ${CTARGET} ]]
 }
 
+if [[ ${EAPI:-0} == [012] ]] ; then
+: ${ED:=${D}}
+: ${EROOT:=${ROOT}}
+fi
+
 # General purpose version check.  Without a second arg matches up to minor 
version (x.x.x)
 tc_version_is_at_least() {
version_is_at_least "$1" "${2:-${GCC_RELEASE_VER}}"



[gentoo-commits] dev/heroxbd:master commit in: eclass/

2014-11-24 Thread Benda XU
commit: c98ce0ffdfec2231b6965981df9c832fa0da70a7
Author: Benda Xu  gentoo  org>
AuthorDate: Mon Nov 24 08:58:00 2014 +
Commit: Benda XU  gentoo  org>
CommitDate: Mon Nov 24 15:41:11 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=dev/heroxbd.git;a=commit;h=c98ce0ff

use toolchain eclass from gx86

---
 eclass/toolchain.eclass | 2488 ---
 1 file changed, 1298 insertions(+), 1190 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 55d9890..1345b5e 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1,16 +1,14 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.597 2013/07/24 
01:34:38 dirtyepic Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.647 2014/11/15 
08:45:33 vapier Exp $
 
 # Maintainer: Toolchain Ninjas 
 
-#>> eclass stuff <<
 DESCRIPTION="The GNU Compiler Collection"
 HOMEPAGE="http://gcc.gnu.org/";
-LICENSE="GPL-2 LGPL-2.1"
 RESTRICT="strip" # cross-compilers need controlled stripping
 
-inherit eutils versionator libtool toolchain-funcs flag-o-matic gnuconfig 
multilib fixheadtails pax-utils prefix
+inherit eutils fixheadtails flag-o-matic gnuconfig libtool multilib pax-utils 
toolchain-funcs versionator
 
 if [[ ${PV} == *_pre* ]] ; then
EGIT_REPO_URI="git://gcc.gnu.org/git/gcc.git"
@@ -26,10 +24,17 @@ fi
 
 FEATURES=${FEATURES/multilib-strict/}
 
-EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install 
pkg_postinst pkg_postrm
-#<< eclass stuff >>
+EXPORTED_FUNCTIONS="pkg_setup src_unpack src_compile src_test src_install 
pkg_postinst pkg_postrm"
+case ${EAPI:-0} in
+   0|1);;
+   2|3)EXPORTED_FUNCTIONS+=" src_prepare src_configure" ;;
+   4*|5*)  EXPORTED_FUNCTIONS+=" pkg_pretend src_prepare src_configure" ;;
+   *)  die "I don't speak EAPI ${EAPI}."
+esac
+EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}
 
 #>> globals <<
+
 export CTARGET=${CTARGET:-${CHOST}}
 if [[ ${CTARGET} = ${CHOST} ]] ; then
if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
@@ -45,11 +50,16 @@ is_crosscompile() {
 }
 
 # General purpose version check.  Without a second arg matches up to minor 
version (x.x.x)
-# (ie. 4.6.0_pre matches 4 or 4.6 or 4.6.0 but not 4.6.1)
 tc_version_is_at_least() {
version_is_at_least "$1" "${2:-${GCC_RELEASE_VER}}"
 }
 
+# General purpose version range check
+# Note that it matches up to but NOT including the second version
+tc_version_is_between() {
+   tc_version_is_at_least "${1}" && ! tc_version_is_at_least "${2}"
+}
+
 GCC_PV=${TOOLCHAIN_GCC_PV:-${PV}}
 GCC_PVR=${GCC_PV}
 [[ ${PR} != "r0" ]] && GCC_PVR=${GCC_PVR}-${PR}
@@ -66,12 +76,9 @@ GCCMICRO=$(get_version_component_range 3 ${GCC_PV})
 GCC_CONFIG_VER=${GCC_CONFIG_VER:-$(replace_version_separator 3 '-' ${GCC_PV})}
 
 # Pre-release support
-if [[ ${GCC_PV} != ${GCC_PV/_pre/-} ]] ; then
+if [[ ${GCC_PV} == *_pre* ]] ; then
PRERELEASE=${GCC_PV/_pre/-}
-fi
-
-# make _alpha and _beta ebuilds automatically use a snapshot
-if [[ ${GCC_PV} == *_alpha* ]] ; then
+elif [[ ${GCC_PV} == *_alpha* ]] ; then
SNAPSHOT=${GCC_BRANCH_VER}-${GCC_PV##*_alpha}
 elif [[ ${GCC_PV} == *_beta* ]] ; then
SNAPSHOT=${GCC_BRANCH_VER}-${GCC_PV##*_beta}
@@ -79,7 +86,13 @@ elif [[ ${GCC_PV} == *_rc* ]] ; then
SNAPSHOT=${GCC_PV%_rc*}-RC-${GCC_PV##*_rc}
 fi
 
+if [[ ${SNAPSHOT} == 5.0-* ]] ; then
+   # The gcc-5 release has dropped the .0 for some reason.
+   SNAPSHOT=${SNAPSHOT/5.0/5}
+fi
+
 export GCC_FILESDIR=${GCC_FILESDIR:-${FILESDIR}}
+
 PREFIX=${TOOLCHAIN_PREFIX:-/usr}
 
 if tc_version_is_at_least 3.4.0 ; then
@@ -100,38 +113,58 @@ 
DATAPATH=${TOOLCHAIN_DATAPATH:-${PREFIX}/share/gcc-data/${CTARGET}/${GCC_CONFIG_
 # Dont install in /usr/include/g++-v3/, but in gcc internal directory.
 # We will handle /usr/include/g++-v3/ with gcc-config ...
 
STDCXX_INCDIR=${TOOLCHAIN_STDCXX_INCDIR:-${LIBPATH}/include/g++-v${GCC_BRANCH_VER/\.*/}}
-#<< globals >>
 
-#>> SLOT+IUSE logic <<
-IUSE="multislot nls nptl regression-test vanilla"
+#>> LICENSE+SLOT+IUSE logic <<
+
+if tc_version_is_at_least 4.6 ; then
+   LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ 
gcc-runtime-library-exception-3.1 ) FDL-1.3+"
+elif tc_version_is_at_least 4.4 ; then
+   LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ 
gcc-runtime-library-exception-3.1 ) FDL-1.2+"
+elif tc_version_is_at_least 4.3 ; then
+   LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ ) FDL-1.2+"
+elif tc_version_is_at_least 4.2 ; then
+   LICENSE="GPL-3+ LGPL-2.1+ || ( GPL-3+ libgcc libstdc++ ) FDL-1.2+"
+elif tc_version_is_at_least 3.3 ; then
+   LICENSE="GPL-2+ LGPL-2.1+ FDL-1.2+"
+else
+   LICENSE="GPL-2+ LGPL-2.1+ FDL-1.1+"
+f

[gentoo-commits] dev/heroxbd:master commit in: eclass/, sys-devel/binutils/

2014-11-23 Thread Benda XU
commit: f997ed1017459a72f734565bba32d513380ffcc9
Author: Benda Xu  gentoo  org>
AuthorDate: Mon Nov 24 06:50:14 2014 +
Commit: Benda XU  gentoo  org>
CommitDate: Mon Nov 24 06:50:14 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=dev/heroxbd.git;a=commit;h=f997ed10

bump binutils to 2.24 for RAP, again

---
 eclass/toolchain-binutils.eclass   | 115 ++---
 sys-devel/binutils/Manifest|   2 +-
 sys-devel/binutils/binutils-2.24-r3.ebuild |   2 +-
 3 files changed, 75 insertions(+), 44 deletions(-)

diff --git a/eclass/toolchain-binutils.eclass b/eclass/toolchain-binutils.eclass
index d9197e0..e8ceca4 100644
--- a/eclass/toolchain-binutils.eclass
+++ b/eclass/toolchain-binutils.eclass
@@ -1,6 +1,6 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-binutils.eclass,v 1.123 
2013/02/09 04:32:48 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-binutils.eclass,v 1.137 
2014/11/08 17:12:09 vapier Exp $
 #
 # Maintainer: Toolchain Ninjas 
 #
@@ -39,7 +39,7 @@ cvs)
 git)
extra_eclass="git-2"
BVER="git"
-   EGIT_REPO_URI="git://sourceware.org/git/binutils.git"
+   EGIT_REPO_URI="git://sourceware.org/git/binutils-gdb.git"
;;
 snap)
BVER=${PV/_pre}
@@ -50,7 +50,13 @@ snap)
 esac
 
 inherit eutils libtool flag-o-matic gnuconfig multilib versionator unpacker 
${extra_eclass}
-EXPORT_FUNCTIONS src_unpack src_compile src_test src_install pkg_postinst 
pkg_postrm
+case ${EAPI:-0} in
+0|1)
+   EXPORT_FUNCTIONS src_unpack src_compile src_test src_install 
pkg_postinst pkg_postrm ;;
+2|3|4|5)
+   EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile 
src_test src_install pkg_postinst pkg_postrm ;;
+*) die "unsupported EAPI ${EAPI}" ;;
+esac
 
 export CTARGET=${CTARGET:-${CHOST}}
 if [[ ${CTARGET} == ${CHOST} ]] ; then
@@ -93,17 +99,17 @@ if version_is_at_least 2.18 ; then
 else
LICENSE="|| ( GPL-2 LGPL-2 )"
 fi
-IUSE="cxx nls multitarget multislot static-libs test vanilla"
+IUSE="cxx multislot multitarget nls static-libs test vanilla"
 if version_is_at_least 2.19 ; then
IUSE+=" zlib"
 fi
-if use multislot ; then
+if ! version_is_at_least 2.23.90 || [[ ${PV} == "" ]] || use multislot ; 
then
SLOT="${BVER}"
 else
SLOT="0"
 fi
 
-RDEPEND=">=sys-devel/binutils-config-1.9"
+RDEPEND=">=sys-devel/binutils-config-3"
 in_iuse zlib && RDEPEND+=" zlib? ( sys-libs/zlib )"
 DEPEND="${RDEPEND}
test? ( dev-util/dejagnu )
@@ -176,7 +182,7 @@ tc-binutils_apply_patches() {
# fix locale issues if possible #122216
if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
einfo "Fixing misc issues in configure files"
-   for f in $(grep -l 'autoconf version 2.13' $(find "${S}" -name 
configure)) ; do
+   for f in $(find "${S}" -name configure -exec grep -l 'autoconf 
version 2.13' {} +) ; do
ebegin "  Updating ${f/${S}\/}"
patch "${f}" 
"${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
|| eerror "Please file a bug about this"
@@ -201,15 +207,30 @@ tc-binutils_apply_patches() {
 
 toolchain-binutils_src_unpack() {
tc-binutils_unpack
+   case ${EAPI:-0} in
+   0|1) toolchain-binutils_src_prepare ;;
+   esac
+}
+
+toolchain-binutils_src_prepare() {
tc-binutils_apply_patches
 }
 
-toolchain-binutils_src_compile() {
-   # prevent makeinfo from running in releases.  it may not always be
-   # installed, and older binutils may fail with newer texinfo.
-   # besides, we never patch the doc files anyways, so regenerating
-   # in the first place is useless. #193364
-   find . '(' -name '*.info' -o -name '*.texi' ')' -print0 | xargs -0 
touch -r .
+_eprefix_init() {
+   has "${EAPI:-0}" 0 1 2 && ED=${D} EPREFIX= EROOT=${ROOT}
+}
+
+# Intended for ebuilds to override to set their own versioning information.
+toolchain-binutils_bugurl() {
+   printf "http://bugs.gentoo.org/";
+}
+toolchain-binutils_pkgversion() {
+   printf "Gentoo ${BVER}"
+   [[ -n ${PATCHVER} ]] && printf " p${PATCHVER}"
+}
+
+toolchain-binutils_src_configure() {
+   _eprefix_init
 
# make sure we filter $LINGUAS so that only ones that
# actually work make it through #42033
@@ -283,14 +304,42 @@ toolchain-binutils_src_compile() {
--enable-obsolete
--enable-shared
--enable-threads
+   # Newer versions (>=2.24) make this an explicit option. #497268
+   --enable-install-libiberty
--disable-werror
-   --with-bugurl=http://bugs.gentoo.org/
+   --with-bugurl="$(toolchain-binutils_bugurl)"
+