/[gentoo-x86]/sys-libs/glibc/files/eblits/pkg_setup.eblit
Gentoo

Diff of /sys-libs/glibc/files/eblits/pkg_setup.eblit

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

Revision 1.4 Revision 1.5
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2009 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/sys-libs/glibc/files/eblits/pkg_setup.eblit,v 1.4 2009/08/21 05:46:04 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_setup.eblit,v 1.5 2011/03/09 08:02:57 vapier Exp $
4
5glibc_run_test() {
6 local ret
7
8 pushd "${T}" >/dev/null
9
10 printf '%b' "$*" > glibc-test.c
11
12 if [[ ${EMERGE_FROM} == "binary" ]] ; then
13 # ignore build failures when installing a binary package #324685
14 emake -s glibc-test 2>/dev/null || return 0
15 else
16 if ! emake glibc-test ; then
17 ewarn "Simple build failed ... assuming this is desired #324685"
18 return 0
19 fi
20 fi
21
22 ./glibc-test
23 ret=$?
24 rm -f glibc-test*
25
26 popd >/dev/null
27
28 return $ret
29}
4 30
5eblit-glibc-pkg_setup() { 31eblit-glibc-pkg_setup() {
6 # prevent native builds from downgrading ... maybe update to allow people 32 # prevent native builds from downgrading ... maybe update to allow people
7 # to change between diff -r versions ? (2.3.6-r4 -> 2.3.6-r2) 33 # to change between diff -r versions ? (2.3.6-r4 -> 2.3.6-r2)
8 if [[ ${ROOT} == "/" ]] && [[ ${CBUILD} == ${CHOST} ]] && [[ ${CHOST} == ${CTARGET} ]] ; then 34 if [[ ${ROOT} == "/" ]] && [[ ${CBUILD} == ${CHOST} ]] && [[ ${CHOST} == ${CTARGET} ]] ; then
10 eerror "Sanity check to keep you from breaking your system:" 36 eerror "Sanity check to keep you from breaking your system:"
11 eerror " Downgrading glibc is not supported and a sure way to destruction" 37 eerror " Downgrading glibc is not supported and a sure way to destruction"
12 die "aborting to save your system" 38 die "aborting to save your system"
13 fi 39 fi
14 40
15 # Check for broken kernels #262698
16 cd "${T}"
17 printf '#include <pwd.h>\nint main(){return getpwuid(0)==0;}\n' > kern-clo-test.c 41 if ! glibc_run_test '#include <pwd.h>\nint main(){return getpwuid(0)==0;}\n'
18 emake kern-clo-test || die 42 then
19 if ! ./kern-clo-test ; then
20 eerror "Your patched vendor kernel is broken. You need to get an" 43 eerror "Your patched vendor kernel is broken. You need to get an"
21 eerror "update from whoever is providing the kernel to you." 44 eerror "update from whoever is providing the kernel to you."
22 eerror "http://sourceware.org/bugzilla/show_bug.cgi?id=5227" 45 eerror "http://sourceware.org/bugzilla/show_bug.cgi?id=5227"
46 eerror "http://bugs.gentoo.org/262698"
23 die "keeping your system alive, say thank you" 47 die "keeping your system alive, say thank you"
24 fi 48 fi
25 49
26 # Check for broken kernels #279260
27 cd "${T}"
28 printf '#include <unistd.h>\n#include <sys/syscall.h>\nint main(){return syscall(1000)!=-1;}\n' > kern-enosys-test.c 50 if ! glibc_run_test '#include <unistd.h>\n#include <sys/syscall.h>\nint main(){return syscall(1000)!=-1;}\n'
29 emake kern-enosys-test || die 51 then
30 if ! ./kern-enosys-test ; then
31 eerror "Your old kernel is broken. You need to update it to" 52 eerror "Your old kernel is broken. You need to update it to"
32 eerror "a newer version as syscall(<bignum>) will break." 53 eerror "a newer version as syscall(<bignum>) will break."
33 eerror "http://bugs.gentoo.org/279260" 54 eerror "http://bugs.gentoo.org/279260"
34 die "keeping your system alive, say thank you" 55 die "keeping your system alive, say thank you"
35 fi 56 fi

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.20