public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in sys-libs/glibc/files/eblits: pkg_pretend.eblit pkg_setup.eblit
@ 2015-05-27 14:02 Mike Frysinger (vapier)
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger (vapier) @ 2015-05-27 14:02 UTC (permalink / raw
  To: gentoo-commits

vapier      15/05/27 14:02:58

  Modified:             pkg_pretend.eblit pkg_setup.eblit
  Log:
  Relocate all pkg_setup checks to pkg_pretend #547420#31 by Pacho Ramos.
  
  (Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key D2E96200)

Revision  Changes    Path
1.2                  sys-libs/glibc/files/eblits/pkg_pretend.eblit

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/glibc/files/eblits/pkg_pretend.eblit?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/glibc/files/eblits/pkg_pretend.eblit?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/glibc/files/eblits/pkg_pretend.eblit?r1=1.1&r2=1.2

Index: pkg_pretend.eblit
===================================================================
RCS file: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_pretend.eblit,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pkg_pretend.eblit	27 May 2015 13:55:42 -0000	1.1
+++ pkg_pretend.eblit	27 May 2015 14:02:58 -0000	1.2
@@ -1,6 +1,49 @@
 # Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_pretend.eblit,v 1.1 2015/05/27 13:55:42 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_pretend.eblit,v 1.2 2015/05/27 14:02:58 vapier Exp $
+
+glibc_compile_test() {
+	local ret save_cflags=${CFLAGS}
+	CFLAGS+=" $1"
+	shift
+
+	pushd "${T}" >/dev/null
+
+	rm -f glibc-test*
+	printf '%b' "$*" > glibc-test.c
+
+	_nonfatal emake -s glibc-test
+	ret=$?
+
+	popd >/dev/null
+
+	CFLAGS=${save_cflags}
+	return ${ret}
+}
+
+glibc_run_test() {
+	local ret
+
+	if [[ ${EMERGE_FROM} == "binary" ]] ; then
+		# ignore build failures when installing a binary package #324685
+		glibc_compile_test "" "$@" 2>/dev/null || return 0
+	else
+		if ! glibc_compile_test "" "$@" ; then
+			ewarn "Simple build failed ... assuming this is desired #324685"
+			return 0
+		fi
+	fi
+
+	pushd "${T}" >/dev/null
+
+	./glibc-test
+	ret=$?
+	rm -f glibc-test*
+
+	popd >/dev/null
+
+	return ${ret}
+}
 
 check_devpts() {
 	# Make sure devpts is mounted correctly for use w/out setuid pt_chown.
@@ -34,4 +77,81 @@
 	if [[ ${EAPI:-0} != [0123] ]] ; then
 		check_devpts
 	fi
+
+	# prevent native builds from downgrading ... maybe update to allow people
+	# to change between diff -r versions ? (2.3.6-r4 -> 2.3.6-r2)
+	if [[ ${MERGE_TYPE} != "buildonly" ]] && \
+	   [[ ${ROOT} == "/" ]] && \
+	   [[ ${CBUILD} == ${CHOST} ]] && \
+	   [[ ${CHOST} == ${CTARGET} ]] ; then
+		if has_version '>'${CATEGORY}/${PF} ; then
+			eerror "Sanity check to keep you from breaking your system:"
+			eerror " Downgrading glibc is not supported and a sure way to destruction"
+			die "aborting to save your system"
+		fi
+
+		if ! glibc_run_test '#include <pwd.h>\nint main(){return getpwuid(0)==0;}\n'
+		then
+			eerror "Your patched vendor kernel is broken.  You need to get an"
+			eerror "update from whoever is providing the kernel to you."
+			eerror "http://sourceware.org/bugzilla/show_bug.cgi?id=5227"
+			eerror "http://bugs.gentoo.org/262698"
+			die "keeping your system alive, say thank you"
+		fi
+
+		if ! glibc_run_test '#include <unistd.h>\n#include <sys/syscall.h>\nint main(){return syscall(1000)!=-1;}\n'
+		then
+			eerror "Your old kernel is broken.  You need to update it to"
+			eerror "a newer version as syscall(<bignum>) will break."
+			eerror "http://bugs.gentoo.org/279260"
+			die "keeping your system alive, say thank you"
+		fi
+	fi
+
+	# users have had a chance to phase themselves, time to give em the boot
+	if [[ -e ${EROOT}/etc/locale.gen ]] && [[ -e ${EROOT}/etc/locales.build ]] ; then
+		eerror "You still haven't deleted ${EROOT}/etc/locales.build."
+		eerror "Do so now after making sure ${EROOT}/etc/locale.gen is kosher."
+		die "lazy upgrader detected"
+	fi
+
+	if [[ ${CTARGET} == i386-* ]] ; then
+		eerror "i386 CHOSTs are no longer supported."
+		eerror "Chances are you don't actually want/need i386."
+		eerror "Please read http://www.gentoo.org/doc/en/change-chost.xml"
+		die "please fix your CHOST"
+	fi
+
+	if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then
+		ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS."
+		ewarn "This will result in a 50% performance penalty when running with a 32bit"
+		ewarn "hypervisor, which is probably not what you want."
+	fi
+
+	use hardened && ! gcc-specs-pie && \
+		ewarn "PIE hardening not applied, as your compiler doesn't default to PIE"
+
+	# Make sure host system is up to date #394453
+	if has_version '<sys-libs/glibc-2.13' && \
+	   [[ -n $(scanelf -qys__guard -F'#s%F' "${EROOT}"/lib*/l*-*.so) ]]
+	then
+		ebegin "Scanning system for __guard to see if you need to rebuild first ..."
+		local files=$(
+			scanelf -qys__guard -F'#s%F' \
+				"${EROOT}"/*bin/ \
+				"${EROOT}"/lib* \
+				"${EROOT}"/usr/*bin/ \
+				"${EROOT}"/usr/lib* | \
+				egrep -v \
+					-e "^${EROOT}/lib.*/(libc|ld)-2.*.so$" \
+					-e "^${EROOT}/sbin/(ldconfig|sln)$"
+		)
+		[[ -z ${files} ]]
+		if ! eend $? ; then
+			eerror "Your system still has old SSP __guard symbols.  You need to"
+			eerror "rebuild all the packages that provide these files first:"
+			eerror "${files}"
+			die "old __guard detected"
+		fi
+	fi
 }



1.15                 sys-libs/glibc/files/eblits/pkg_setup.eblit

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/glibc/files/eblits/pkg_setup.eblit?rev=1.15&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/glibc/files/eblits/pkg_setup.eblit?rev=1.15&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/glibc/files/eblits/pkg_setup.eblit?r1=1.14&r2=1.15

Index: pkg_setup.eblit
===================================================================
RCS file: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_setup.eblit,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- pkg_setup.eblit	17 Oct 2014 17:30:04 -0000	1.14
+++ pkg_setup.eblit	27 May 2015 14:02:58 -0000	1.15
@@ -1,125 +1,9 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_setup.eblit,v 1.14 2014/10/17 17:30:04 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_setup.eblit,v 1.15 2015/05/27 14:02:58 vapier Exp $
 
-glibc_compile_test() {
-	local ret save_cflags=${CFLAGS}
-	CFLAGS+=" $1"
-	shift
-
-	pushd "${T}" >/dev/null
-
-	rm -f glibc-test*
-	printf '%b' "$*" > glibc-test.c
-
-	_nonfatal emake -s glibc-test
-	ret=$?
-
-	popd >/dev/null
-
-	CFLAGS=${save_cflags}
-	return ${ret}
-}
-
-glibc_run_test() {
-	local ret
-
-	if [[ ${EMERGE_FROM} == "binary" ]] ; then
-		# ignore build failures when installing a binary package #324685
-		glibc_compile_test "" "$@" 2>/dev/null || return 0
-	else
-		if ! glibc_compile_test "" "$@" ; then
-			ewarn "Simple build failed ... assuming this is desired #324685"
-			return 0
-		fi
-	fi
-
-	pushd "${T}" >/dev/null
-
-	./glibc-test
-	ret=$?
-	rm -f glibc-test*
-
-	popd >/dev/null
-
-	return ${ret}
-}
+[[ ${EAPI:-0} == [0123] ]] && source "${FILESDIR}/eblits/pkg_pretend.eblit"
 
 eblit-glibc-pkg_setup() {
-	# prevent native builds from downgrading ... maybe update to allow people
-	# to change between diff -r versions ? (2.3.6-r4 -> 2.3.6-r2)
-	if [[ ${MERGE_TYPE} != "buildonly" ]] && \
-	   [[ ${ROOT} == "/" ]] && \
-	   [[ ${CBUILD} == ${CHOST} ]] && \
-	   [[ ${CHOST} == ${CTARGET} ]] ; then
-		if has_version '>'${CATEGORY}/${PF} ; then
-			eerror "Sanity check to keep you from breaking your system:"
-			eerror " Downgrading glibc is not supported and a sure way to destruction"
-			die "aborting to save your system"
-		fi
-
-		if ! glibc_run_test '#include <pwd.h>\nint main(){return getpwuid(0)==0;}\n'
-		then
-			eerror "Your patched vendor kernel is broken.  You need to get an"
-			eerror "update from whoever is providing the kernel to you."
-			eerror "http://sourceware.org/bugzilla/show_bug.cgi?id=5227"
-			eerror "http://bugs.gentoo.org/262698"
-			die "keeping your system alive, say thank you"
-		fi
-
-		if ! glibc_run_test '#include <unistd.h>\n#include <sys/syscall.h>\nint main(){return syscall(1000)!=-1;}\n'
-		then
-			eerror "Your old kernel is broken.  You need to update it to"
-			eerror "a newer version as syscall(<bignum>) will break."
-			eerror "http://bugs.gentoo.org/279260"
-			die "keeping your system alive, say thank you"
-		fi
-	fi
-
-	# users have had a chance to phase themselves, time to give em the boot
-	if [[ -e ${EROOT}/etc/locale.gen ]] && [[ -e ${EROOT}/etc/locales.build ]] ; then
-		eerror "You still haven't deleted ${EROOT}/etc/locales.build."
-		eerror "Do so now after making sure ${EROOT}/etc/locale.gen is kosher."
-		die "lazy upgrader detected"
-	fi
-
-	if [[ ${CTARGET} == i386-* ]] ; then
-		eerror "i386 CHOSTs are no longer supported."
-		eerror "Chances are you don't actually want/need i386."
-		eerror "Please read http://www.gentoo.org/doc/en/change-chost.xml"
-		die "please fix your CHOST"
-	fi
-
-	if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then
-		ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS."
-		ewarn "This will result in a 50% performance penalty when running with a 32bit"
-		ewarn "hypervisor, which is probably not what you want."
-	fi
-
-	use hardened && ! gcc-specs-pie && \
-		ewarn "PIE hardening not applied, as your compiler doesn't default to PIE"
-
-	# Make sure host system is up to date #394453
-	if has_version '<sys-libs/glibc-2.13' && \
-	   [[ -n $(scanelf -qys__guard -F'#s%F' "${EROOT}"/lib*/l*-*.so) ]]
-	then
-		ebegin "Scanning system for __guard to see if you need to rebuild first ..."
-		local files=$(
-			scanelf -qys__guard -F'#s%F' \
-				"${EROOT}"/*bin/ \
-				"${EROOT}"/lib* \
-				"${EROOT}"/usr/*bin/ \
-				"${EROOT}"/usr/lib* | \
-				egrep -v \
-					-e "^${EROOT}/lib.*/(libc|ld)-2.*.so$" \
-					-e "^${EROOT}/sbin/(ldconfig|sln)$"
-		)
-		[[ -z ${files} ]]
-		if ! eend $? ; then
-			eerror "Your system still has old SSP __guard symbols.  You need to"
-			eerror "rebuild all the packages that provide these files first:"
-			eerror "${files}"
-			die "old __guard detected"
-		fi
-	fi
+	[[ ${EAPI:-0} == [0123] ]] && eblit-glibc-pkg_pretend
 }





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-27 14:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-27 14:02 [gentoo-commits] gentoo-x86 commit in sys-libs/glibc/files/eblits: pkg_pretend.eblit pkg_setup.eblit Mike Frysinger (vapier)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox