summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Januszewski <spock@gentoo.org>2009-06-22 21:52:35 +0000
committerMichael Januszewski <spock@gentoo.org>2009-06-22 21:52:35 +0000
commitd4d25c94f78eb8cf5b1fbddf3aafd65285bbd92a (patch)
tree86f47a20cccfb590f88f640d445a0192d803327b /sys-apps
parentAdd missing deps, bug #274581. Move sed from unpack to src_prepare. Make myse... (diff)
downloadgentoo-2-d4d25c94f78eb8cf5b1fbddf3aafd65285bbd92a.tar.gz
gentoo-2-d4d25c94f78eb8cf5b1fbddf3aafd65285bbd92a.tar.bz2
gentoo-2-d4d25c94f78eb8cf5b1fbddf3aafd65285bbd92a.zip
Make fakechroot compatible with glibc 2.10 (bug #274077).
(Portage version: 2.1.6.13/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/fakechroot/ChangeLog6
-rw-r--r--sys-apps/fakechroot/fakechroot-2.9.ebuild11
-rw-r--r--sys-apps/fakechroot/files/fakechroot-2.9-glibc-2.10-compat.patch161
3 files changed, 175 insertions, 3 deletions
diff --git a/sys-apps/fakechroot/ChangeLog b/sys-apps/fakechroot/ChangeLog
index c3e5cfeaac1f..e3b97d75ea72 100644
--- a/sys-apps/fakechroot/ChangeLog
+++ b/sys-apps/fakechroot/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-apps/fakechroot
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/fakechroot/ChangeLog,v 1.6 2009/04/09 09:59:51 spock Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/fakechroot/ChangeLog,v 1.7 2009/06/22 21:52:35 spock Exp $
+
+ 22 Jun 2009; Michał Januszewski <spock@gentoo.org> fakechroot-2.9.ebuild,
+ +files/fakechroot-2.9-glibc-2.10-compat.patch:
+ Make fakechroot compatible with glibc 2.10 (bug #274077).
*fakechroot-2.9 (09 Apr 2009)
diff --git a/sys-apps/fakechroot/fakechroot-2.9.ebuild b/sys-apps/fakechroot/fakechroot-2.9.ebuild
index 4d4b159f89fe..eced437561b2 100644
--- a/sys-apps/fakechroot/fakechroot-2.9.ebuild
+++ b/sys-apps/fakechroot/fakechroot-2.9.ebuild
@@ -1,8 +1,8 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/fakechroot/fakechroot-2.9.ebuild,v 1.1 2009/04/09 09:59:51 spock Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/fakechroot/fakechroot-2.9.ebuild,v 1.2 2009/06/22 21:52:35 spock Exp $
-inherit eutils
+inherit autotools eutils
DESCRIPTION="Provide a faked chroot environment without requiring root privileges"
HOMEPAGE="http://fakechroot.alioth.debian.org/"
@@ -18,6 +18,13 @@ DEPEND=""
RESTRICT="test"
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-glibc-2.10-compat.patch
+ AT_M4DIR="m4" eautoreconf
+}
+
src_install() {
emake DESTDIR="${D}" install || die
dodoc README THANKS
diff --git a/sys-apps/fakechroot/files/fakechroot-2.9-glibc-2.10-compat.patch b/sys-apps/fakechroot/files/fakechroot-2.9-glibc-2.10-compat.patch
new file mode 100644
index 000000000000..36a8ca649286
--- /dev/null
+++ b/sys-apps/fakechroot/files/fakechroot-2.9-glibc-2.10-compat.patch
@@ -0,0 +1,161 @@
+Index: trunk/test/src/test-scandir.c
+===================================================================
+--- trunk/test/src/test-scandir.c (revision 0)
++++ trunk/test/src/test-scandir.c (revision 343)
+@@ -0,0 +1,35 @@
++#define _SVID_SOURCE
++#include <dirent.h>
++#include <stdlib.h>
++#include <stdio.h>
++
++int main (int argc, char *argv[]) {
++ struct dirent **namelist;
++ int i, n;
++
++ if (argc != 3) {
++ fprintf(stderr, "Usage: %s chdir scandir\n", argv[0]);
++ exit(2);
++ }
++
++ if (*argv[1] && chdir(argv[1]) == -1) {
++ perror("chdir");
++ exit(1);
++ }
++
++ n = scandir(argv[2], &namelist, 0, alphasort);
++ if (n < 0) {
++ perror("scandir");
++ exit(1);
++ }
++ else {
++ for (i=0; i<n; i++) {
++ printf("%s\n", namelist[i]->d_name);
++ free(namelist[i]);
++ }
++ free(namelist);
++ }
++
++ return 0;
++}
++
+Index: trunk/test/src/Makefile.am
+===================================================================
+--- trunk/test/src/Makefile.am (revision 341)
++++ trunk/test/src/Makefile.am (revision 343)
+@@ -1 +1 @@
+-check_PROGRAMS = test-chroot
++check_PROGRAMS = test-chroot test-scandir
+Index: trunk/m4/scandir_argtypes.m4
+===================================================================
+--- trunk/m4/scandir_argtypes.m4 (revision 341)
++++ trunk/m4/scandir_argtypes.m4 (revision 343)
+@@ -12,7 +12,7 @@
+ for ac_arg1 in 'const char *dir'; do
+ for ac_arg2 in 'struct dirent ***namelist'; do
+ for ac_arg3 in 'int(*filter)(const struct dirent *)' 'int(*filter)(struct dirent *)'; do
+- for ac_arg4 in 'int(*compar)(const void *,const void *)'; do
++ for ac_arg4 in 'int(*compar)(const void *,const void *)' 'int(*compar)(const struct dirent **, const struct dirent **)'; do
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [AC_INCLUDES_DEFAULT
+Index: trunk/m4/scandir64_argtypes.m4
+===================================================================
+--- trunk/m4/scandir64_argtypes.m4 (revision 0)
++++ trunk/m4/scandir64_argtypes.m4 (revision 343)
+@@ -0,0 +1,48 @@
++dnl AC_FUNC_SCANDIR64_ARGTYPES
++dnl -------------------------
++dnl Determine the correct type to be passed to each of the `scandir64'
++dnl function's arguments, and define those types in `SCANDIR64_TYPE_ARG1',
++dnl `SCANDIR64_TYPE_ARG2', `SCANDIR64_TYPE_ARG3' and `SCANDIR64_TYPE_ARG4'.
++AN_FUNCTION([scandir64], [AC_FUNC_SCANDIR64_ARGTYPES])
++AC_DEFUN([AC_FUNC_SCANDIR64_ARGTYPES],
++[AC_CHECK_HEADERS(dirent.h)
++AC_CACHE_CHECK([types of arguments for scandir64],
++[ac_cv_func_scandir64_args],
++[for ac_return in 'int'; do
++ for ac_arg1 in 'const char *dir'; do
++ for ac_arg2 in 'struct dirent64 ***namelist'; do
++ for ac_arg3 in 'int(*filter)(const struct dirent64 *)' 'int(*filter)(struct dirent64 *)'; do
++ for ac_arg4 in 'int(*compar)(const void *,const void *)' 'int(*compar)(const struct dirent64 **, const struct dirent64 **)'; do
++ AC_COMPILE_IFELSE(
++ [AC_LANG_PROGRAM(
++[AC_INCLUDES_DEFAULT
++#ifdef HAVE_UNISTD_H
++#include <dirent.h>
++#endif
++],
++ [extern $ac_return scandir64 ($ac_arg1, $ac_arg2, $ac_arg3, $ac_arg4);])],
++ [ac_cv_func_scandir64_args="$ac_return;$ac_arg1;$ac_arg2;$ac_arg3;$ac_arg4"; break 5])
++ done
++ done
++ done
++ done
++done
++# Provide a safe default value.
++: ${ac_cv_func_scandir64_args='(default) int;const char *dir;struct dirent64 ***namelist;int(*filter)(const struct dirent64 *);int(*compar)(const void *,const void *)'}
++])
++ac_save_IFS=$IFS; IFS=';'
++set dummy `echo "$ac_cv_func_scandir64_args" | sed 's/^(default) //' | sed 's/\*/\*/g'`
++IFS=$ac_save_IFS
++shift
++AC_DEFINE_UNQUOTED(SCANDIR64_TYPE_RETURN, $[1],
++ [Define to the type of return value for `scandir64'.])
++AC_DEFINE_UNQUOTED(SCANDIR64_TYPE_ARG1, $[2],
++ [Define to the type of arg 1 for `scandir64'.])
++AC_DEFINE_UNQUOTED(SCANDIR64_TYPE_ARG2, $[3],
++ [Define to the type of arg 2 for `scandir64'.])
++AC_DEFINE_UNQUOTED(SCANDIR64_TYPE_ARG3, $[4],
++ [Define to the type of arg 3 for `scandir64'.])
++AC_DEFINE_UNQUOTED(SCANDIR64_TYPE_ARG4, $[5],
++ [Define to the type of arg 4 for `scandir64'.])
++rm -f conftest*
++])
+Index: trunk/configure.ac
+===================================================================
+--- trunk/configure.ac (revision 341)
++++ trunk/configure.ac (revision 343)
+@@ -177,6 +177,7 @@
+
+ AC_FUNC_READLINK_ARGTYPES
+ AC_FUNC_SCANDIR_ARGTYPES
++AC_FUNC_SCANDIR64_ARGTYPES
+
+ AC_CONFIG_FILES([ \
+ Makefile \
+Index: trunk/src/libfakechroot.c
+===================================================================
+--- trunk/src/libfakechroot.c (revision 341)
++++ trunk/src/libfakechroot.c (revision 343)
+@@ -512,10 +512,10 @@
+ #endif
+ static int (*next_rmdir) (const char *pathname) = NULL;
+ #ifdef HAVE_SCANDIR
+-static int (*next_scandir) (const char *dir, struct dirent ***namelist, SCANDIR_TYPE_ARG3, int(*compar)(const void *, const void *)) = NULL;
++static int (*next_scandir) (SCANDIR_TYPE_ARG1, SCANDIR_TYPE_ARG2, SCANDIR_TYPE_ARG3, SCANDIR_TYPE_ARG4) = NULL;
+ #endif
+ #ifdef HAVE_SCANDIR64
+-static int (*next_scandir64) (const char *dir, struct dirent64 ***namelist, int(*filter)(const struct dirent64 *), int(*compar)(const void *, const void *)) = NULL;
++static int (*next_scandir64) (SCANDIR64_TYPE_ARG1, SCANDIR64_TYPE_ARG2, SCANDIR64_TYPE_ARG3, SCANDIR64_TYPE_ARG4) = NULL;
+ #endif
+ #ifdef HAVE_SETXATTR
+ static int (*next_setxattr) (const char *path, const char *name, const void *value, size_t size, int flags) = NULL;
+@@ -2664,7 +2664,7 @@
+
+ #ifdef HAVE_SCANDIR
+ /* #include <dirent.h> */
+-int scandir (const char *dir, struct dirent ***namelist, SCANDIR_TYPE_ARG3, int(*compar)(const void *, const void *))
++int scandir (SCANDIR_TYPE_ARG1, SCANDIR_TYPE_ARG2, SCANDIR_TYPE_ARG3, SCANDIR_TYPE_ARG4)
+ {
+ char *fakechroot_path, *fakechroot_ptr, fakechroot_buf[FAKECHROOT_MAXPATH];
+ expand_chroot_path(dir, fakechroot_path, fakechroot_ptr, fakechroot_buf);
+@@ -2676,7 +2676,7 @@
+
+ #ifdef HAVE_SCANDIR64
+ /* #include <dirent.h> */
+-int scandir64 (const char *dir, struct dirent64 ***namelist, int(*filter)(const struct dirent64 *), int(*compar)(const void *, const void *))
++int scandir64 (SCANDIR64_TYPE_ARG1, SCANDIR64_TYPE_ARG2, SCANDIR64_TYPE_ARG3, SCANDIR64_TYPE_ARG4)
+ {
+ char *fakechroot_path, *fakechroot_ptr, fakechroot_buf[FAKECHROOT_MAXPATH];
+ expand_chroot_path(dir, fakechroot_path, fakechroot_ptr, fakechroot_buf);
+