diff -Nru fakechroot-2.15/aclocal.m4 fakechroot-2.16/aclocal.m4 --- fakechroot-2.15/aclocal.m4 2011-09-28 20:20:15.000000000 +0000 +++ fakechroot-2.16/aclocal.m4 2011-12-11 12:06:03.000000000 +0000 @@ -846,6 +846,33 @@ fi AC_MSG_RESULT(yes)]) +# Copyright (C) 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# (`yes' being less verbose, `no' or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], +[ --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0')]) +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation diff -Nru fakechroot-2.15/config.h.in fakechroot-2.16/config.h.in --- fakechroot-2.15/config.h.in 2011-09-28 20:20:18.000000000 +0000 +++ fakechroot-2.16/config.h.in 2011-12-11 12:06:06.000000000 +0000 @@ -436,6 +436,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_PWD_H +/* Define to 1 if you have the `rawmemchr' function. */ +#undef HAVE_RAWMEMCHR + /* Define to 1 if you have the `readlink' function. */ #undef HAVE_READLINK @@ -655,6 +658,9 @@ /* Define to 1 if you have the `unlinkat' function. */ #undef HAVE_UNLINKAT +/* Define to 1 if you have the `unsetenv' function. */ +#undef HAVE_UNSETENV + /* Define to 1 if you have the `utime' function. */ #undef HAVE_UTIME diff -Nru fakechroot-2.15/configure fakechroot-2.16/configure --- fakechroot-2.15/configure 2011-09-28 20:20:17.000000000 +0000 +++ fakechroot-2.16/configure 2011-12-11 12:06:05.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for fakechroot 2.15. +# Generated by GNU Autoconf 2.68 for fakechroot 2.16. # # Report bugs to . # @@ -570,8 +570,8 @@ # Identity of this package. PACKAGE_NAME='fakechroot' PACKAGE_TARNAME='fakechroot' -PACKAGE_VERSION='2.15' -PACKAGE_STRING='fakechroot 2.15' +PACKAGE_VERSION='2.16' +PACKAGE_STRING='fakechroot 2.16' PACKAGE_BUGREPORT='dexter@debian.org' PACKAGE_URL='http://fakechroot.alioth.debian.org/' @@ -619,6 +619,7 @@ ALLOCA HAVE_VISIBILITY CFLAG_VISIBILITY +CHROOT SEQ PROVE CPP @@ -663,6 +664,8 @@ MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE +AM_BACKSLASH +AM_DEFAULT_VERBOSITY am__untar am__tar AMTAR @@ -735,6 +738,7 @@ ac_subst_files='' ac_user_opts=' enable_option_checking +enable_silent_rules enable_maintainer_mode enable_static with_libpath @@ -1297,7 +1301,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures fakechroot 2.15 to adapt to many kinds of systems. +\`configure' configures fakechroot 2.16 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1367,7 +1371,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of fakechroot 2.15:";; + short | recursive ) echo "Configuration of fakechroot 2.16:";; esac cat <<\_ACEOF @@ -1375,6 +1379,8 @@ --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0') --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-static[=PKGS] build static libraries [default=no] @@ -1391,7 +1397,7 @@ --with-libpath[=LIBPATH] path list where library might be located [default=$pkglibdir] - --with-pic try to use only PIC/non-PIC objects [default=use + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR @@ -1474,7 +1480,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -fakechroot configure 2.15 +fakechroot configure 2.16 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2007,7 +2013,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by fakechroot $as_me 2.15, which was +It was created by fakechroot $as_me 2.16, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2456,6 +2462,7 @@ + am__api_version='1.11' # Find a good install program. We prefer a C program (faster), @@ -2894,7 +2901,7 @@ # Define the identity of the package. PACKAGE='fakechroot' - VERSION='2.15' + VERSION='2.16' cat >>confdefs.h <<_ACEOF @@ -2934,6 +2941,18 @@ +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=0;; +esac +AM_BACKSLASH='\' + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } @@ -2959,6 +2978,7 @@ + ac_config_headers="$ac_config_headers config.h" ac_ext=c @@ -3064,8 +3084,8 @@ -macro_version='2.4' -macro_revision='1.3293' +macro_version='2.4.2' +macro_revision='1.3337' @@ -4818,6 +4838,11 @@ lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -4857,7 +4882,7 @@ # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do @@ -5286,7 +5311,7 @@ lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -5927,13 +5952,13 @@ if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in @@ -6080,6 +6105,7 @@ # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -6468,7 +6494,7 @@ CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 @@ -6479,7 +6505,20 @@ case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -7119,7 +7158,13 @@ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 @@ -7130,6 +7175,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : @@ -7162,6 +7208,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : @@ -7183,7 +7230,9 @@ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 @@ -7558,7 +7607,22 @@ # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : - withval=$with_pic; pic_mode="$withval" + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac else pic_mode=default fi @@ -7636,6 +7700,10 @@ + + + + test -z "$LN_S" && LN_S="ln -s" @@ -8095,7 +8163,9 @@ case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' - lt_prog_compiler_pic='-Xcompiler -fPIC' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi ;; esac else @@ -8186,18 +8256,33 @@ ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; esac ;; esac @@ -8559,7 +8644,6 @@ hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported @@ -8812,8 +8896,7 @@ xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld='-rpath $libdir' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ @@ -9193,6 +9276,7 @@ # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' @@ -9238,6 +9322,7 @@ hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else whole_archive_flag_spec='' fi @@ -9266,10 +9351,6 @@ hardcode_shlibpath_var=no ;; - freebsd1*) - ld_shlibs=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little @@ -9282,7 +9363,7 @@ ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes @@ -9321,7 +9402,6 @@ fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes @@ -9945,11 +10025,6 @@ - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } @@ -10039,7 +10114,7 @@ case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -10048,7 +10123,7 @@ ;; aix[4-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -10113,7 +10188,7 @@ ;; bsdi[45]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -10252,7 +10327,7 @@ ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -10260,10 +10335,6 @@ shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -10271,7 +10342,7 @@ objformat=`/usr/bin/objformat` else case $host_os in - freebsd[123]*) objformat=aout ;; + freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -10289,7 +10360,7 @@ esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) @@ -10309,7 +10380,7 @@ ;; gnu*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' @@ -10320,7 +10391,7 @@ ;; haiku*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" @@ -10381,7 +10452,7 @@ ;; interix[3-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -10397,7 +10468,7 @@ nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -10434,9 +10505,9 @@ dynamic_linker=no ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -10530,7 +10601,7 @@ ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -10599,7 +10670,7 @@ ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -10624,7 +10695,7 @@ ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -10648,7 +10719,7 @@ sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -10679,7 +10750,7 @@ tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -10689,7 +10760,7 @@ ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -11471,6 +11542,8 @@ + + ac_config_commands="$ac_config_commands libtool" @@ -12241,6 +12314,48 @@ test -n "$SEQ" && break done +# Extract the first word of "chroot", so it can be a program name with args. +set dummy chroot; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_CHROOT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $CHROOT in + [\\/]* | ?:[\\/]*) + ac_cv_path_CHROOT="$CHROOT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="/usr/sbin:/sbin:/usr/bin:/bin:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_CHROOT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_CHROOT" && ac_cv_path_CHROOT="/usr/sbin/chroot" + ;; +esac +fi +CHROOT=$ac_cv_path_CHROOT +if test -n "$CHROOT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHROOT" >&5 +$as_echo "$CHROOT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + # Checks for compilator features @@ -13037,7 +13152,7 @@ # Checks for library functions. -for ac_func in __chk_fail __fxstatat __fxstatat64 __getcwd_chk __getwd_chk __lxstat __lxstat64 __open __open_2 __open64 __open64_2 __openat_2 __openat64_2 __opendir2 __realpath_chk __readlink_chk __readlinkat_chk __statfs __xmknod __xmknodat __xstat __xstat64 _xftw _xftw64 access acct bind bindtextdomain canonicalize_file_name chdir chmod chown chroot connect creat creat64 dlmopen dlopen eaccess euidaccess execl execle execlp execv execve execvp faccessat fchmodat fchownat fopen fopen64 freopen freopen64 fts_children fts_open fts_read ftw ftw64 futimesat get_current_dir_name getcwd getpeername getsockname getwd getxattr glob glob64 glob_pattern_p inotify_add_watch lchmod lchown lckpwdf lgetxattr link linkat listxattr llistxattr lremovexattr lsetxattr lstat lstat64 lutimes mempcpy mkdir mkdirat mkdtemp mknod mknodat mkfifo mkfifoat mkstemp mkstemp64 mktemp nftw nftw64 open open64 openat openat64 opendir pathconf popen readlink readlinkat realpath remove removexattr rename renameat revoke rmdir scandir scandir64 setenv setxattr stat stat64 statfs statfs64 statvfs statvfs64 stpcpy strchrnul symlink symlinkat system tempnam tmpnam truncate truncate64 unlink unlinkat ulckpwdf utime utimensat utimes vfork +for ac_func in __chk_fail __fxstatat __fxstatat64 __getcwd_chk __getwd_chk __lxstat __lxstat64 __open __open_2 __open64 __open64_2 __openat_2 __openat64_2 __opendir2 __realpath_chk __readlink_chk __readlinkat_chk __statfs __xmknod __xmknodat __xstat __xstat64 _xftw _xftw64 access acct bind bindtextdomain canonicalize_file_name chdir chmod chown chroot connect creat creat64 dlmopen dlopen eaccess euidaccess execl execle execlp execv execve execvp faccessat fchmodat fchownat fopen fopen64 freopen freopen64 fts_children fts_open fts_read ftw ftw64 futimesat get_current_dir_name getcwd getpeername getsockname getwd getxattr glob glob64 glob_pattern_p inotify_add_watch lchmod lchown lckpwdf lgetxattr link linkat listxattr llistxattr lremovexattr lsetxattr lstat lstat64 lutimes mempcpy mkdir mkdirat mkdtemp mknod mknodat mkfifo mkfifoat mkstemp mkstemp64 mktemp nftw nftw64 open open64 openat openat64 opendir pathconf popen rawmemchr readlink readlinkat realpath remove removexattr rename renameat revoke rmdir scandir scandir64 setenv setxattr stat stat64 statfs statfs64 statvfs statvfs64 stpcpy strchrnul symlink symlinkat system tempnam tmpnam truncate truncate64 unlink unlinkat unsetenv ulckpwdf utime utimensat utimes vfork do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -15387,7 +15502,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by fakechroot $as_me 2.15, which was +This file was extended by fakechroot $as_me 2.16, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15454,7 +15569,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -fakechroot config.status 2.15 +fakechroot config.status 2.16 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -15591,6 +15706,7 @@ enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' @@ -15673,7 +15789,6 @@ allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' @@ -15729,6 +15844,7 @@ # Quote evaled strings. for var in SHELL \ ECHO \ +PATH_SEPARATOR \ SED \ GREP \ EGREP \ @@ -15779,7 +15895,6 @@ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ -hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ @@ -16580,8 +16695,8 @@ # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -16635,6 +16750,9 @@ # An echo program that protects backslashes. ECHO=$lt_ECHO +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + # The host system. host_alias=$host_alias host=$host @@ -16936,10 +17054,6 @@ # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec -# If ld is used when linking, flag to hardcode \$libdir into a binary -# during linking. This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld - # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator diff -Nru fakechroot-2.15/configure.ac fakechroot-2.16/configure.ac --- fakechroot-2.15/configure.ac 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/configure.ac 2011-12-11 12:05:34.000000000 +0000 @@ -1,9 +1,12 @@ AC_PREREQ(2.64) -AC_INIT([fakechroot], [2.15], [dexter@debian.org], [fakechroot], [http://fakechroot.alioth.debian.org/]) +AC_INIT([fakechroot], [2.16], [dexter@debian.org], [fakechroot], [http://fakechroot.alioth.debian.org/]) AC_CANONICAL_HOST AC_CANONICAL_BUILD -AM_INIT_AUTOMAKE + +AM_INIT_AUTOMAKE([1.10 foreign]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AM_MAINTAINER_MODE + AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([src/libfakechroot.c]) AC_CONFIG_HEADER([config.h]) @@ -32,6 +35,7 @@ AC_PROG_LN_S AC_CHECK_PROGS([PROVE], [prove]) AC_CHECK_PROGS([SEQ], [seq gseq]) +AC_PATH_PROG([CHROOT], [chroot], [/usr/sbin/chroot], [/usr/sbin:/sbin:/usr/bin:/bin:$PATH]) # Checks for compilator features ACX_CHECK_C_ALIGNOF @@ -198,6 +202,7 @@ opendir pathconf popen + rawmemchr readlink readlinkat realpath @@ -228,6 +233,7 @@ truncate64 unlink unlinkat + unsetenv ulckpwdf utime utimensat diff -Nru fakechroot-2.15/debian/changelog fakechroot-2.16/debian/changelog --- fakechroot-2.15/debian/changelog 2011-09-30 12:07:56.000000000 +0000 +++ fakechroot-2.16/debian/changelog 2011-12-11 12:37:48.000000000 +0000 @@ -1,3 +1,12 @@ +fakechroot (2.16-1) unstable; urgency=low + + * New upstream release: + - Library path is added to ld.so.conf. + - Chroot ld.so.conf is added to LD_LIBRARY_PATH. Closes: #476528. + * debootstrap works with default, buildd and minbase variants. + + -- Piotr Roszatycki Sun, 11 Dec 2011 13:30:18 +0100 + fakechroot (2.15-1) unstable; urgency=low * New upstream release: diff -Nru fakechroot-2.15/debian/control fakechroot-2.16/debian/control --- fakechroot-2.15/debian/control 2011-09-29 13:22:00.000000000 +0000 +++ fakechroot-2.16/debian/control 2011-11-20 19:03:00.000000000 +0000 @@ -22,6 +22,7 @@ non-root user account. Package: libfakechroot +Section: libs Architecture: any Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends} diff -Nru fakechroot-2.15/debian/copyright fakechroot-2.16/debian/copyright --- fakechroot-2.15/debian/copyright 2011-09-29 13:22:00.000000000 +0000 +++ fakechroot-2.16/debian/copyright 2011-12-04 18:37:01.000000000 +0000 @@ -46,6 +46,11 @@ Copyright: 1988, 1993 The Regents of the University of California. License: BSD-3-clause +Files: rawmemchr.c +Copyright: 2002 Manuel Novoa III + 2000-2005 Erik Andersen +License: LGPL + Files: realpath.c Copyright: 1996-2010 Free Software Foundation, Inc. License: LGPL diff -Nru fakechroot-2.15/debian/fakechroot.examples fakechroot-2.16/debian/fakechroot.examples --- fakechroot-2.15/debian/fakechroot.examples 2011-09-29 13:22:00.000000000 +0000 +++ fakechroot-2.16/debian/fakechroot.examples 2011-12-04 18:38:55.000000000 +0000 @@ -1,4 +1,6 @@ +scripts/relocatesymlinks.sh scripts/restoremode.sh scripts/savemode.sh test/debootstrap.sh +test/rinse.sh test/testtree.sh diff -Nru fakechroot-2.15/debian/fakechroot.install fakechroot-2.16/debian/fakechroot.install --- fakechroot-2.15/debian/fakechroot.install 2011-09-23 12:24:54.000000000 +0000 +++ fakechroot-2.16/debian/fakechroot.install 2011-12-11 13:49:27.000000000 +0000 @@ -1,2 +1,4 @@ +etc/*/* usr/bin/* +usr/sbin/* usr/share/man/man*/* diff -Nru fakechroot-2.15/debian/fakechroot.lintian-overrides fakechroot-2.16/debian/fakechroot.lintian-overrides --- fakechroot-2.15/debian/fakechroot.lintian-overrides 2011-09-29 13:22:00.000000000 +0000 +++ fakechroot-2.16/debian/fakechroot.lintian-overrides 2011-12-11 13:53:28.000000000 +0000 @@ -1 +1,2 @@ binary-without-manpage usr/bin/ldd.fakechroot +binary-without-manpage usr/sbin/chroot.fakechroot diff -Nru fakechroot-2.15/debian/libfakechroot.dirs fakechroot-2.16/debian/libfakechroot.dirs --- fakechroot-2.15/debian/libfakechroot.dirs 1970-01-01 00:00:00.000000000 +0000 +++ fakechroot-2.16/debian/libfakechroot.dirs 2011-12-04 18:42:10.000000000 +0000 @@ -0,0 +1 @@ +/etc/ld.so.conf.d diff -Nru fakechroot-2.15/debian/libfakechroot.lintian-overrides fakechroot-2.16/debian/libfakechroot.lintian-overrides --- fakechroot-2.15/debian/libfakechroot.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ fakechroot-2.16/debian/libfakechroot.lintian-overrides 2011-12-11 13:49:27.000000000 +0000 @@ -0,0 +1,3 @@ +package-modifies-ld.so-search-path *.conf +postinst-has-useless-call-to-ldconfig +postrm-has-useless-call-to-ldconfig diff -Nru fakechroot-2.15/debian/libfakechroot.postinst fakechroot-2.16/debian/libfakechroot.postinst --- fakechroot-2.15/debian/libfakechroot.postinst 1970-01-01 00:00:00.000000000 +0000 +++ fakechroot-2.16/debian/libfakechroot.postinst 2011-12-11 13:49:27.000000000 +0000 @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +if [ "$1" = "configure" ]; then + ldconfig +fi + +#DEBHELPER# diff -Nru fakechroot-2.15/debian/libfakechroot.postrm fakechroot-2.16/debian/libfakechroot.postrm --- fakechroot-2.15/debian/libfakechroot.postrm 1970-01-01 00:00:00.000000000 +0000 +++ fakechroot-2.16/debian/libfakechroot.postrm 2011-12-11 13:49:27.000000000 +0000 @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +if [ "$1" = "remove" ]; then + ldconfig +fi + +#DEBHELPER# diff -Nru fakechroot-2.15/debian/rules fakechroot-2.16/debian/rules --- fakechroot-2.15/debian/rules 2011-09-26 12:54:07.000000000 +0000 +++ fakechroot-2.16/debian/rules 2011-12-04 19:34:41.000000000 +0000 @@ -1,7 +1,14 @@ #!/usr/bin/make -f +DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) + %: dh $@ --parallel override_dh_auto_configure: - dh_auto_configure -- --with-libpath='/usr/lib/*/fakechroot' + dh_auto_configure -- --enable-dependency-tracking --with-libpath=no + +override_dh_auto_install: + dh_auto_install + echo /usr/lib/$(DEB_HOST_MULTIARCH)/fakechroot > debian/libfakechroot/etc/ld.so.conf.d/fakechroot-$(DEB_HOST_MULTIARCH).conf + diff -Nru fakechroot-2.15/debian/source/lintian-overrides fakechroot-2.16/debian/source/lintian-overrides --- fakechroot-2.15/debian/source/lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ fakechroot-2.16/debian/source/lintian-overrides 2011-11-20 18:57:16.000000000 +0000 @@ -0,0 +1 @@ +package-needs-versioned-debhelper-build-depends 9 diff -Nru fakechroot-2.15/debian/source.lintian-overrides fakechroot-2.16/debian/source.lintian-overrides --- fakechroot-2.15/debian/source.lintian-overrides 2011-09-29 13:22:00.000000000 +0000 +++ fakechroot-2.16/debian/source.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -package-needs-versioned-debhelper-build-depends 9 diff -Nru fakechroot-2.15/ltmain.sh fakechroot-2.16/ltmain.sh --- fakechroot-2.15/ltmain.sh 2011-09-28 20:20:10.000000000 +0000 +++ fakechroot-2.16/ltmain.sh 2011-12-11 12:05:58.000000000 +0000 @@ -1,9 +1,9 @@ -# libtool (GNU libtool) 2.4 +# libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -41,6 +41,7 @@ # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) +# --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages @@ -69,7 +70,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4 Debian-2.4-4 +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1 # automake: $automake_version # autoconf: $autoconf_version # @@ -79,9 +80,9 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4 Debian-2.4-4" +VERSION="2.4.2 Debian-2.4.2-1" TIMESTAMP="" -package_revision=1.3293 +package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then @@ -136,15 +137,10 @@ : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} -: ${EGREP="/bin/grep -E"} -: ${FGREP="/bin/grep -F"} -: ${GREP="/bin/grep"} -: ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} -: ${SED="/bin/sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} @@ -387,7 +383,7 @@ ;; *) save_IFS="$IFS" - IFS=: + IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break @@ -771,8 +767,8 @@ s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } @@ -1052,6 +1048,7 @@ opt_help=false opt_help_all=false opt_silent=: +opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false @@ -1120,6 +1117,10 @@ opt_silent=false func_append preserve_args " $opt" ;; + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" @@ -2059,7 +2060,7 @@ *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; @@ -3201,11 +3202,13 @@ # Set up the ranlib parameters. oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $oldlib" 'exit $?' + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. @@ -3470,7 +3473,7 @@ # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; @@ -3982,14 +3985,17 @@ # launches target application with the remaining arguments. func_exec_program () { - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac func_exec_program_core \${1+\"\$@\"} } @@ -5057,9 +5063,15 @@ { EOF func_emit_wrapper yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' - + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' cat <<"EOF" } EOF @@ -5643,7 +5655,8 @@ continue ;; - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" @@ -6150,7 +6163,8 @@ lib= found=no case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" @@ -6834,7 +6848,7 @@ test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" + add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in @@ -7319,6 +7333,7 @@ # which has an extra 1 added just for fun # case $version_type in + # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result @@ -7438,7 +7453,7 @@ versuffix="$major.$revision" ;; - linux) + linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" @@ -8026,6 +8041,11 @@ # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= @@ -8056,7 +8076,7 @@ elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) func_apped perm_rpath " $libdir" ;; + *) func_append perm_rpath " $libdir" ;; esac fi done @@ -8064,11 +8084,7 @@ if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. @@ -9158,6 +9174,8 @@ esac done fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" @@ -9267,7 +9285,8 @@ *.la) func_basename "$deplib" name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + func_resolve_sysroot "$deplib" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" diff -Nru fakechroot-2.15/m4/libtool.m4 fakechroot-2.16/m4/libtool.m4 --- fakechroot-2.15/m4/libtool.m4 2011-09-28 20:20:10.000000000 +0000 +++ fakechroot-2.16/m4/libtool.m4 2011-12-11 12:05:58.000000000 +0000 @@ -1,8 +1,8 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -11,8 +11,8 @@ m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -146,6 +146,8 @@ AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl @@ -637,7 +639,7 @@ m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -801,6 +803,7 @@ m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], @@ -822,6 +825,31 @@ ])# _LT_LANG +m4_ifndef([AC_PROG_GO], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], @@ -852,6 +880,10 @@ m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) @@ -954,7 +986,13 @@ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -962,6 +1000,7 @@ rm -rf libconftest.dylib* rm -f conftest.* fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no @@ -973,6 +1012,7 @@ [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF @@ -990,7 +1030,9 @@ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1035,8 +1077,8 @@ ]) -# _LT_DARWIN_LINKER_FEATURES -# -------------------------- +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ @@ -1047,6 +1089,8 @@ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi @@ -1330,14 +1374,27 @@ CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -1414,13 +1471,13 @@ if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in @@ -1600,6 +1657,11 @@ lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -1639,7 +1701,7 @@ # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do @@ -2185,7 +2247,7 @@ case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -2194,7 +2256,7 @@ ;; aix[[4-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -2259,7 +2321,7 @@ ;; bsdi[[45]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -2398,7 +2460,7 @@ ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -2406,10 +2468,6 @@ shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -2417,7 +2475,7 @@ objformat=`/usr/bin/objformat` else case $host_os in - freebsd[[123]]*) objformat=aout ;; + freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -2435,7 +2493,7 @@ esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) @@ -2455,7 +2513,7 @@ ;; gnu*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' @@ -2466,7 +2524,7 @@ ;; haiku*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" @@ -2527,7 +2585,7 @@ ;; interix[[3-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -2543,7 +2601,7 @@ nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -2580,9 +2638,9 @@ dynamic_linker=no ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2657,7 +2715,7 @@ ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -2726,7 +2784,7 @@ ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2751,7 +2809,7 @@ ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -2775,7 +2833,7 @@ sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -2806,7 +2864,7 @@ tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2816,7 +2874,7 @@ ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -3238,7 +3296,7 @@ lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -3658,6 +3716,7 @@ # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -4242,7 +4301,9 @@ case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi ;; esac else @@ -4334,18 +4395,33 @@ ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; esac ;; esac @@ -4505,7 +4581,9 @@ ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) ;; + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] @@ -4533,7 +4611,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -4787,8 +4864,7 @@ xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ @@ -5084,6 +5160,7 @@ # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' @@ -5130,10 +5207,6 @@ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; - freebsd1*) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little @@ -5146,7 +5219,7 @@ ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes @@ -5185,7 +5258,6 @@ fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes @@ -5627,9 +5699,6 @@ _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], - [[If ld is used when linking, flag to hardcode $libdir into a binary - during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], @@ -5787,7 +5856,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -6157,7 +6225,7 @@ esac ;; - freebsd[[12]]*) + freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no @@ -6918,12 +6986,18 @@ } }; _LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary @@ -7120,7 +7194,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -7253,7 +7326,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -7440,6 +7512,77 @@ ])# _LT_LANG_GCJ_CONFIG +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler @@ -7509,6 +7652,13 @@ dnl AC_DEFUN([LT_AC_PROG_GCJ], []) +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], diff -Nru fakechroot-2.15/m4/ltoptions.m4 fakechroot-2.16/m4/ltoptions.m4 --- fakechroot-2.15/m4/ltoptions.m4 2011-09-28 20:20:10.000000000 +0000 +++ fakechroot-2.16/m4/ltoptions.m4 2011-12-11 12:05:59.000000000 +0000 @@ -326,9 +326,24 @@ # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) diff -Nru fakechroot-2.15/m4/ltversion.m4 fakechroot-2.16/m4/ltversion.m4 --- fakechroot-2.15/m4/ltversion.m4 2011-09-28 20:20:11.000000000 +0000 +++ fakechroot-2.16/m4/ltversion.m4 2011-12-11 12:05:59.000000000 +0000 @@ -9,15 +9,15 @@ # @configure_input@ -# serial 3293 ltversion.m4 +# serial 3337 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4]) -m4_define([LT_PACKAGE_REVISION], [1.3293]) +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4' -macro_revision='1.3293' +[macro_version='2.4.2' +macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff -Nru fakechroot-2.15/makedist.sh fakechroot-2.16/makedist.sh --- fakechroot-2.15/makedist.sh 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/makedist.sh 2011-12-11 12:05:34.000000000 +0000 @@ -2,4 +2,10 @@ ./autogen.sh ./configure + +( cd man && make fakechroot.1 ) + +pod2readme man/fakechroot.pod README +rm -f README.bak + make dist diff -Nru fakechroot-2.15/Makefile.am fakechroot-2.16/Makefile.am --- fakechroot-2.15/Makefile.am 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/Makefile.am 2011-12-11 12:05:34.000000000 +0000 @@ -6,6 +6,6 @@ EXTRA_DIST = LICENSE NEWS README THANKS autogen.sh makedist.sh test: all - $(MAKE) $(AM_MAKEFLAGS) -C test test + ( cd test && $(MAKE) $(AM_MAKEFLAGS) test ) .PHONY: test diff -Nru fakechroot-2.15/Makefile.in fakechroot-2.16/Makefile.in --- fakechroot-2.15/Makefile.in 2011-09-28 20:20:20.000000000 +0000 +++ fakechroot-2.16/Makefile.in 2011-12-11 12:06:08.000000000 +0000 @@ -60,6 +60,12 @@ CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -116,6 +122,7 @@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -125,6 +132,7 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHROOT = @CHROOT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -733,7 +741,7 @@ test: all - $(MAKE) $(AM_MAKEFLAGS) -C test test + ( cd test && $(MAKE) $(AM_MAKEFLAGS) test ) .PHONY: test diff -Nru fakechroot-2.15/man/fakechroot.1 fakechroot-2.16/man/fakechroot.1 --- fakechroot-2.15/man/fakechroot.1 2011-09-28 20:20:53.000000000 +0000 +++ fakechroot-2.16/man/fakechroot.1 2011-12-11 12:06:41.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "FAKECHROOT 1" -.TH FAKECHROOT 1 "21 Sep 2011" "Debian" " " +.TH FAKECHROOT 1 "27 Nov 2011" "Debian" " " .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -136,8 +136,16 @@ \&\fBfakechroot\fR [\fB\-s\fR|\fB\-\-use\-system\-libs\fR] [\fB\-l\fR|\fB\-\-lib\fR\ \fIlibrary\fR] +[\fB\-e\fR|\fB\-\-environment\fR\ \fItype\fR] +[\fB\-c\fR|\fB\-\-config\-dir\fR\ \fIdirectory\fR] [\fB\-\-\fR] [\fIcommand\fR] +.PP +\&\fBfakechroot\fR +[\fB\-h\fR|\fB\-\-help\fR] +.PP +\&\fBfakechroot\fR +[\fB\-v\fR|\fB\-\-version\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" fakechroot runs a command in an environment were is additional possibility to @@ -149,11 +157,11 @@ that simulate the effect the real library functions would have had, had the user really been in chroot. These wrapper functions are in a shared library \&\fI/usr/lib/fakechroot/libfakechroot.so\fR which is loaded through the -\&\fB\s-1LD_PRELOAD\s0\fR mechanism of the dynamic loader. (See \fIld.so\fR\|(8)) +\&\f(CW\*(C`LD_PRELOAD\*(C'\fR mechanism of the dynamic loader. (See \fIld.so\fR\|(8)) .PP -In fake chroot you can install Debian bootstrap with `debootstrap -\&\-\-variant=fakechroot' command. In this environment you can use i.e. -\&\fIapt\-get\fR\|(8) command to install another packages from common user's account. +In fake chroot you can install Debian bootstrap with \fIdebootstrap\fR\|(8) +command. In this environment you can use i.e. \fIapt\-get\fR\|(8) command to install +another packages from common user's account. .PP In the current version, the fakechroot does not provide the \fIfakeroot\fR\|(1) functionality! You might to call fakechroot with fakeroot command, if you @@ -186,6 +194,28 @@ \& $ fakechroot /usr/sbin/chroot /tmp/centos4 /bin/true \& Segmentation fault .Ve +.IP "\fB\-e\fR|\fB\-\-environment\fR \fItype\fR" 4 +.IX Item "-e|--environment type" +Load additional confguration with environment. This configuration file +is a shell script which is executed before calling \fIcommand\fR. The +script can set additional environment variables, like i.e.: +\&\f(CW\*(C`FAKECHROOT_EXCLUDE_PATH\*(C'\fR or \f(CW\*(C`FAKECHROOT_CMD_SUBST\*(C'\fR. The variable +\&\f(CW\*(C`paths\*(C'\fR should be used instead \f(CW\*(C`LD_LIBRARY_PATH\*(C'\fR and variable \f(CW\*(C`lib\*(C'\fR +should be used instead \f(CW\*(C`LD_PRELOAD\*(C'\fR. +.Sp +The environment type is guessed based on command name with optional extension +removed (i.e.: \fI.sh\fR). If \fIcommand\fR argument is \fIfakeroot\fR\|(1) this argument +is ommited and next argument is taken as environment type. +.Sp +The configuration file name is \fI\fItype\fI.env\fR and can be located at +\&\fI\f(CI$HOME\fI/.fakechroot\fR and \fI/etc/fakechroot\fR directories. +.Sp +The default environment type is \fBdefault\fR and its configuration file name is +\&\f(CW\*(C`default.env\*(C'\fR. +.IP "\fB\-c\fR|\fB\-\-config\-dir\fR \fIdirectory\fR" 4 +.IX Item "-c|--config-dir directory" +Specify a directory which contains additional configuraton for fakechroot. The +default directory are \f(CW\*(C`$HOME/.fakechroot\*(C'\fR and \f(CW\*(C`/etc/fakechroot\*(C'\fR. .IP "[\fB\-\-\fR] \fIcommand\fR" 4 .IX Item "[--] command" Any command you want to be ran as fakechroot. Use '\fB\-\-\fR' if in the command @@ -200,15 +230,11 @@ .IX Header "EXAMPLES" An example session with fakechroot: .PP -.Vb 6 -\& $ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin -\& :/bin:/usr/bin/X11 -\& $ export FAKECHROOT_CMD_SUBST=/sbin/insserv=/bin/true:/sbin/ldconfig= -\& /bin/true:/usr/bin/ischroot=/bin/true:/usr/bin/ldd=/usr/bin/ldd.fakec -\& hroot:/usr/bin/mkfifo=/bin/true -\& $ fakechroot fakeroot debootstrap \-\-variant=fakechroot sid /tmp/sid +.Vb 2 +\& $ export PATH=/usr/sbin:/sbin:$PATH +\& $ fakechroot fakeroot debootstrap sid /tmp/sid \& -\& $ fakechroot fakeroot chroot /tmp/sid /bin/bash +\& $ fakechroot fakeroot chroot /tmp/sid \& # cd / \& # echo deb http://ftp.debian.org/debian sid main contrib non\-free > \& /etc/apt/sources.list @@ -219,7 +245,7 @@ \& # adduser \-\-uid 1001 user \& # exit \& -\& $ fakechroot chroot /tmp/sid /bin/bash +\& $ fakechroot chroot /tmp/sid \& $ cd /tmp \& $ apt\-get source hello \& $ cd hello\-* @@ -260,6 +286,16 @@ .IP "\fB\s-1FAKECHROOT_BASE\s0\fR" 4 .IX Item "FAKECHROOT_BASE" The root directory for fake chroot environment. +.IP "\fB\s-1FAKECHROOT_DETECT\s0\fR" 4 +.IX Item "FAKECHROOT_DETECT" +If this variable is set then \f(CW\*(C`fakechroot \f(CIversion\f(CW\*(C'\fR string is printed +to standard output and current process is terminated with status from +this variable. It can be a method to check if fakechroot is preloaded +correctly. +.Sp +.Vb 1 +\& $ case "\`FAKECHROOT_DETECT=1 /bin/echo\`" in fakechroot*) echo LOADED;; esac +.Ve .IP "\fB\s-1FAKECHROOT_DEBUG\s0\fR" 4 .IX Item "FAKECHROOT_DEBUG" The fakechroot library will dump some debugging info is this variable is set. @@ -275,8 +311,14 @@ .IP "\fB\s-1FAKECHROOT_CMD_SUBST\s0\fR" 4 .IX Item "FAKECHROOT_CMD_SUBST" A list of command substitutions. If a program tries to execute one of -the commands given (path relative to the chroot) then the substitute -command runs instead (path to substitute command is not chrooted). +the commands given (path relative to the chroot, trailing dot is removed) then +the substitute command runs instead (path to substitute command is not +chrooted). +.Sp +The substituted command inherits \f(CW\*(C`FAKECHROOT_*\*(C'\fR variables but the original +\&\f(CW\*(C`FAKECHROOT_BASE\*(C'\fR variable which is saved as \f(CW\*(C`FAKECHROOT_BASE_ORIG\*(C'\fR. It +means that substituted command runs outside fakechroot environment. Also +original command name is saved as \f(CW\*(C`FAKECHROOT_CMD_ORIG\*(C'\fR. .Sp For example: .Sp @@ -293,29 +335,34 @@ It is suggested to substitute at least: .RS 4 .IP "\(bu" 2 -/sbin/insserv=/bin/true +\&\f(CW\*(C`/bin/mount=/bin/true\*(C'\fR .IP "\(bu" 2 -/sbin/ldconfig=/bin/ldconfig +\&\f(CW\*(C`/sbin/insserv=/bin/true\*(C'\fR .IP "\(bu" 2 -/usr/bin/ischroot=/bin/true +\&\f(CW\*(C`/sbin/ldconfig=/bin/ldconfig\*(C'\fR .IP "\(bu" 2 -/usr/bin/ldd=/usr/bin/ldd.fakechroot +\&\f(CW\*(C`/usr/bin/ischroot=/bin/true\*(C'\fR .IP "\(bu" 2 -/usr/bin/mkfifo=/bin/true +\&\f(CW\*(C`/usr/bin/ldd=/usr/bin/ldd.fakechroot\*(C'\fR +.IP "\(bu" 2 +\&\f(CW\*(C`/usr/bin/mkfifo=/bin/true\*(C'\fR .RE .RS 4 .Sp to make \fIdebootstrap\fR\|(8) working correctly. +.Sp +To prevent some looping, the command substitution is done only if +\&\f(CW\*(C`FAKECHROOT_CMD_ORIG\*(C'\fR variable is not set currently. .RE .IP "\fB\s-1LD_LIBRARY_PATH\s0\fR, \fB\s-1LD_PRELOAD\s0\fR" 4 .IX Item "LD_LIBRARY_PATH, LD_PRELOAD" Fakechroot is implemented by wrapping system calls. This is accomplished by -setting LD_LIBRARY_PATH=/usr/lib/fakechroot and +setting \f(CW\*(C`LD_LIBRARY_PATH=/usr/lib/fakechroot\*(C'\fR and LD_PRELOAD=libfakechroot.so. That library is loaded before the system's C library, and so most of the library functions are intercepted by it. If you need to set either \fB\s-1LD_LIBRARY_PATH\s0\fR or \fB\s-1LD_PRELOAD\s0\fR from within a fakechroot environment, it should be set relative to the given paths, as in -LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/foo/bar/ +\&\f(CW\*(C`LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/foo/bar/\*(C'\fR .SH "LIMITATIONS" .IX Header "LIMITATIONS" .IP "o" 4 @@ -345,9 +392,9 @@ .IP "o" 4 .IX Item "o" \&\fIldd\fR\|(1) also doesn't work. You have to use \f(CW\*(C`alias -ldd=\*(AqLD_TRACE_LOADED_OBJECTS=1\*(Aq\*(C'\fR or to use a wrapper instead. The example -wrapper is available at \fIscripts/\fR directory in fakechroot's source package -and it is located at \fI/usr/share/doc/fakechroot/examples\fR directory. +ldd=\*(AqLD_TRACE_LOADED_OBJECTS=1\*(Aq\*(C'\fR or to use a wrapper instead. The wrapper is +installed as \fIldd.fakechroot\fR and can be used with \f(CW\*(C`FAKECHROOT_CMD_SUBST\*(C'\fR +environment variable. .IP "o" 4 .IX Item "o" The full screen applications hangs up if \fI/dev/tty\fR file is not a real @@ -355,7 +402,7 @@ remove it from fake chroot environment. .IP "o" 4 .IX Item "o" -\&\fIlckpwdf()\fR and \fIulckpwdf()\fR are ignored so \fIpasswd\fR\|(1) command should work +\&\fIlckpwdf\fR\|(3) and \fIulckpwdf\fR\|(3) are ignored so \fIpasswd\fR\|(1) command should work .IP "o" 4 .IX Item "o" Your real uid should exist in \fI/etc/passwd\fR. Create it with adduser \-\-uid @@ -364,6 +411,27 @@ .IX Item "o" \&\fIdebuild\fR\|(1) cleans environment. Use \-\-preserve\-env option to prevent this behaviour. +.IP "o" 4 +.IX Item "o" +\&\fIrpmbuild\fR\|(8) uses own \fIglob\fR\|(3) implementation which breaks fakechroot so +buildroot directory have to be the same inside and outside fakechroot. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +\&\fIfakeroot\fR\|(1), \fIdebuild\fR\|(1), \fIdebootstrap\fR\|(8), \fIfebootstrap\fR\|(8), +http://fakechroot.alioth.debian.org/ +.SH "BUGS" +.IX Header "BUGS" +If you find the bug or want to implement new features, please report it at + +.SH "AUTHORS" +.IX Header "AUTHORS" +Copyright (c) 2003, 2005, 2007\-2011 Piotr Roszatycki +.PP +Copyright (c) 2007 Mark Eichin +.PP +Copyright (c) 2006, 2007 Alexander Shishkin +.PP +Copyright (c) 2006, 2007 Lionel Tricon .SH "COPYING" .IX Header "COPYING" fakechroot is distributed under the \s-1GNU\s0 Lesser General Public License (\s-1LGPL\s0 @@ -402,6 +470,10 @@ popen function taken from OpenBSD. Copyright (c) 1988, 1993 The Regents of the University of California. .IP "\(bu" 2 +rawmemchr function taken from uClibc +Copyright (C) 2002 Manuel Novoa \s-1III\s0 +Copyright (C) 2000\-2005 Erik Andersen +.IP "\(bu" 2 realpath function taken from Gnulib. Copyright (c) 1996\-2010 Free Software Foundation, Inc. .IP "\(bu" 2 @@ -414,16 +486,3 @@ .IP "\(bu" 2 strchrnul function taken from Gnulib. Copyright (C) 2003, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. -.SH "AUTHORS" -.IX Header "AUTHORS" -Copyright (c) 2003, 2005, 2007\-2011 Piotr Roszatycki -.PP -Copyright (c) 2007 Mark Eichin -.PP -Copyright (c) 2006, 2007 Alexander Shishkin -.PP -Copyright (c) 2006, 2007 Lionel Tricon -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIfakeroot\fR\|(1), \fIdebuild\fR\|(1), \fIdebootstrap\fR\|(8), \fIfebootstrap\fR\|(8), -http://fakechroot.alioth.debian.org/ diff -Nru fakechroot-2.15/man/fakechroot.pod fakechroot-2.16/man/fakechroot.pod --- fakechroot-2.15/man/fakechroot.pod 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/man/fakechroot.pod 2011-12-11 12:05:34.000000000 +0000 @@ -1,5 +1,6 @@ -# pod2man --section=1 --release="Debian" --center=" " --date="21 Sep 2011" +# pod2man --section=1 --release="Debian" --center=" " --date="27 Nov 2011" # + =head1 NAME fakechroot - gives a fake chroot environment @@ -9,9 +10,17 @@ B S<[B<-s>|B<--use-system-libs>]> S<[B<-l>|B<--lib> I]> +S<[B<-e>|B<--environment> I]> +S<[B<-c>|B<--config-dir> I]> S<[B<-->]> S<[I]> +B +S<[B<-h>|B<--help>]> + +B +S<[B<-v>|B<--version>]> + =head1 DESCRIPTION fakechroot runs a command in an environment were is additional possibility to @@ -23,11 +32,11 @@ that simulate the effect the real library functions would have had, had the user really been in chroot. These wrapper functions are in a shared library F which is loaded through the -B mechanism of the dynamic loader. (See ld.so(8)) +C mechanism of the dynamic loader. (See ld.so(8)) -In fake chroot you can install Debian bootstrap with `debootstrap ---variant=fakechroot' command. In this environment you can use i.e. -apt-get(8) command to install another packages from common user's account. +In fake chroot you can install Debian bootstrap with debootstrap(8) +command. In this environment you can use i.e. apt-get(8) command to install +another packages from common user's account. In the current version, the fakechroot does not provide the fakeroot(1) functionality! You might to call fakechroot with fakeroot command, if you @@ -37,6 +46,8 @@ # id uid=0(root) gid=0(root) groups=0(root) +=for readme stop + =head1 OPTIONS =over @@ -61,6 +72,30 @@ $ fakechroot /usr/sbin/chroot /tmp/centos4 /bin/true Segmentation fault +=item B<-e>|B<--environment> I + +Load additional confguration with environment. This configuration file +is a shell script which is executed before calling I. The +script can set additional environment variables, like i.e.: +C or C. The variable +C should be used instead C and variable C +should be used instead C. + +The environment type is guessed based on command name with optional extension +removed (i.e.: F<.sh>). If I argument is fakeroot(1) this argument +is ommited and next argument is taken as environment type. + +The configuration file name is F.env> and can be located at +F<$HOME/.fakechroot> and F directories. + +The default environment type is B and its configuration file name is +C. + +=item B<-c>|B<--config-dir> I + +Specify a directory which contains additional configuraton for fakechroot. The +default directory are C<$HOME/.fakechroot> and C. + =item [B<-->] I Any command you want to be ran as fakechroot. Use 'B<-->' if in the command @@ -80,14 +115,10 @@ An example session with fakechroot: - $ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin - :/bin:/usr/bin/X11 - $ export FAKECHROOT_CMD_SUBST=/sbin/insserv=/bin/true:/sbin/ldconfig= - /bin/true:/usr/bin/ischroot=/bin/true:/usr/bin/ldd=/usr/bin/ldd.fakec - hroot:/usr/bin/mkfifo=/bin/true - $ fakechroot fakeroot debootstrap --variant=fakechroot sid /tmp/sid + $ export PATH=/usr/sbin:/sbin:$PATH + $ fakechroot fakeroot debootstrap sid /tmp/sid - $ fakechroot fakeroot chroot /tmp/sid /bin/bash + $ fakechroot fakeroot chroot /tmp/sid # cd / # echo deb http://ftp.debian.org/debian sid main contrib non-free > /etc/apt/sources.list @@ -98,7 +129,7 @@ # adduser --uid 1001 user # exit - $ fakechroot chroot /tmp/sid /bin/bash + $ fakechroot chroot /tmp/sid $ cd /tmp $ apt-get source hello $ cd hello-* @@ -114,6 +145,8 @@ $ fakechroot fakeroot chroot /tmp/sid /bin/mknod /tmp/device c 1 2 +=for readme continue + =head1 SECURITY ASPECTS fakechroot is a regular, non-setuid program. It does not enhance a user's @@ -123,6 +156,8 @@ separating (sandboxing) applications. It is very easy to escape from a fake chroot environment. +=for readme stop + =head1 FILES =over @@ -149,6 +184,15 @@ The root directory for fake chroot environment. +=item B + +If this variable is set then C> string is printed +to standard output and current process is terminated with status from +this variable. It can be a method to check if fakechroot is preloaded +correctly. + + $ case "`FAKECHROOT_DETECT=1 /bin/echo`" in fakechroot*) echo LOADED;; esac + =item B The fakechroot library will dump some debugging info is this variable is set. @@ -167,8 +211,14 @@ =item B A list of command substitutions. If a program tries to execute one of -the commands given (path relative to the chroot) then the substitute -command runs instead (path to substitute command is not chrooted). +the commands given (path relative to the chroot, trailing dot is removed) then +the substitute command runs instead (path to substitute command is not +chrooted). + +The substituted command inherits C variables but the original +C variable which is saved as C. It +means that substituted command runs outside fakechroot environment. Also +original command name is saved as C. For example: @@ -186,37 +236,44 @@ =item * -/sbin/insserv=/bin/true +C + +=item * + +C =item * -/sbin/ldconfig=/bin/ldconfig +C =item * -/usr/bin/ischroot=/bin/true +C =item * -/usr/bin/ldd=/usr/bin/ldd.fakechroot +C =item * -/usr/bin/mkfifo=/bin/true +C =back to make debootstrap(8) working correctly. +To prevent some looping, the command substitution is done only if +C variable is not set currently. + =item B, B Fakechroot is implemented by wrapping system calls. This is accomplished by -setting LD_LIBRARY_PATH=/usr/lib/fakechroot and +setting C and LD_PRELOAD=libfakechroot.so. That library is loaded before the system's C library, and so most of the library functions are intercepted by it. If you need to set either B or B from within a fakechroot environment, it should be set relative to the given paths, as in -LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/foo/bar/ +C =back @@ -253,9 +310,9 @@ =item o ldd(1) also doesn't work. You have to use C or to use a wrapper instead. The example -wrapper is available at F directory in fakechroot's source package -and it is located at F directory. +ldd='LD_TRACE_LOADED_OBJECTS=1'> or to use a wrapper instead. The wrapper is +installed as F and can be used with C +environment variable. =item o @@ -265,7 +322,7 @@ =item o -lckpwdf() and ulckpwdf() are ignored so passwd(1) command should work +lckpwdf(3) and ulckpwdf(3) are ignored so passwd(1) command should work =item o @@ -277,13 +334,42 @@ debuild(1) cleans environment. Use --preserve-env option to prevent this behaviour. +=item o + +rpmbuild(8) uses own glob(3) implementation which breaks fakechroot so +buildroot directory have to be the same inside and outside fakechroot. + =back +=for readme continue + +=head1 SEE ALSO + +fakeroot(1), debuild(1), debootstrap(8), febootstrap(8), +http://fakechroot.alioth.debian.org/ + +=head1 BUGS + +If you find the bug or want to implement new features, please report it at +L + +=head1 AUTHORS + +Copyright (c) 2003, 2005, 2007-2011 Piotr Roszatycki + +Copyright (c) 2007 Mark Eichin + +Copyright (c) 2006, 2007 Alexander Shishkin + +Copyright (c) 2006, 2007 Lionel Tricon + =head1 COPYING fakechroot is distributed under the GNU Lesser General Public License (LGPL 2.1 or greater). +=for readme stop + Additional copyrights: =over 2 @@ -337,6 +423,12 @@ =item * +rawmemchr function taken from uClibc +Copyright (C) 2002 Manuel Novoa III +Copyright (C) 2000-2005 Erik Andersen + +=item * + realpath function taken from Gnulib. Copyright (c) 1996-2010 Free Software Foundation, Inc. @@ -357,18 +449,3 @@ Copyright (C) 2003, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. =back - -=head1 AUTHORS - -Copyright (c) 2003, 2005, 2007-2011 Piotr Roszatycki - -Copyright (c) 2007 Mark Eichin - -Copyright (c) 2006, 2007 Alexander Shishkin - -Copyright (c) 2006, 2007 Lionel Tricon - -=head1 SEE ALSO - -fakeroot(1), debuild(1), debootstrap(8), febootstrap(8), -http://fakechroot.alioth.debian.org/ diff -Nru fakechroot-2.15/man/Makefile.am fakechroot-2.16/man/Makefile.am --- fakechroot-2.15/man/Makefile.am 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/man/Makefile.am 2011-12-11 12:05:34.000000000 +0000 @@ -3,4 +3,4 @@ EXTRA_DIST = $(man_MANS) fakechroot.pod fakechroot.1: fakechroot.pod - eval pod2man `head -n1 $(srcdir)/fakechroot.pod | sed 's/^# pod2man //'` $(srcdir)/fakechroot.pod > fakechroot.1 + eval pod2man `head -n1 $(srcdir)/fakechroot.pod | sed 's/^# pod2man //'` $(srcdir)/fakechroot.pod > $@ diff -Nru fakechroot-2.15/man/Makefile.in fakechroot-2.16/man/Makefile.in --- fakechroot-2.15/man/Makefile.in 2011-09-28 20:20:19.000000000 +0000 +++ fakechroot-2.16/man/Makefile.in 2011-12-11 12:06:07.000000000 +0000 @@ -55,6 +55,12 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -86,6 +92,7 @@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -95,6 +102,7 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHROOT = @CHROOT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -217,9 +225,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu man/Makefile + $(AUTOMAKE) --foreign man/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -448,7 +456,7 @@ fakechroot.1: fakechroot.pod - eval pod2man `head -n1 $(srcdir)/fakechroot.pod | sed 's/^# pod2man //'` $(srcdir)/fakechroot.pod > fakechroot.1 + eval pod2man `head -n1 $(srcdir)/fakechroot.pod | sed 's/^# pod2man //'` $(srcdir)/fakechroot.pod > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru fakechroot-2.15/NEWS fakechroot-2.16/NEWS --- fakechroot-2.15/NEWS 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/NEWS 2011-12-11 12:05:34.000000000 +0000 @@ -1,3 +1,17 @@ +== Version 2.16 == + +11 Dec 2011 + +* The fakechroot script loads additional environment settings from + configuration directory (+--config-dir+ option). By default additional + settings are provided for +chroot+(8) and +debootstrap+(8) commands. +* Wrapped +chroot+(8) command loads +ld.so.conf+ paths to +LD_LIBRARY_PATH+ + environment variable. +* The +debootstrap+(8) command works with default, buildd and minbase + variants. +* Fixes were made for +getpeeraddr+(3) and +getsockaddr+(3) functions. + +lwp-request+ command is working correctly. + == Version 2.15 == 29 Sep 2011 diff -Nru fakechroot-2.15/README fakechroot-2.16/README --- fakechroot-2.15/README 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/README 2011-12-11 12:05:34.000000000 +0000 @@ -1,6 +1,14 @@ NAME fakechroot - gives a fake chroot environment +SYNOPSIS + fakechroot [-s|--use-system-libs] [-l|--lib *library*] + [-e|--environment *type*] [-c|--config-dir *directory*] [--] [*command*] + + fakechroot [-h|--help] + + fakechroot [-v|--version] + DESCRIPTION fakechroot runs a command in an environment were is additional possibility to use chroot(8) command without root privileges. This is @@ -12,12 +20,11 @@ ones that simulate the effect the real library functions would have had, had the user really been in chroot. These wrapper functions are in a shared library /usr/lib/fakechroot/libfakechroot.so which is loaded - through the LD_PRELOAD mechanism of the dynamic loader. (See ld.so(8)) + through the `LD_PRELOAD' mechanism of the dynamic loader. (See ld.so(8)) - In fake chroot you can install Debian bootstrap with `debootstrap - --variant=fakechroot' command. In this environment you can use i.e. - apt-get(8) command to install another packages from common user's - account. + In fake chroot you can install Debian bootstrap with debootstrap(8) + command. In this environment you can use i.e. apt-get(8) command to + install another packages from common user's account. In the current version, the fakechroot does not provide the fakeroot(1) functionality! You might to call fakechroot with fakeroot command, if @@ -35,9 +42,13 @@ i.e. by separating (sandboxing) applications. It is very easy to escape from a fake chroot environment. -COPYING - fakechroot is distributed under the GNU Lesser General Public License - (LGPL 2.1 or greater). +SEE ALSO + fakeroot(1), debuild(1), debootstrap(8), febootstrap(8), + http://fakechroot.alioth.debian.org/ + +BUGS + If you find the bug or want to implement new features, please report it + at https://github.com/fakechroot/fakechroot/issues AUTHORS Copyright (c) 2003, 2005, 2007-2011 Piotr Roszatycki @@ -48,5 +59,7 @@ Copyright (c) 2006, 2007 Lionel Tricon -SEE ALSO - http://fakechroot.alioth.debian.org/ +COPYING + fakechroot is distributed under the GNU Lesser General Public License + (LGPL 2.1 or greater). + diff -Nru fakechroot-2.15/scripts/chroot.env.sh fakechroot-2.16/scripts/chroot.env.sh --- fakechroot-2.15/scripts/chroot.env.sh 1970-01-01 00:00:00.000000000 +0000 +++ fakechroot-2.16/scripts/chroot.env.sh 2011-12-11 12:05:34.000000000 +0000 @@ -0,0 +1,20 @@ +# Additional environment setting for chroot + +if ! command -v chroot >/dev/null; then + PATH="${PATH:-/usr/bin:/bin}:/usr/sbin:/sbin" + export PATH +fi + +chroot=`command -v chroot 2>/dev/null` +chroot="${chroot:-@CHROOT@}" + +cmd_subst=" + $chroot=@sbindir@/chroot.fakechroot + /sbin/ldconfig=/bin/true + /usr/bin/ischroot=/bin/true + /usr/bin/ldd=@bindir@/ldd.fakechroot +" + +FAKECHROOT_EXCLUDE_PATH="${FAKECHROOT_EXCLUDE_PATH:+$FAKECHROOT_EXCLUDE_PATH:}/dev:/proc:/sys" +FAKECHROOT_CMD_SUBST="${FAKECHROOT_CMD_SUBST:+$FAKECHROOT_CMD_SUBST:}$(echo $cmd_subst | tr ' ' ':')" +export FAKECHROOT_EXCLUDE_PATH FAKECHROOT_CMD_SUBST diff -Nru fakechroot-2.15/scripts/chroot.fakechroot.sh fakechroot-2.16/scripts/chroot.fakechroot.sh --- fakechroot-2.15/scripts/chroot.fakechroot.sh 1970-01-01 00:00:00.000000000 +0000 +++ fakechroot-2.16/scripts/chroot.fakechroot.sh 2011-12-11 12:05:34.000000000 +0000 @@ -0,0 +1,70 @@ +#!/bin/sh + +# chroot +# +# Wrapper for chroot command which sets additional LD_LIBRARY_PATH for fake +# chroot environment. It copies original LD_LIBRARY_PATH and adds prefix to +# each directory for this variable. +# +# (c) 2011 Piotr Roszatycki , LGPL + + +load_ldsoconf () { + file="$1" + newroot="$2" + + sed -e 's/#.*//' -e '/^ *$/d' "$newroot$file" 2>/dev/null | while read line; do + case "$line" in + include*) + include=`echo "$line" | sed -e 's/^include *//' -e 's/ *$//'` + for incfile in `eval echo $newroot$include`; do + incfile="${incfile#$newroot}" + load_ldsoconf "$incfile" "$newroot" + done + ;; + *) + echo "$newroot$line" + ;; + esac + done +} + +chroot="${FAKECHROOT_CMD_ORIG:-chroot}" +FAKECHROOT_CMD_ORIG= + +base="$FAKECHROOT_BASE_ORIG" +unset FAKECHROOT_BASE_ORIG + +for opt in "$@"; do + case "$opt" in + -*) + continue + ;; + *) + newroot="$1" + break + ;; + esac +done + +if [ -n "$newroot" ]; then + paths= + + # append newroot to each directory from original LD_LIBRARY_PATH + IFS_bak="$IFS" IFS=: + for d in $LD_LIBRARY_PATH; do + paths="${paths:+$paths:}$base$newroot/${d#/}" + done + IFS="$IFS_bak" + + # append newroot to each directory from new /etc/ld.so.conf + paths_ldsoconf=`load_ldsoconf "/etc/ld.so.conf" "$newroot" | while read line; do printf ":%s%s" "$base" "$line"; done` + paths_ldsoconf="${paths_ldsoconf#:}" + + paths="$paths${paths_ldsoconf:+:$paths_ldsoconf}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" + paths="${paths#:}" +fi + +# call real chroot +env LD_LIBRARY_PATH="$paths" FAKECHROOT_BASE="$base" "$chroot" "$@" +exit $? diff -Nru fakechroot-2.15/scripts/debootstrap.env.sh fakechroot-2.16/scripts/debootstrap.env.sh --- fakechroot-2.15/scripts/debootstrap.env.sh 1970-01-01 00:00:00.000000000 +0000 +++ fakechroot-2.16/scripts/debootstrap.env.sh 2011-12-11 12:05:34.000000000 +0000 @@ -0,0 +1,23 @@ +# Additional environment setting for debootstrap + +cmd_subst=" + /bin/mount=/bin/true + /sbin/devfs=/bin/true + /sbin/insserv=/bin/true + /sbin/ldconfig=/bin/true + /usr/bin/ischroot=/bin/true + /usr/bin/ldd=@bindir@/ldd.fakechroot + /usr/bin/mkfifo=/bin/true + /var/lib/dpkg/info/freebsd-utils.postinst=/bin/true + /var/lib/dpkg/info/kbdcontrol.postinst=/bin/true +" + +FAKECHROOT_EXCLUDE_PATH="${FAKECHROOT_EXCLUDE_PATH:+$FAKECHROOT_EXCLUDE_PATH:}/dev:/proc:/sys" +FAKECHROOT_AF_UNIX_PATH=/tmp +FAKECHROOT_CMD_SUBST="${FAKECHROOT_CMD_SUBST:+$FAKECHROOT_CMD_SUBST:}$(echo $cmd_subst | tr ' ' ':')" +export FAKECHROOT_EXCLUDE_PATH FAKECHROOT_AF_UNIX_PATH FAKECHROOT_CMD_SUBST + +if ! command -v chroot >/dev/null; then + PATH="${PATH:-/usr/bin:/bin}:/usr/sbin:/sbin" + export PATH +fi diff -Nru fakechroot-2.15/scripts/fakechroot.sh fakechroot-2.16/scripts/fakechroot.sh --- fakechroot-2.15/scripts/fakechroot.sh 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/scripts/fakechroot.sh 2011-12-11 12:05:34.000000000 +0000 @@ -1,112 +1,146 @@ #!/bin/sh +# fakechroot +# +# Script which sets fake chroot environment +# +# (c) 2011 Piotr Roszatycki , LGPL + + +FAKECHROOT_VERSION=@VERSION@ + + +die () { + echo "$@" 1>&2 + exit 1 +} + + usage () { -cat - >&2 <&2 "fakechroot: preload library not found, aborting." - exit 1 -fi -# Keep other library paths -if test -n "$LD_LIBRARY_PATH"; then - PATHS="$PATHS:$LD_LIBRARY_PATH" -fi -# ...and preloaded libs -if test -n "$LD_PRELOAD"; then - LIB="$LIB $LD_PRELOAD" +# Make sure the preload is available +paths="$paths${LD_LIBRARY_PATH:+${paths:+:}$LD_LIBRARY_PATH}" +lib="$lib${LD_PRELOAD:+ $LD_PRELOAD}" + +detect=`LD_LIBRARY_PATH="$paths" LD_PRELOAD="$lib" FAKECHROOT_DETECT=1 /bin/echo 2>&1` +case "$detect" in + fakechroot*) + libfound=yes + ;; + *) + libfound=no +esac + +if [ $libfound = no ]; then + die "fakechroot: preload library not found, aborting." fi -if test -z "$*"; then - LD_LIBRARY_PATH="$PATHS" - LD_PRELOAD="$LIB" - export LD_LIBRARY_PATH LD_PRELOAD - exec ${SHELL:-/bin/sh} + +# Additional environment setting from configuration file +for e in "$environment" "${environment%.*}" default; do + for d in "$confdir" "$HOME/.fakechroot" "$sysconfdir"; do + f="$d/$e.env" + if [ -f "$f" ]; then + . "$f" + break 2 + fi + done +done + + +# Execute command +if [ -z "$*" ]; then + env LD_LIBRARY_PATH="$paths" LD_PRELOAD="$lib" ${SHELL:-/bin/sh} + result=$? else - LD_LIBRARY_PATH="$PATHS" - LD_PRELOAD="$LIB" - export LD_LIBRARY_PATH LD_PRELOAD - exec "$@" + env LD_LIBRARY_PATH="$paths" LD_PRELOAD="$lib" "$@" + result=$? fi -exit 1 +exit $result diff -Nru fakechroot-2.15/scripts/ldd.fakechroot.pl fakechroot-2.16/scripts/ldd.fakechroot.pl --- fakechroot-2.15/scripts/ldd.fakechroot.pl 1970-01-01 00:00:00.000000000 +0000 +++ fakechroot-2.16/scripts/ldd.fakechroot.pl 2011-12-11 12:05:34.000000000 +0000 @@ -0,0 +1,201 @@ +#!/usr/bin/perl + +# fakeldd +# +# Replacement for ldd with usage of objdump +# +# (c) 2003-2010 Piotr Roszatycki , LGPL + +use strict; + +my @Libs = (); +my %Libs = (); + +my $Status = 0; +my $Dynamic = 0; +my $Format = ''; + +my $Ldsodir = "/lib"; +my @Ld_Library_Path = qw(/usr/lib /lib /usr/lib32 /lib32 /usr/lib64 /lib64); + + +sub ldso { + my ($lib) = @_; + + return if $Libs{$lib}; + + my $path; + + if ($lib =~ /^\//) { + $path = $lib; + } + else { + foreach my $dir (@Ld_Library_Path) { + next unless -f "$dir/$lib"; + + my $badformat = 0; + local *PIPE; + open PIPE, "objdump -p '$dir/$lib' 2>/dev/null |"; + while (my $line = ) { + if ($line =~ /file format (\S*)$/) { + $badformat = 1 unless $1 eq $Format; + last; + } + } + close PIPE; + + next if $badformat; + + $path = "$dir/$lib"; + last; + } + } + + push @Libs, $lib; + if (-f $path) { + $Libs{$lib} = $path; + objdump($path); + } +} + + +sub objdump { + my (@files) = @_; + + foreach my $file (@files) { + local *PIPE; + open PIPE, "objdump -p '$file' 2>/dev/null |"; + while (my $line = ) { + $line =~ s/^\s+//; + + if ($line =~ /file format (\S*)$/) { + if (not $Format) { + $Format = $1; + + if ($^O eq 'linux') { + if ($Format =~ /^elf64-/) { + push @Libs, 'linux-vdso.so.1'; + $Libs{'linux-vdso.so.1'} = ''; + } + else { + push @Libs, 'linux-gate.so.1'; + $Libs{'linux-gate.so.1'} = ''; + } + } + + foreach my $lib (split /:/, $ENV{LD_PRELOAD}||'') { + ldso($lib); + } + } + else { + next unless $Format eq $1; + } + } + if (not $Dynamic and $line =~ /^Dynamic Section:/) { + $Dynamic = 1; + } + + next unless $line =~ /^ \s* NEEDED \s+ (.*) \s* $/x; + + my $needed = $1; + if ($needed =~ /^ld(-linux)?(\.|-)/) { + $needed = "$Ldsodir/$needed"; + } + + ldso($needed); + } + close PIPE; + } +} + + +sub load_ldsoconf { + my ($file) = @_; + + local *FH; + open FH, $file; + while (my $line = ) { + chomp $line; + $line =~ s/#.*//; + next if $line =~ /^\s*$/; + + if ($line =~ /^include\s+(.*)\s*/) { + my $include = $1; + foreach my $incfile (glob $include) { + load_ldsoconf($incfile); + } + next; + } + + unshift @Ld_Library_Path, $line; + } + close FH; +} + + +MAIN: { + my @args = @ARGV; + + if (not @args) { + print STDERR "fakeldd: missing file arguments\n"; + exit 1; + } + + if (not `which objdump`) { + print STDERR "fakeldd: objdump: command not found: install binutils package\n"; + exit 1; + } + + load_ldsoconf('/etc/ld.so.conf'); + unshift @Ld_Library_Path, split(/:/, $ENV{LD_LIBRARY_PATH}||''); + + while ($args[0] =~ /^-/) { + my $arg = $args[0]; + shift @ARGV; + last if $arg eq "--"; + } + + foreach my $file (@args) { + %Libs = (); + $Dynamic = 0; + + if (@args > 1) { + print "$file:\n"; + } + + if (not -f $file) { + print STDERR "ldd: $file: No such file or directory\n"; + $Status = 1; + next; + } + + objdump($file); + + if ($Dynamic == 0) { + print "\tnot a dynamic executable\n"; + $Status = 1; + } + elsif (scalar %Libs eq "0") { + print "\tstatically linked\n"; + } + + my $address = '0x' . '0' x ($Format =~ /^elf64-/ ? 16 : 8); + + foreach my $lib (@Libs) { + if ($lib =~ /^\//) { + printf "\t%s (%s)\n", $lib, $address; + } + elsif (defined $Libs{$lib}) { + printf "\t%s => %s (%s)\n", $lib, $Libs{$lib}, $address; + } + else { + printf "\t%s => not found\n", $lib; + } + } + + } +} + +END { + $? = $Status; +} diff -Nru fakechroot-2.15/scripts/ldd.pl fakechroot-2.16/scripts/ldd.pl --- fakechroot-2.15/scripts/ldd.pl 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/scripts/ldd.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,201 +0,0 @@ -#!/usr/bin/perl - -# fakeldd -# -# Replacement for ldd with usage of objdump -# -# (c) 2003-2010 Piotr Roszatycki , LGPL - -use strict; - -my @Libs = (); -my %Libs = (); - -my $Status = 0; -my $Dynamic = 0; -my $Format = ''; - -my $Ldsodir = "/lib"; -my @Ld_Library_Path = qw(/usr/lib /lib /usr/lib32 /lib32 /usr/lib64 /lib64); - - -sub ldso { - my ($lib) = @_; - - return if $Libs{$lib}; - - my $path; - - if ($lib =~ /^\//) { - $path = $lib; - } - else { - foreach my $dir (@Ld_Library_Path) { - next unless -f "$dir/$lib"; - - my $badformat = 0; - local *PIPE; - open PIPE, "objdump -p '$dir/$lib' 2>/dev/null |"; - while (my $line = ) { - if ($line =~ /file format (\S*)$/) { - $badformat = 1 unless $1 eq $Format; - last; - } - } - close PIPE; - - next if $badformat; - - $path = "$dir/$lib"; - last; - } - } - - push @Libs, $lib; - if (-f $path) { - $Libs{$lib} = $path; - objdump($path); - } -} - - -sub objdump { - my (@files) = @_; - - foreach my $file (@files) { - local *PIPE; - open PIPE, "objdump -p '$file' 2>/dev/null |"; - while (my $line = ) { - $line =~ s/^\s+//; - - if ($line =~ /file format (\S*)$/) { - if (not $Format) { - $Format = $1; - - if ($^O eq 'linux') { - if ($Format =~ /^elf64-/) { - push @Libs, 'linux-vdso.so.1'; - $Libs{'linux-vdso.so.1'} = ''; - } - else { - push @Libs, 'linux-gate.so.1'; - $Libs{'linux-gate.so.1'} = ''; - } - } - - foreach my $lib (split /:/, $ENV{LD_PRELOAD}||'') { - ldso($lib); - } - } - else { - next unless $Format eq $1; - } - } - if (not $Dynamic and $line =~ /^Dynamic Section:/) { - $Dynamic = 1; - } - - next unless $line =~ /^ \s* NEEDED \s+ (.*) \s* $/x; - - my $needed = $1; - if ($needed =~ /^ld(-linux)?(\.|-)/) { - $needed = "$Ldsodir/$needed"; - } - - ldso($needed); - } - close PIPE; - } -} - - -sub load_ldsoconf { - my ($file) = @_; - - local *FH; - open FH, $file; - while (my $line = ) { - chomp $line; - $line =~ s/#.*//; - next if $line =~ /^\s*$/; - - if ($line =~ /^include\s+(.*)\s*/) { - my $include = $1; - foreach my $incfile (glob $include) { - load_ldsoconf($incfile); - } - next; - } - - unshift @Ld_Library_Path, $line; - } - close FH; -} - - -MAIN: { - my @args = @ARGV; - - if (not @args) { - print STDERR "fakeldd: missing file arguments\n"; - exit 1; - } - - if (not `which objdump`) { - print STDERR "fakeldd: objdump: command not found: install binutils package\n"; - exit 1; - } - - load_ldsoconf('/etc/ld.so.conf'); - unshift @Ld_Library_Path, split(/:/, $ENV{LD_LIBRARY_PATH}||''); - - while ($args[0] =~ /^-/) { - my $arg = $args[0]; - shift @ARGV; - last if $arg eq "--"; - } - - foreach my $file (@args) { - %Libs = (); - $Dynamic = 0; - - if (@args > 1) { - print "$file:\n"; - } - - if (not -f $file) { - print STDERR "ldd: $file: No such file or directory\n"; - $Status = 1; - next; - } - - objdump($file); - - if ($Dynamic == 0) { - print "\tnot a dynamic executable\n"; - $Status = 1; - } - elsif (scalar %Libs eq "0") { - print "\tstatically linked\n"; - } - - my $address = '0x' . '0' x ($Format =~ /^elf64-/ ? 16 : 8); - - foreach my $lib (@Libs) { - if ($lib =~ /^\//) { - printf "\t%s (%s)\n", $lib, $address; - } - elsif (defined $Libs{$lib}) { - printf "\t%s => %s (%s)\n", $lib, $Libs{$lib}, $address; - } - else { - printf "\t%s => not found\n", $lib; - } - } - - } -} - -END { - $? = $Status; -} diff -Nru fakechroot-2.15/scripts/Makefile.am fakechroot-2.16/scripts/Makefile.am --- fakechroot-2.15/scripts/Makefile.am 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/scripts/Makefile.am 2011-12-11 12:05:34.000000000 +0000 @@ -1,19 +1,43 @@ +sysconfdir = @sysconfdir@/@PACKAGE@ + +src_wrappers = chroot.fakechroot.sh fakechroot.sh ldd.fakechroot.pl +src_envs = chroot.env.sh debootstrap.env.sh rinse.env.sh +example_scripts = relocatesymlinks.sh restoremode.sh savemode.sh + bin_SCRIPTS = fakechroot ldd.fakechroot -EXTRA_DIST = fakechroot.sh ldd.pl restoremode.sh savemode.sh -CLEANFILES = $(bin_SCRIPTS) +sbin_SCRIPTS = chroot.fakechroot +sysconf_DATA = chroot.env debootstrap.env rinse.env + +EXTRA_DIST = $(src_wrappers) $(src_envs) $(example_scripts) +CLEANFILES = $(bin_SCRIPTS) $(sbin_SCRIPTS) $(sysconf_DATA) + +do_subst = sed -e 's,[@]bindir[@],$(bindir),g' \ + -e 's,[@]libpath[@],$(libpath),g' \ + -e 's,[@]sbindir[@],$(sbindir),g' \ + -e 's,[@]sysconfdir[@],$(sysconfdir),g' \ + -e 's,[@]CHROOT[@],$(CHROOT),g' \ + -e 's,[@]VERSION[@],$(VERSION),g' + +chroot.env: $(srcdir)/chroot.env.sh + $(do_subst) < $(srcdir)/chroot.env.sh > $@ + chmod +x $@ -do_subst = sed -e 's,[@]prefix[@],$(prefix),g' \ - -e 's,[@]bindir[@],$(bindir),g' \ - -e 's,[@]libdir[@],$(libdir),g' \ - -e 's,[@]pkglibdir[@],$(pkglibdir),g' \ - -e 's,[@]libpath[@],$(libpath),g' \ - -e 's,[@]fakechroot_transformed[@],'`echo fakechroot | sed -e '$(transform)'`',g' \ - -e 's,[@]VERSION[@],$(VERSION),g' +chroot.fakechroot: $(srcdir)/chroot.fakechroot.sh + $(do_subst) < $(srcdir)/chroot.fakechroot.sh > $@ + chmod +x $@ + +debootstrap.env: $(srcdir)/debootstrap.env.sh + $(do_subst) < $(srcdir)/debootstrap.env.sh > $@ + chmod +x $@ fakechroot: $(srcdir)/fakechroot.sh - $(do_subst) < $(srcdir)/fakechroot.sh > fakechroot + $(do_subst) < $(srcdir)/fakechroot.sh > $@ chmod +x $@ -ldd.fakechroot: $(srcdir)/ldd.pl - cp $(srcdir)/ldd.pl ldd.fakechroot - chmod +x ldd.fakechroot +ldd.fakechroot: $(srcdir)/ldd.fakechroot.pl + $(do_subst) < $(srcdir)/ldd.fakechroot.pl > $@ + chmod +x $@ + +rinse.env: $(srcdir)/rinse.env.sh + $(do_subst) < $(srcdir)/rinse.env.sh > $@ + chmod +x $@ diff -Nru fakechroot-2.15/scripts/Makefile.in fakechroot-2.16/scripts/Makefile.in --- fakechroot-2.15/scripts/Makefile.in 2011-09-28 20:20:19.000000000 +0000 +++ fakechroot-2.16/scripts/Makefile.in 2011-12-11 12:06:07.000000000 +0000 @@ -15,6 +15,7 @@ @SET_MAKE@ + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -77,14 +78,23 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(bindir)" -SCRIPTS = $(bin_SCRIPTS) +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" \ + "$(DESTDIR)$(sysconfdir)" +SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ SOURCES = DIST_SOURCES = +DATA = $(sysconf_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -94,6 +104,7 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHROOT = @CHROOT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -197,21 +208,25 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ -sysconfdir = @sysconfdir@ +sysconfdir = @sysconfdir@/@PACKAGE@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +src_wrappers = chroot.fakechroot.sh fakechroot.sh ldd.fakechroot.pl +src_envs = chroot.env.sh debootstrap.env.sh rinse.env.sh +example_scripts = relocatesymlinks.sh restoremode.sh savemode.sh bin_SCRIPTS = fakechroot ldd.fakechroot -EXTRA_DIST = fakechroot.sh ldd.pl restoremode.sh savemode.sh -CLEANFILES = $(bin_SCRIPTS) -do_subst = sed -e 's,[@]prefix[@],$(prefix),g' \ - -e 's,[@]bindir[@],$(bindir),g' \ - -e 's,[@]libdir[@],$(libdir),g' \ - -e 's,[@]pkglibdir[@],$(pkglibdir),g' \ - -e 's,[@]libpath[@],$(libpath),g' \ - -e 's,[@]fakechroot_transformed[@],'`echo fakechroot | sed -e '$(transform)'`',g' \ - -e 's,[@]VERSION[@],$(VERSION),g' +sbin_SCRIPTS = chroot.fakechroot +sysconf_DATA = chroot.env debootstrap.env rinse.env +EXTRA_DIST = $(src_wrappers) $(src_envs) $(example_scripts) +CLEANFILES = $(bin_SCRIPTS) $(sbin_SCRIPTS) $(sysconf_DATA) +do_subst = sed -e 's,[@]bindir[@],$(bindir),g' \ + -e 's,[@]libpath[@],$(libpath),g' \ + -e 's,[@]sbindir[@],$(sbindir),g' \ + -e 's,[@]sysconfdir[@],$(sysconfdir),g' \ + -e 's,[@]CHROOT[@],$(CHROOT),g' \ + -e 's,[@]VERSION[@],$(VERSION),g' all: all-am @@ -225,9 +240,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu scripts/Makefile + $(AUTOMAKE) --foreign scripts/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -280,12 +295,66 @@ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files +install-sbinSCRIPTS: $(sbin_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" + @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-sbinSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(sbindir)" && rm -f $$files mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs +install-sysconfDATA: $(sysconf_DATA) + @$(NORMAL_INSTALL) + test -z "$(sysconfdir)" || $(MKDIR_P) "$(DESTDIR)$(sysconfdir)" + @list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(sysconfdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(sysconfdir)" || exit $$?; \ + done + +uninstall-sysconfDATA: + @$(NORMAL_UNINSTALL) + @list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(sysconfdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(sysconfdir)" && rm -f $$files tags: TAGS TAGS: @@ -325,9 +394,9 @@ done check-am: all-am check: check-am -all-am: Makefile $(SCRIPTS) +all-am: Makefile $(SCRIPTS) $(DATA) installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sysconfdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -382,7 +451,8 @@ install-dvi-am: -install-exec-am: install-binSCRIPTS +install-exec-am: install-binSCRIPTS install-sbinSCRIPTS \ + install-sysconfDATA install-html: install-html-am @@ -420,7 +490,8 @@ ps-am: -uninstall-am: uninstall-binSCRIPTS +uninstall-am: uninstall-binSCRIPTS uninstall-sbinSCRIPTS \ + uninstall-sysconfDATA .MAKE: install-am install-strip @@ -431,19 +502,37 @@ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am uninstall-binSCRIPTS + install-sbinSCRIPTS install-strip install-sysconfDATA \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-binSCRIPTS uninstall-sbinSCRIPTS \ + uninstall-sysconfDATA + + +chroot.env: $(srcdir)/chroot.env.sh + $(do_subst) < $(srcdir)/chroot.env.sh > $@ + chmod +x $@ + +chroot.fakechroot: $(srcdir)/chroot.fakechroot.sh + $(do_subst) < $(srcdir)/chroot.fakechroot.sh > $@ + chmod +x $@ +debootstrap.env: $(srcdir)/debootstrap.env.sh + $(do_subst) < $(srcdir)/debootstrap.env.sh > $@ + chmod +x $@ fakechroot: $(srcdir)/fakechroot.sh - $(do_subst) < $(srcdir)/fakechroot.sh > fakechroot + $(do_subst) < $(srcdir)/fakechroot.sh > $@ chmod +x $@ -ldd.fakechroot: $(srcdir)/ldd.pl - cp $(srcdir)/ldd.pl ldd.fakechroot - chmod +x ldd.fakechroot +ldd.fakechroot: $(srcdir)/ldd.fakechroot.pl + $(do_subst) < $(srcdir)/ldd.fakechroot.pl > $@ + chmod +x $@ + +rinse.env: $(srcdir)/rinse.env.sh + $(do_subst) < $(srcdir)/rinse.env.sh > $@ + chmod +x $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru fakechroot-2.15/scripts/relocatesymlinks.sh fakechroot-2.16/scripts/relocatesymlinks.sh --- fakechroot-2.15/scripts/relocatesymlinks.sh 1970-01-01 00:00:00.000000000 +0000 +++ fakechroot-2.16/scripts/relocatesymlinks.sh 2011-12-11 12:05:34.000000000 +0000 @@ -0,0 +1,25 @@ +#!/bin/sh + +# This script adds all symlinks absolute path to fakechroot tree +# +# i.e. +# before: +# `/usr/bin/touch' -> `/bin/touch' +# after: +# `/usr/bin/touch' -> `/path/to/chroot/tree/bin/touch' + +if [ -z "$1" ]; then + echo "Usage: $0 /path/to/chroot/tree" + exit 1 +fi + +root=`cd "$1"; pwd -P` + +find "$root" -xdev -type l | while read linkname; do + target=`readlink "$linkname"` + case "$target" in + /*) + ln -vsf "$root$target" "$linkname" + ;; + esac; +done diff -Nru fakechroot-2.15/scripts/restoremode.sh fakechroot-2.16/scripts/restoremode.sh --- fakechroot-2.15/scripts/restoremode.sh 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/scripts/restoremode.sh 2011-12-11 12:05:34.000000000 +0000 @@ -1,9 +1,10 @@ #!/bin/sh -if [ "$(find ~ -maxdepth 0 -printf '%U\n')" != 0 ]; then - echo "Use in fakechroot environment" - exit 1 -fi + +# This script restores uids and gids of files saved previously +# with savemode.sh script + tar zxf savemode.dat1 --numeric-owner + zcat savemode.dat2 | while read uid gid mode file; do chown $uid:$gid $file chmod $mode $file diff -Nru fakechroot-2.15/scripts/rinse.env.sh fakechroot-2.16/scripts/rinse.env.sh --- fakechroot-2.15/scripts/rinse.env.sh 1970-01-01 00:00:00.000000000 +0000 +++ fakechroot-2.16/scripts/rinse.env.sh 2011-12-11 12:05:34.000000000 +0000 @@ -0,0 +1,24 @@ +# Additional environment setting for rinse + +cmd_subst=" + /bin/mount=/bin/true + /sbin/ldconfig=/bin/true + /sbin/new-kernel-pkg=/bin/true + /usr/bin/ischroot=/bin/true + /usr/bin/ldd=@bindir@/ldd.fakechroot + /usr/sbin/build-locale-archive=/bin/true + /usr/sbin/glibc_post_upgrade.i686=/bin/true + /usr/sbin/glibc_post_upgrade.x86_64=/bin/true + /usr/sbin/libgcc_post_upgrade=/bin/true + /usr/sbin/nscd=/bin/true +" + +FAKECHROOT_EXCLUDE_PATH="${FAKECHROOT_EXCLUDE_PATH:+$FAKECHROOT_EXCLUDE_PATH:}/dev:/proc:/sys" +FAKECHROOT_AF_UNIX_PATH=/tmp +FAKECHROOT_CMD_SUBST="${FAKECHROOT_CMD_SUBST:+$FAKECHROOT_CMD_SUBST:}$(echo $cmd_subst | tr ' ' ':')" +export FAKECHROOT_EXCLUDE_PATH FAKECHROOT_AF_UNIX_PATH FAKECHROOT_CMD_SUBST + +if ! command -v chroot >/dev/null; then + PATH="${PATH:-/usr/bin:/bin}:/usr/sbin:/sbin" + export PATH +fi diff -Nru fakechroot-2.15/scripts/savemode.sh fakechroot-2.16/scripts/savemode.sh --- fakechroot-2.15/scripts/savemode.sh 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/scripts/savemode.sh 2011-12-11 12:05:34.000000000 +0000 @@ -1,12 +1,21 @@ #!/bin/sh -if [ "$(find ~ -maxdepth 0 -printf '%U\n')" != 0 ]; then - echo "Use in fakechroot environment" - exit 1 -fi + +# This script saves uids and gids of files to savemode.dat? files +# which can be restored further with restoremode.sh script +# +# Only files with uid and gid different than current are saved. +# +# It should be started with root privileges or fakeroot command. + test -f savemode.dat1 && mv -f savemode.dat1 savemode.dat1~ test -f savemode.dat2 && mv -f savemode.dat2 savemode.dat2~ + +uid=`id -u` +gid=`id -g` + LANG=C find . \( -type b -o -type c -o -type p -o -type s \) \ | tar czPf savemode.dat1 -T- -find . \( -type f -o -type d -o -type l \) \ - -a \( ! -uid 0 -o ! -gid 0 \) -printf "%U %G %m %p\n" \ + +LANG=C find . \( -type f -o -type d -o -type l \) \ + -a \( ! -uid $uid -o ! -gid $gid \) -printf "%U %G %m %p\n" \ | gzip -9 > savemode.dat2 diff -Nru fakechroot-2.15/src/bind.c fakechroot-2.16/src/bind.c --- fakechroot-2.15/src/bind.c 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/src/bind.c 2011-12-11 12:05:34.000000000 +0000 @@ -23,11 +23,13 @@ #ifdef HAVE_BIND #define _GNU_SOURCE +#include #include #ifdef AF_UNIX #include +#include #include "libfakechroot.h" #ifdef HAVE_BIND_TYPE_ARG2___CONST_SOCKADDR_ARG__ diff -Nru fakechroot-2.15/src/chroot.c fakechroot-2.16/src/chroot.c --- fakechroot-2.15/src/chroot.c 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/src/chroot.c 2011-12-11 12:05:34.000000000 +0000 @@ -21,10 +21,12 @@ #include #define _GNU_SOURCE +#include #include #include #include #include +#include "setenv.h" #include "libfakechroot.h" #ifdef HAVE___XSTAT64 @@ -36,12 +38,9 @@ wrapper(chroot, int, (const char * path)) { - char *ptr, *ld_library_path, *tmp, *fakechroot_path; + char *ptr, *ld_library_path, *separator, *tmp, *fakechroot_path; int status, len; char dir[FAKECHROOT_PATH_MAX], cwd[FAKECHROOT_PATH_MAX]; -#ifndef HAVE_SETENV - char *envbuf; -#endif #ifdef HAVE___XSTAT64 struct stat64 sb; #else @@ -49,6 +48,7 @@ #endif debug("chroot(\"%s\")", path); + if (path == NULL) { __set_errno(EFAULT); return -1; @@ -119,21 +119,19 @@ } *tmp = 0; -#ifdef HAVE_SETENV setenv("FAKECHROOT_BASE", dir, 1); -#else - envbuf = malloc(FAKECHROOT_PATH_MAX+16); - snprintf(envbuf, FAKECHROOT_PATH_MAX+16, "FAKECHROOT_BASE=%s", dir); - putenv(envbuf); -#endif fakechroot_path = getenv("FAKECHROOT_BASE"); ld_library_path = getenv("LD_LIBRARY_PATH"); - if (ld_library_path == NULL) { + if (ld_library_path != NULL && strlen(ld_library_path) > 0) { + separator = ":"; + } + else { ld_library_path = ""; + separator = ""; } - if ((len = strlen(ld_library_path)+strlen(dir)*2+sizeof(":/usr/lib:/lib")) > FAKECHROOT_PATH_MAX) { + if ((len = strlen(ld_library_path)+strlen(separator)+strlen(dir)*2+sizeof("/usr/lib:/lib")) > FAKECHROOT_PATH_MAX) { return ENAMETOOLONG; } @@ -141,14 +139,8 @@ return ENOMEM; } - snprintf(tmp, len, "%s:%s/usr/lib:%s/lib", ld_library_path, dir, dir); -#ifdef HAVE_SETENV + snprintf(tmp, len, "%s%s%s/usr/lib:%s/lib", ld_library_path, separator, dir, dir); setenv("LD_LIBRARY_PATH", tmp, 1); -#else - envbuf = malloc(FAKECHROOT_PATH_MAX+16); - snprintf(envbuf, FAKECHROOT_PATH_MAX+16, "LD_LIBRARY_PATH=%s", tmp); - putenv(envbuf); -#endif free(tmp); return 0; } diff -Nru fakechroot-2.15/src/connect.c fakechroot-2.16/src/connect.c --- fakechroot-2.15/src/connect.c 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/src/connect.c 2011-12-11 12:05:34.000000000 +0000 @@ -23,11 +23,13 @@ #ifdef HAVE_CONNECT #define _GNU_SOURCE +#include #include #ifdef AF_UNIX #include +#include #include "libfakechroot.h" #ifdef HAVE_CONNECT_TYPE_ARG2___CONST_SOCKADDR_ARG__ diff -Nru fakechroot-2.15/src/execve.c fakechroot-2.16/src/execve.c --- fakechroot-2.15/src/execve.c 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/src/execve.c 2011-12-11 12:05:34.000000000 +0000 @@ -20,6 +20,7 @@ #include +#include #include #include #ifdef HAVE_ALLOCA_H @@ -30,6 +31,7 @@ #include "strchrnul.h" #include "libfakechroot.h" #include "open.h" +#include "unsetenv.h" /* Parse the FAKECHROOT_CMD_SUBST environment variable (the first @@ -38,12 +40,18 @@ * * FAKECHROOT_CMD_SUBST=cmd=subst:cmd=subst:... */ -static int try_cmd_subst (char *env, const char *filename, char *cmd_subst) +static int try_cmd_subst (char * env, const char * filename, char * cmd_subst) { - int len = strlen(filename), len2; + int len, len2; char *p; - if (env == NULL) return 0; + if (env == NULL || filename == NULL) + return 0; + + /* Remove trailing dot from filename */ + if (filename[0] == '.' && filename[1] == '/') + filename++; + len = strlen(filename); do { p = strchrnul(env, ':'); @@ -71,21 +79,42 @@ size_t argv_max = 1024; const char **newargv = alloca(argv_max * sizeof (const char *)); char **newenvp, **ep; - char *env; - char tmp[FAKECHROOT_PATH_MAX], newfilename[FAKECHROOT_PATH_MAX], argv0[FAKECHROOT_PATH_MAX]; + char *key, *env; + char *cmdorig; + char tmp[FAKECHROOT_PATH_MAX]; + char substfilename[FAKECHROOT_PATH_MAX]; + char newfilename[FAKECHROOT_PATH_MAX]; + char argv0[FAKECHROOT_PATH_MAX]; char *ptr; - unsigned int i, j, n, len, r, newenvppos; + unsigned int i, j, n, len, newenvppos; + unsigned int do_cmd_subst = 0; size_t sizeenvp; char c; char *fakechroot_path, fakechroot_buf[FAKECHROOT_PATH_MAX]; - char *envkey[] = { "FAKECHROOT", "FAKECHROOT_BASE", - "FAKECHROOT_VERSION", "FAKECHROOT_EXCLUDE_PATH", - "FAKECHROOT_CMD_SUBST", - "LD_LIBRARY_PATH", "LD_PRELOAD" }; + char *envkey[] = { + "FAKECHROOT", + "FAKECHROOT_BASE", + "FAKECHROOT_CMD_SUBST", + "FAKECHROOT_DEBUG", + "FAKECHROOT_DETECT", + "FAKECHROOT_EXCLUDE_PATH", + "FAKECHROOT_VERSION", + "LD_LIBRARY_PATH", + "LD_PRELOAD" + }; const int nr_envkey = sizeof envkey / sizeof envkey[0]; debug("execve(\"%s\", {\"%s\", ...}, {\"%s\", ...})", filename, argv[0], envp[0]); + strncpy(argv0, filename, FAKECHROOT_PATH_MAX); + + /* Substitute command only if FAKECHROOT_CMD_ORIG is not set. Unset variable if it is empty. */ + cmdorig = getenv("FAKECHROOT_CMD_ORIG"); + if (cmdorig == NULL) + do_cmd_subst = try_cmd_subst(getenv("FAKECHROOT_CMD_SUBST"), argv0, substfilename); + else if (!*cmdorig) + unsetenv("FAKECHROOT_CMD_ORIG"); + /* Scan envp and check its size */ sizeenvp = 0; for (ep = (char **)envp; *ep != NULL; ++ep) { @@ -110,19 +139,45 @@ } newenvp[newenvppos] = NULL; - strncpy(argv0, filename, FAKECHROOT_PATH_MAX); + /* Add our variables to newenvp */ + newenvp = realloc(newenvp, (newenvppos + nr_envkey + 1) * sizeof(char *)); - r = try_cmd_subst(getenv ("FAKECHROOT_CMD_SUBST"), filename, tmp); - if (r) { - filename = tmp; - - /* FAKECHROOT_CMD_SUBST escapes the chroot. newenvp here does - * not contain LD_PRELOAD and the other special environment - * variables. - */ - return nextcall(execve)(filename, argv, newenvp); + if (newenvp == NULL) { + __set_errno(ENOMEM); + return -1; + } + + for (j = 0; j < nr_envkey; j++) { + key = envkey[j]; + env = getenv(key); + if (env != NULL) { + if (do_cmd_subst && strcmp(key, "FAKECHROOT_BASE") == 0) { + key = "FAKECHROOT_BASE_ORIG"; + } + newenvp[newenvppos] = malloc(strlen(key) + strlen(env) + 3); + strcpy(newenvp[newenvppos], key); + strcat(newenvp[newenvppos], "="); + strcat(newenvp[newenvppos], env); + newenvppos++; + } + } + + if (do_cmd_subst) { + newenvp[newenvppos] = malloc(strlen("FAKECHROOT_CMD_ORIG=") + strlen(filename)); + strcpy(newenvp[newenvppos], "FAKECHROOT_CMD_ORIG="); + strcat(newenvp[newenvppos], filename); + newenvppos++; + } + + newenvp[newenvppos] = NULL; + + /* Exec substituded command */ + if (do_cmd_subst) { + debug("nextcall(execve)(\"%s\", {\"%s\", ...}, {\"%s\", ...})", substfilename, argv[0], newenvp[0]); + return nextcall(execve)(substfilename, (char * const *)argv, newenvp); } + /* Check hashbang */ expand_chroot_path(filename, fakechroot_path, fakechroot_buf); strcpy(tmp, filename); filename = tmp; @@ -139,24 +194,6 @@ return -1; } - /* Add our variables to newenvp */ - newenvp = realloc(newenvp, (newenvppos + nr_envkey + 1) * sizeof(char *)); - if (newenvp == NULL) { - __set_errno(ENOMEM); - return -1; - } - for (j = 0; j < nr_envkey; j++) { - env = getenv(envkey[j]); - if (env != NULL) { - newenvp[newenvppos] = malloc(strlen(envkey[j]) + strlen(env) + 3); - strcpy(newenvp[newenvppos], envkey[j]); - strcat(newenvp[newenvppos], "="); - strcat(newenvp[newenvppos], env); - newenvppos++; - } - } - newenvp[newenvppos] = NULL; - /* No hashbang in argv */ if (hashbang[0] != '#' || hashbang[1] != '!') return nextcall(execve)(filename, argv, newenvp); diff -Nru fakechroot-2.15/src/execvp.c fakechroot-2.16/src/execvp.c --- fakechroot-2.15/src/execvp.c 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/src/execvp.c 2011-12-11 12:05:34.000000000 +0000 @@ -21,6 +21,7 @@ #include #define _GNU_SOURCE +#include #include #ifdef HAVE_ALLOCA_H # include @@ -107,6 +108,7 @@ up finding no executable we can use, we want to diagnose that we did find one but were denied access. */ got_eacces = 1; + break; case ENOENT: case ESTALE: case ENOTDIR: diff -Nru fakechroot-2.15/src/ftw.c fakechroot-2.16/src/ftw.c --- fakechroot-2.15/src/ftw.c 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/src/ftw.c 2011-12-11 12:05:34.000000000 +0000 @@ -622,7 +622,6 @@ { char *endp = strchr (runp, '\0'); - // XXX Should store the d_type values as well?! result = process_entry (data, &dir, runp, endp - runp, DT_UNKNOWN); runp = endp + 1; diff -Nru fakechroot-2.15/src/getpeername.c fakechroot-2.16/src/getpeername.c --- fakechroot-2.15/src/getpeername.c 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/src/getpeername.c 2011-12-11 12:05:34.000000000 +0000 @@ -1,6 +1,6 @@ /* libfakechroot -- fake chroot environment - Copyright (c) 2010 Piotr Roszatycki + Copyright (c) 2010, 2011 Piotr Roszatycki This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -31,8 +31,10 @@ #include "libfakechroot.h" #ifdef HAVE_GETPEERNAME_TYPE_ARG2___SOCKADDR_ARG__ +# define SOCKADDR(addr) ((addr).__sockaddr__) # define SOCKADDR_UN(addr) ((addr).__sockaddr_un__) #else +# define SOCKADDR(addr) (addr) # define SOCKADDR_UN(addr) (addr) #endif @@ -45,6 +47,11 @@ char *fakechroot_path, *fakechroot_ptr, fakechroot_buf[FAKECHROOT_PATH_MAX]; debug("getpeername(%d, &addr, &addrlen)", s); + + if (SOCKADDR(addr)->sa_family != AF_UNIX) { + return nextcall(getpeername)(s, addr, addrlen); + } + newaddrlen = sizeof(struct sockaddr_un); memset(&newaddr, 0, newaddrlen); status = nextcall(getpeername)(s, (struct sockaddr *)&newaddr, &newaddrlen); diff -Nru fakechroot-2.15/src/getsockname.c fakechroot-2.16/src/getsockname.c --- fakechroot-2.15/src/getsockname.c 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/src/getsockname.c 2011-12-11 12:05:34.000000000 +0000 @@ -1,6 +1,6 @@ /* libfakechroot -- fake chroot environment - Copyright (c) 2010 Piotr Roszatycki + Copyright (c) 2010, 2011 Piotr Roszatycki This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -31,8 +31,10 @@ #include "libfakechroot.h" #ifdef HAVE_GETSOCKNAME_TYPE_ARG2___SOCKADDR_ARG__ +# define SOCKADDR(addr) ((addr).__sockaddr__) # define SOCKADDR_UN(addr) ((addr).__sockaddr_un__) #else +# define SOCKADDR(addr) (addr) # define SOCKADDR_UN(addr) (addr) #endif @@ -45,6 +47,11 @@ char *fakechroot_path, *fakechroot_ptr, fakechroot_buf[FAKECHROOT_PATH_MAX]; debug("getsockname(%d, &addr, &addrlen)", s); + + if (SOCKADDR(addr)->sa_family != AF_UNIX) { + return nextcall(getsockname)(s, addr, addrlen); + } + newaddrlen = sizeof(struct sockaddr_un); memset(&newaddr, 0, newaddrlen); status = nextcall(getsockname)(s, (struct sockaddr *)&newaddr, &newaddrlen); diff -Nru fakechroot-2.15/src/libfakechroot.c fakechroot-2.16/src/libfakechroot.c --- fakechroot-2.15/src/libfakechroot.c 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/src/libfakechroot.c 2011-12-11 12:05:34.000000000 +0000 @@ -1,7 +1,6 @@ /* libfakechroot -- fake chroot environment - Copyright (c) 2003, 2005, 2007, 2008, 2009, 2010 Piotr Roszatycki - + Copyright (c) 2003, 2005, 2007-2011 Piotr Roszatycki Copyright (c) 2007 Mark Eichin Copyright (c) 2006, 2007 Alexander Shishkin @@ -28,9 +27,11 @@ #define _GNU_SOURCE #include #include +#include #include #include #include +#include "setenv.h" #include "libfakechroot.h" @@ -72,13 +73,25 @@ struct passwd* passwd = NULL; char *pointer; + if ((pointer = getenv("FAKECHROOT_DETECT"))) { + /* printf causes coredump on FreeBSD */ + if (write(STDOUT_FILENO, PACKAGE, sizeof(PACKAGE)-1) && + write(STDOUT_FILENO, " ", 1) && + write(STDOUT_FILENO, VERSION, sizeof(VERSION)-1) && + write(STDOUT_FILENO, "\n", 1)) { /* -Wunused-result */ } + _Exit(atoi(pointer)); + } + debug("fakechroot_init()"); + debug("FAKECHROOT_BASE=\"%s\"", getenv("FAKECHROOT_BASE")); + debug("FAKECHROOT_BASE_ORIG=\"%s\"", getenv("FAKECHROOT_BASE_ORIG")); + debug("FAKECHROOT_CMD_ORIG=\"%s\"", getenv("FAKECHROOT_CMD_ORIG")); + if (!first) { first = 1; /* We get a list of directories or files */ - pointer = getenv("FAKECHROOT_EXCLUDE_PATH"); - if (pointer) { + if ((pointer = getenv("FAKECHROOT_EXCLUDE_PATH"))) { for (i=0; list_max<32 ;) { for (j=i; pointer[j]!=':' && pointer[j]!='\0'; j++); exclude_list[list_max] = malloc(j-i+2); @@ -98,6 +111,9 @@ strcpy(home_path, passwd->pw_dir); strcat(home_path, "/"); } + + setenv("FAKECHROOT", "true", 1); + setenv("FAKECHROOT_VERSION", FAKECHROOT, 1); } } diff -Nru fakechroot-2.15/src/Makefile.am fakechroot-2.16/src/Makefile.am --- fakechroot-2.15/src/Makefile.am 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/src/Makefile.am 2011-12-11 12:05:34.000000000 +0000 @@ -102,6 +102,8 @@ opendir.c \ pathconf.c \ popen.c \ + rawmemchr.c \ + rawmemchr.h \ readlink.c \ readlinkat.c \ realpath.c \ @@ -114,6 +116,8 @@ rpl_lstat.c \ scandir.c \ scandir64.c \ + setenv.c \ + setenv.h \ setxattr.c \ stat.c \ stat.h \ @@ -135,6 +139,8 @@ ulckpwdf.c \ unlink.c \ unlinkat.c \ + unsetenv.c \ + unsetenv.h \ utime.c \ utimensat.c \ utimes.c diff -Nru fakechroot-2.15/src/Makefile.in fakechroot-2.16/src/Makefile.in --- fakechroot-2.15/src/Makefile.in 2011-09-28 20:20:19.000000000 +0000 +++ fakechroot-2.16/src/Makefile.in 2011-12-11 12:06:07.000000000 +0000 @@ -100,31 +100,48 @@ lstat.lo lstat64.lo lutimes.lo mkdir.lo mkdirat.lo mkdtemp.lo \ mkfifo.lo mkfifoat.lo mknod.lo mknodat.lo mkstemp.lo \ mkstemp64.lo mktemp.lo open.lo open64.lo openat.lo openat64.lo \ - opendir.lo pathconf.lo popen.lo readlink.lo readlinkat.lo \ - realpath.lo remove.lo removexattr.lo rename.lo renameat.lo \ - revoke.lo rmdir.lo rpl_lstat.lo scandir.lo scandir64.lo \ - setxattr.lo stat.lo stat64.lo statfs.lo statfs64.lo statvfs.lo \ - statvfs64.lo stpcpy.lo strchrnul.lo symlink.lo symlinkat.lo \ - system.lo tempnam.lo tmpnam.lo truncate.lo truncate64.lo \ - ulckpwdf.lo unlink.lo unlinkat.lo utime.lo utimensat.lo \ - utimes.lo + opendir.lo pathconf.lo popen.lo rawmemchr.lo readlink.lo \ + readlinkat.lo realpath.lo remove.lo removexattr.lo rename.lo \ + renameat.lo revoke.lo rmdir.lo rpl_lstat.lo scandir.lo \ + scandir64.lo setenv.lo setxattr.lo stat.lo stat64.lo statfs.lo \ + statfs64.lo statvfs.lo statvfs64.lo stpcpy.lo strchrnul.lo \ + symlink.lo symlinkat.lo system.lo tempnam.lo tmpnam.lo \ + truncate.lo truncate64.lo ulckpwdf.lo unlink.lo unlinkat.lo \ + unsetenv.lo utime.lo utimensat.lo utimes.lo libfakechroot_la_OBJECTS = $(am_libfakechroot_la_OBJECTS) -libfakechroot_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libfakechroot_la_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +libfakechroot_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libfakechroot_la_LDFLAGS) $(LDFLAGS) \ + -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(libfakechroot_la_SOURCES) DIST_SOURCES = $(libfakechroot_la_SOURCES) ETAGS = etags @@ -133,6 +150,7 @@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -142,6 +160,7 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHROOT = @CHROOT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -354,6 +373,8 @@ opendir.c \ pathconf.c \ popen.c \ + rawmemchr.c \ + rawmemchr.h \ readlink.c \ readlinkat.c \ realpath.c \ @@ -366,6 +387,8 @@ rpl_lstat.c \ scandir.c \ scandir64.c \ + setenv.c \ + setenv.h \ setxattr.c \ stat.c \ stat.h \ @@ -387,6 +410,8 @@ ulckpwdf.c \ unlink.c \ unlinkat.c \ + unsetenv.c \ + unsetenv.h \ utime.c \ utimensat.c \ utimes.c @@ -406,9 +431,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/Makefile + $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -459,7 +484,7 @@ rm -f "$${dir}/so_locations"; \ done libfakechroot.la: $(libfakechroot_la_OBJECTS) $(libfakechroot_la_DEPENDENCIES) - $(libfakechroot_la_LINK) -rpath $(pkglibdir) $(libfakechroot_la_OBJECTS) $(libfakechroot_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libfakechroot_la_LINK) -rpath $(pkglibdir) $(libfakechroot_la_OBJECTS) $(libfakechroot_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -564,6 +589,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opendir.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pathconf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/popen.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rawmemchr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlinkat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/realpath.Plo@am__quote@ @@ -576,6 +602,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpl_lstat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scandir.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scandir64.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setenv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setxattr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat64.Plo@am__quote@ @@ -595,27 +622,31 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ulckpwdf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlinkat.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unsetenv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utime.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimensat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimes.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< diff -Nru fakechroot-2.15/src/popen.c fakechroot-2.16/src/popen.c --- fakechroot-2.15/src/popen.c 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/src/popen.c 2011-12-11 12:05:34.000000000 +0000 @@ -128,6 +128,7 @@ _exit(127); /* NOTREACHED */ } + break; } _MUTEX_UNLOCK(&pidlist_lock); diff -Nru fakechroot-2.15/src/rawmemchr.c fakechroot-2.16/src/rawmemchr.c --- fakechroot-2.15/src/rawmemchr.c 1970-01-01 00:00:00.000000000 +0000 +++ fakechroot-2.16/src/rawmemchr.c 2011-12-11 12:05:34.000000000 +0000 @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2002 Manuel Novoa III + * Copyright (C) 2000-2005 Erik Andersen + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#include + +#ifndef HAVE_RAWMEMCHR + +#include "libfakechroot.h" + +LOCAL void *rawmemchr(const void *s, int c) +{ + register const unsigned char *r = s; + + while (*r != ((unsigned char)c)) ++r; + + return (void *) r; /* silence the warning */ +} + +#endif diff -Nru fakechroot-2.15/src/rawmemchr.h fakechroot-2.16/src/rawmemchr.h --- fakechroot-2.15/src/rawmemchr.h 1970-01-01 00:00:00.000000000 +0000 +++ fakechroot-2.16/src/rawmemchr.h 2011-12-11 12:05:34.000000000 +0000 @@ -0,0 +1,21 @@ +/* + libfakechroot -- fake chroot environment + Copyright (c) 2011 Piotr Roszatycki + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + +void * rawmemchr (const void *, int); diff -Nru fakechroot-2.15/src/readlink.c fakechroot-2.16/src/readlink.c --- fakechroot-2.15/src/readlink.c 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/src/readlink.c 2011-12-11 12:05:34.000000000 +0000 @@ -30,7 +30,7 @@ char tmp[FAKECHROOT_PATH_MAX], *tmpptr; char *fakechroot_path, *fakechroot_ptr, fakechroot_buf[FAKECHROOT_PATH_MAX]; - debug("readlink(\"%s\", &buf, %d)", path, bufsiz); + debug("readlink(\"%s\", &buf, %zd)", path, bufsiz); expand_chroot_path(path, fakechroot_path, fakechroot_buf); if ((status = nextcall(readlink)(path, tmp, FAKECHROOT_PATH_MAX-1)) == -1) { diff -Nru fakechroot-2.15/src/realpath.c fakechroot-2.16/src/realpath.c --- fakechroot-2.15/src/realpath.c 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/src/realpath.c 2011-12-11 12:05:34.000000000 +0000 @@ -28,6 +28,7 @@ #ifdef HAVE_ALLOCA_H # include #endif +#include #include #include #include "libfakechroot.h" @@ -119,9 +120,9 @@ if (end - start == 0) break; - else if (end - start == 1 && start[0] == '.') - /* nothing */; - else if (end - start == 2 && start[0] == '.' && start[1] == '.') { + else if (end - start == 1 && start[0] == '.') { + /* nothing */ + } else if (end - start == 2 && start[0] == '.' && start[1] == '.') { /* Back up to previous component, ignore if at root already. */ if (dest > rpath + 1) while ((--dest)[-1] != '/'); diff -Nru fakechroot-2.15/src/setenv.c fakechroot-2.16/src/setenv.c --- fakechroot-2.15/src/setenv.c 1970-01-01 00:00:00.000000000 +0000 +++ fakechroot-2.16/src/setenv.c 2011-12-11 12:05:34.000000000 +0000 @@ -0,0 +1,43 @@ +/* + libfakechroot -- fake chroot environment + Copyright (c) 2011 Piotr Roszatycki + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + +#include + +#ifndef HAVE_SETENV + +#include +#include +#include +#include "libfakechroot.h" + + +LOCAL int setenv (const char *name, const char *value, int overwrite) +{ + int ret = 0; + if (overwrite || !getenv(name)) { + size_t len = strlen(name) + strlen(value) + 2; + char *string = malloc(len); + snprintf(string, len, "%s=%s", name, value); + ret = putenv(string); + } + return ret; +} + +#endif diff -Nru fakechroot-2.15/src/setenv.h fakechroot-2.16/src/setenv.h --- fakechroot-2.15/src/setenv.h 1970-01-01 00:00:00.000000000 +0000 +++ fakechroot-2.16/src/setenv.h 2011-12-11 12:05:34.000000000 +0000 @@ -0,0 +1,21 @@ +/* + libfakechroot -- fake chroot environment + Copyright (c) 2011 Piotr Roszatycki + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + +int setenv (const char *, const char *, int); diff -Nru fakechroot-2.15/src/strchrnul.c fakechroot-2.16/src/strchrnul.c --- fakechroot-2.15/src/strchrnul.c 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/src/strchrnul.c 2011-12-11 12:05:34.000000000 +0000 @@ -21,6 +21,7 @@ /* Specification. */ #include +#include "rawmemchr.h" #include "libfakechroot.h" /* Find the first occurrence of C in S or the final NUL byte. */ diff -Nru fakechroot-2.15/src/unsetenv.c fakechroot-2.16/src/unsetenv.c --- fakechroot-2.15/src/unsetenv.c 1970-01-01 00:00:00.000000000 +0000 +++ fakechroot-2.16/src/unsetenv.c 2011-12-11 12:05:34.000000000 +0000 @@ -0,0 +1,33 @@ +/* + libfakechroot -- fake chroot environment + Copyright (c) 2011 Piotr Roszatycki + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#ifndef HAVE_UNSETENV + +#include +#include +#include "libfakechroot.h" + + +LOCAL int unsetenv (const char *name) { + return putenv((char *)name); +} + +#endif diff -Nru fakechroot-2.15/src/unsetenv.h fakechroot-2.16/src/unsetenv.h --- fakechroot-2.15/src/unsetenv.h 1970-01-01 00:00:00.000000000 +0000 +++ fakechroot-2.16/src/unsetenv.h 2011-12-11 12:05:34.000000000 +0000 @@ -0,0 +1,21 @@ +/* + libfakechroot -- fake chroot environment + Copyright (c) 2011 Piotr Roszatycki + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + +int unsetenv (const char *); diff -Nru fakechroot-2.15/test/bin/fakechroot fakechroot-2.16/test/bin/fakechroot --- fakechroot-2.15/test/bin/fakechroot 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/test/bin/fakechroot 2011-12-11 12:05:34.000000000 +0000 @@ -1,22 +1,17 @@ #!/bin/sh -srcdir=${srcdir:-.} -. $srcdir/common.inc +pwd=`dirname $0` +abs_top_srcdir=${abs_top_srcdir:-`cd "$pwd/../.." 2>/dev/null && pwd -P`} -if [ "$1" = "-s" ] || [ "$1" = "--use-system-libs" ]; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH${LD_LIBRARY_PATH:+:}/usr/lib:/lib" - export LD_LIBRARY_PATH - shift +if ! command -v chroot >/dev/null; then + PATH="${PATH:-/usr/bin:/bin}:/usr/sbin:/sbin" + export PATH fi -if [ "$1" = "--" ]; then - shift -fi +chroot=`command -v chroot` -prepare_env +FAKECHROOT_CMD_SUBST="${FAKECHROOT_CMD_SUBST:+$FAKECHROOT_CMD_SUBST:}$chroot=$abs_top_srcdir/scripts/chroot.fakechroot" +export FAKECHROOT_CMD_SUBST -if [ $# -gt 0 ]; then - exec "$@" -else - exec $SHELL -fi +"$abs_top_srcdir/scripts/fakechroot" -c "$abs_top_srcdir/scripts" -l "$abs_top_srcdir/src/.libs/libfakechroot.so" "$@" +exit $? diff -Nru fakechroot-2.15/test/chroot.sh fakechroot-2.16/test/chroot.sh --- fakechroot-2.15/test/chroot.sh 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/test/chroot.sh 2011-12-11 12:05:34.000000000 +0000 @@ -2,15 +2,25 @@ srcdir=${srcdir:-.} +if ! command -v chroot >/dev/null; then + PATH="${PATH:-/usr/bin:/bin}:/usr/sbin:/sbin" + export PATH +fi + if [ $# -gt 0 ]; then destdir=$1 shift else - destdir=`cd $srcdir/testtree && pwd -P` + abs_srcdir=${abs_srcdir:-`cd "$srcdir" 2>/dev/null && pwd -P`} + destdir="$abs_srcdir/testtree" fi if [ $# -gt 0 ]; then - HOME=/root exec /usr/sbin/chroot $destdir "$@" + env HOME=/root chroot $destdir "$@" + result=$? else - HOME=/root exec /usr/sbin/chroot $destdir $SHELL + env HOME=/root chroot $destdir $SHELL -i + result=$? fi + +exit $result diff -Nru fakechroot-2.15/test/common.inc fakechroot-2.16/test/common.inc --- fakechroot-2.15/test/common.inc 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/test/common.inc 2011-12-11 12:05:34.000000000 +0000 @@ -9,31 +9,6 @@ fi } -prepare_env () { - if [ -f src/.libs/libfakechroot.so ]; then - dir=`cd \`pwd\`/src/.libs 2>/dev/null && pwd` - elif [ -f ../src/.libs/libfakechroot.so ]; then - dir=`cd \`pwd\`/../src/.libs 2>/dev/null && pwd` - else - dir=/usr/lib/fakechroot - fi - - if [ -n "$LD_PRELOAD" ]; then - LD_PRELOAD="$LD_PRELOAD $dir/libfakechroot.so" - else - LD_PRELOAD="$dir/libfakechroot.so" - fi - export LD_PRELOAD - - if ! which chroot >/dev/null; then - PATH=$PATH:/usr/sbin:/sbin - export PATH - fi - - FAKECHROOT=true - export FAKECHROOT -} - cleanup () { rm -rf testtree @@ -44,9 +19,11 @@ plan $1 rm -rf testtree - $srcdir/testtree.sh testtree + "$srcdir/testtree.sh" testtree test "`cat testtree/CHROOT 2>&1`" = "testtree" || bail_out "cannot create testtree" + + unset FAKECHROOT_CMD_SUBST FAKECHROOT_DEBUG FAKECHROOT_EXCLUDE_PATH } -. $srcdir/seq.inc -. $srcdir/tap.inc +. "$srcdir/seq.inc" +. "$srcdir/tap.inc" diff -Nru fakechroot-2.15/test/debootstrap.sh fakechroot-2.16/test/debootstrap.sh --- fakechroot-2.15/test/debootstrap.sh 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/test/debootstrap.sh 2011-12-11 12:05:34.000000000 +0000 @@ -1,15 +1,23 @@ #!/bin/sh +# This script setups new environment with debootstrap, installs necessary +# packages with APT, downloads source package for hello, and builds the +# binary package. +# +# It should work with any Debian-based system. + srcdir=${srcdir:-.} +abs_srcdir=${abs_srcdir:-`cd "$srcdir" 2>/dev/null && pwd -P`} -test -d $srcdir/bin && export PATH=$srcdir/bin:$PATH +test -d "$abs_srcdir/bin" && export PATH="$abs_srcdir/bin:$PATH" run () { - HOME=/root fakechroot /usr/sbin/chroot $destdir "$@" + HOME=/root fakechroot chroot $destdir "$@" } vendor=${VENDOR:-`lsb_release -s -i`} release=${RELEASE:-`lsb_release -s -c`} +variant=$VARIANT type=`dpkg-architecture -qDEB_HOST_GNU_TYPE` systype=${type#*-} arch=${ARCH:-`dpkg-architecture -t$(arch)-$systype -qDEB_HOST_ARCH 2>/dev/null`} @@ -18,18 +26,16 @@ destdir=$1 shift else - destdir=`pwd -P`/testtree + destdir="$abs_srcdir/testtree" fi -tarball=$vendor-$release-$arch.debs.tgz +tarball=$vendor-$release${variant:+-$variant}-$arch.debs.tgz -export FAKECHROOT_EXCLUDE_PATH=${FAKECHROOT_EXCLUDE_PATH:-/dev:/proc:/sys} -export FAKECHROOT_CMD_SUBST=/sbin/insserv=/bin/true:/sbin/ldconfig=/bin/true:/usr/bin/ischroot=/bin/true:/usr/bin/ldd=/usr/bin/ldd.fakechroot:/usr/bin/mkfifo=/bin/true export FAKECHROOT_AF_UNIX_PATH=/tmp -debootstrap_opts="--arch=$arch --variant=fakechroot" +debootstrap_opts="--arch=$arch ${variant:+--variant=$variant}" if [ ! -f $tarball ]; then - FAKECHROOT=true fakeroot /usr/sbin/debootstrap --download-only --make-tarball=$tarball --include=build-essential,devscripts,fakeroot,gnupg $debootstrap_opts $release $destdir "$@" + FAKECHROOT=true fakeroot debootstrap --download-only --make-tarball=$tarball --include=build-essential,devscripts,fakeroot,gnupg $debootstrap_opts $release $destdir "$@" fi rm -rf $destdir @@ -39,7 +45,7 @@ export PATH fi -fakechroot fakeroot /usr/sbin/debootstrap --unpack-tarball="`pwd`/$tarball" $debootstrap_opts $release $destdir +fakechroot fakeroot debootstrap --unpack-tarball="`pwd`/$tarball" $debootstrap_opts $release $destdir HOME=/root fakechroot fakeroot /usr/sbin/chroot $destdir apt-get --force-yes -y --no-install-recommends install build-essential devscripts fakeroot gnupg diff -Nru fakechroot-2.15/test/fakechroot.sh fakechroot-2.16/test/fakechroot.sh --- fakechroot-2.15/test/fakechroot.sh 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/test/fakechroot.sh 2011-12-11 12:05:34.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh srcdir=${srcdir:-.} -. $srcdir/common.inc +FAKECHROOT="${FAKECHROOT:-$srcdir/bin/fakechroot}" -export FAKECHROOT_EXCLUDE_PATH=${FAKECHROOT_EXCLUDE_PATH:-/dev:/proc} -$srcdir/bin/fakechroot $srcdir/chroot.sh "$@" +"$FAKECHROOT" "$srcdir/chroot.sh" "$@" +exit $? diff -Nru fakechroot-2.15/test/febootstrap.sh fakechroot-2.16/test/febootstrap.sh --- fakechroot-2.15/test/febootstrap.sh 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/test/febootstrap.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -#!/bin/sh - -srcdir=${srcdir:-.} -. $srcdir/common.inc - -export PATH=$srcdir/bin:$PATH - -run () { - HOME=/root fakechroot /usr/sbin/chroot $destdir "$@" -} - -vendor=${VENDOR:-`lsb_release -s -i | tr 'A-Z' 'a-z'`} -release=${RELEASE:-`lsb_release -s -r`} -arch=${ARCH:-`uname -m`} - -if [ $# -gt 0 ]; then - destdir=$1 - shift -else - destdir=testtree -fi - -export FAKECHROOT_EXCLUDE_PATH=${FAKECHROOT_EXCLUDE_PATH:-/dev:/proc:/sys} -export FAKECHROOT_CMD_SUBST=/sbin/ldconfig=/bin/true:/usr/sbin/glibc_post_upgrade.i686=/bin/true:/usr/sbin/glibc_post_upgrade.x86_64=/bin/true:/usr/sbin/build-locale-archive=/bin/true:/usr/sbin/libgcc_post_upgrade=/bin/true:/sbin/new-kernel-pkg=/bin/true:/usr/sbin/nscd=/bin/true -export FAKECHROOT_AF_UNIX_PATH=/tmp - -rm -rf $destdir - -if ! which chroot >/dev/null; then - PATH=$PATH:/usr/sbin:/sbin - export PATH -fi - -febootstrap $vendor-$release $destdir - -cp -v `cd $srcdir; pwd`/../scripts/ldd.pl $destdir/usr/bin/ldd -cp -v /etc/resolv.conf $destdir/etc -rm -fv $destdir/etc/yum.repos.d/*update*.repo -sed -i 's/^enabled=0/enabled=1/' $destdir/etc/yum.repos.d/*.repo - -HOME=/root fakeroot fakechroot /usr/sbin/chroot $destdir yum -y update -HOME=/root fakeroot fakechroot /usr/sbin/chroot $destdir yum -y install fakeroot gcc gettext make rpm-build tar yum-utils - -# rpmbuild has statically compiled glob() function so buildroot directory have to be the same inside and outside fakechroot. -FAKECHROOT_EXCLUDE_PATH=$FAKECHROOT_EXCLUDE_PATH:/tmp - -run fakeroot sh -c 'cd /tmp && yumdownloader --source hello' -run sh -c 'mkdir -p /root/rpmbuild/SOURCES && cd /root/rpmbuild/SOURCES && rpm2cpio /tmp/hello-*.src.rpm | cpio -idmv "*.tar.gz"' -run sh -c 'mkdir -p /root/rpmbuild/SPECS && cd /root/rpmbuild/SPECS && rpm2cpio /tmp/hello-*.src.rpm | cpio -idmv "*.spec"' -run sh -c 'cd /root/rpmbuild/SPECS && rpm2cpio /tmp/hello-*.src.rpm | cpio -idmv "*.spec"' -run fakeroot sh -c 'cd /root/rpmbuild/SPECS && rpmbuild --buildroot=/tmp/rpmbuild/BUILDROOT -ba hello.spec' -run fakeroot sh -c 'rpm -i /root/rpmbuild/RPMS/*/*.rpm' -run sh -c 'hello' diff -Nru fakechroot-2.15/test/Makefile.am fakechroot-2.16/test/Makefile.am --- fakechroot-2.15/test/Makefile.am 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/test/Makefile.am 2011-12-11 12:05:34.000000000 +0000 @@ -36,8 +36,8 @@ common.inc \ debootstrap.sh \ fakechroot.sh \ - febootstrap.sh \ readlink.inc \ + rinse.sh \ seq.inc \ tap.inc \ testtree.sh \ @@ -47,7 +47,7 @@ # test: - $(MAKE) $(AM_MAKEFLAGS) -C src check + ( cd src && $(MAKE) $(AM_MAKEFLAGS) check ) if [ -n "$(PROVE)" ]; then \ cp -f $(srcdir)/proverc .proverc; \ srcdir=$(srcdir) SEQ=$(seq) $(PROVE) $(srcdir)/t; \ diff -Nru fakechroot-2.15/test/Makefile.in fakechroot-2.16/test/Makefile.in --- fakechroot-2.15/test/Makefile.in 2011-09-28 20:20:19.000000000 +0000 +++ fakechroot-2.16/test/Makefile.in 2011-12-11 12:06:07.000000000 +0000 @@ -55,6 +55,12 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -103,6 +109,7 @@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -112,6 +119,7 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHROOT = @CHROOT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -255,8 +263,8 @@ common.inc \ debootstrap.sh \ fakechroot.sh \ - febootstrap.sh \ readlink.inc \ + rinse.sh \ seq.inc \ tap.inc \ testtree.sh \ @@ -277,9 +285,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu test/Makefile + $(AUTOMAKE) --foreign test/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -707,7 +715,7 @@ test: - $(MAKE) $(AM_MAKEFLAGS) -C src check + ( cd src && $(MAKE) $(AM_MAKEFLAGS) check ) if [ -n "$(PROVE)" ]; then \ cp -f $(srcdir)/proverc .proverc; \ srcdir=$(srcdir) SEQ=$(seq) $(PROVE) $(srcdir)/t; \ diff -Nru fakechroot-2.15/test/rinse.sh fakechroot-2.16/test/rinse.sh --- fakechroot-2.15/test/rinse.sh 1970-01-01 00:00:00.000000000 +0000 +++ fakechroot-2.16/test/rinse.sh 2011-12-11 12:05:34.000000000 +0000 @@ -0,0 +1,87 @@ +#!/bin/sh + +# This script setups new environment with Rinse +# (http://www.steve.org.uk/Software/rinse/), installs necessary packages +# with Yum, downloads source package for hello, and builds the binary +# package. +# +# It should work with systems supported by Rinse (CentOS, Fedora, +# OpenSUSE). + +srcdir=${srcdir:-.} +abs_srcdir=${abs_srcdir:-`cd "$srcdir" 2>/dev/null && pwd -P`} + +test -d "$abs_srcdir/bin" && export PATH="$abs_srcdir/bin:$PATH" + +run () { + HOME=/root fakechroot chroot $destdir "$@" +} + +run_fakeroot () { + HOME=/root fakechroot fakeroot chroot $destdir "$@" +} + +vendor=${VENDOR:-`lsb_release -s -i`} +release=${RELEASE:-`lsb_release -s -r`} +arch=${ARCH:-`uname -m`} + +case $arch in + i?86) arch=i386;; +esac + +if [ $# -gt 0 ]; then + destdir=$1 + shift +else + destdir="$abs_srcdir/testtree" +fi + +tarball=$vendor-$release-$arch.rpms.tgz +distribution=`echo $vendor | tr 'A-Z' 'a-z'`-`echo $release | sed 's/\..*//'` + +rm -rf rinse-cache +mkdir rinse-cache + +if [ -f $tarball ]; then + ( cd rinse-cache; tar zxf ../$tarball ) +fi + +export FAKECHROOT_AF_UNIX_PATH=/tmp + +rm -rf "$destdir" + +if ! which chroot >/dev/null; then + PATH=$PATH:/usr/sbin:/sbin + export PATH +fi + +fakechroot fakeroot rinse --distribution $distribution --directory "$destdir" --arch $arch --cache 1 --cache-dir "$abs_srcdir/rinse-cache" "$@" + +if [ ! -f $tarball ]; then + ( cd rinse-cache; tar zcf ../$tarball * ) +fi + +cp -v /etc/resolv.conf "$destdir/etc" +rm -fv "$destdir"/etc/yum.repos.d/*update*.repo +grep -E -r -l 'baseurl=(ftp|https?)' "$destdir"/etc/yum.repos.d/*.repo | while read file; do + sed -i 's/^enabled=0/enabled=1/' "$file" +done + +run_fakeroot yum -y update + +run_fakeroot yum -y install gcc gettext make rpm-build tar yum-utils + +# rpmbuild has statically compiled glob() function so buildroot directory have to be the same inside and outside fakechroot. +export FAKECHROOT_EXCLUDE_PATH=/tmp +rm -rf "$destdir/tmp" +ln -s /tmp "$destdir/tmp" + +if [ ! -f /tmp/hello-*.src.rpm ]; then + run_fakeroot sh -c 'cd /tmp && yumdownloader --source hello' +fi +run sh -c 'mkdir -p /usr/src/redhat/SOURCES && cd /usr/src/redhat/SOURCES && rpm2cpio /tmp/hello-*.src.rpm | cpio -idmv "*.tar.gz"' +run sh -c 'mkdir -p /usr/src/redhat/SPECS && cd /usr/src/redhat/SPECS && rpm2cpio /tmp/hello-*.src.rpm | cpio -idmv "*.spec"' +run sh -c 'cd /usr/src/redhat/SPECS && rpm2cpio /tmp/hello-*.src.rpm | cpio -idmv "*.spec"' +run_fakeroot sh -c 'cd /usr/src/redhat/SPECS && mkdir -p /tmp/rpmbuild/BUILDROOT && rpmbuild --buildroot=/tmp/rpmbuild/BUILDROOT -ba hello.spec' +run_fakeroot sh -c 'rpm -i /usr/src/redhat/RPMS/*/*.rpm' +run sh -c 'hello' diff -Nru fakechroot-2.15/test/src/Makefile.in fakechroot-2.16/test/src/Makefile.in --- fakechroot-2.15/test/src/Makefile.in 2011-09-28 20:20:19.000000000 +0000 +++ fakechroot-2.16/test/src/Makefile.in 2011-12-11 12:06:07.000000000 +0000 @@ -66,6 +66,9 @@ test_canonicalize_file_name_OBJECTS = \ test-canonicalize_file_name.$(OBJEXT) test_canonicalize_file_name_LDADD = $(LDADD) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent test_chroot_SOURCES = test-chroot.c test_chroot_OBJECTS = test-chroot.$(OBJEXT) test_chroot_LDADD = $(LDADD) @@ -116,13 +119,26 @@ am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; SOURCES = test-canonicalize_file_name.c test-chroot.c test-execlp.c \ test-fts.c test-ftw.c test-lstat.c test-opendir.c test-popen.c \ test-realpath.c test-scandir.c test-socket-af_unix-client.c \ @@ -139,6 +155,7 @@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -148,6 +165,7 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHROOT = @CHROOT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -269,9 +287,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/src/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/src/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu test/src/Makefile + $(AUTOMAKE) --foreign test/src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -301,49 +319,49 @@ rm -f $$list test-canonicalize_file_name$(EXEEXT): $(test_canonicalize_file_name_OBJECTS) $(test_canonicalize_file_name_DEPENDENCIES) @rm -f test-canonicalize_file_name$(EXEEXT) - $(LINK) $(test_canonicalize_file_name_OBJECTS) $(test_canonicalize_file_name_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_canonicalize_file_name_OBJECTS) $(test_canonicalize_file_name_LDADD) $(LIBS) test-chroot$(EXEEXT): $(test_chroot_OBJECTS) $(test_chroot_DEPENDENCIES) @rm -f test-chroot$(EXEEXT) - $(LINK) $(test_chroot_OBJECTS) $(test_chroot_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_chroot_OBJECTS) $(test_chroot_LDADD) $(LIBS) test-execlp$(EXEEXT): $(test_execlp_OBJECTS) $(test_execlp_DEPENDENCIES) @rm -f test-execlp$(EXEEXT) - $(LINK) $(test_execlp_OBJECTS) $(test_execlp_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_execlp_OBJECTS) $(test_execlp_LDADD) $(LIBS) test-fts$(EXEEXT): $(test_fts_OBJECTS) $(test_fts_DEPENDENCIES) @rm -f test-fts$(EXEEXT) - $(LINK) $(test_fts_OBJECTS) $(test_fts_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_fts_OBJECTS) $(test_fts_LDADD) $(LIBS) test-ftw$(EXEEXT): $(test_ftw_OBJECTS) $(test_ftw_DEPENDENCIES) @rm -f test-ftw$(EXEEXT) - $(LINK) $(test_ftw_OBJECTS) $(test_ftw_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_ftw_OBJECTS) $(test_ftw_LDADD) $(LIBS) test-lstat$(EXEEXT): $(test_lstat_OBJECTS) $(test_lstat_DEPENDENCIES) @rm -f test-lstat$(EXEEXT) - $(LINK) $(test_lstat_OBJECTS) $(test_lstat_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_lstat_OBJECTS) $(test_lstat_LDADD) $(LIBS) test-opendir$(EXEEXT): $(test_opendir_OBJECTS) $(test_opendir_DEPENDENCIES) @rm -f test-opendir$(EXEEXT) - $(LINK) $(test_opendir_OBJECTS) $(test_opendir_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_opendir_OBJECTS) $(test_opendir_LDADD) $(LIBS) test-popen$(EXEEXT): $(test_popen_OBJECTS) $(test_popen_DEPENDENCIES) @rm -f test-popen$(EXEEXT) - $(LINK) $(test_popen_OBJECTS) $(test_popen_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_popen_OBJECTS) $(test_popen_LDADD) $(LIBS) test-realpath$(EXEEXT): $(test_realpath_OBJECTS) $(test_realpath_DEPENDENCIES) @rm -f test-realpath$(EXEEXT) - $(LINK) $(test_realpath_OBJECTS) $(test_realpath_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_realpath_OBJECTS) $(test_realpath_LDADD) $(LIBS) test-scandir$(EXEEXT): $(test_scandir_OBJECTS) $(test_scandir_DEPENDENCIES) @rm -f test-scandir$(EXEEXT) - $(LINK) $(test_scandir_OBJECTS) $(test_scandir_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_scandir_OBJECTS) $(test_scandir_LDADD) $(LIBS) test-socket-af_unix-client$(EXEEXT): $(test_socket_af_unix_client_OBJECTS) $(test_socket_af_unix_client_DEPENDENCIES) @rm -f test-socket-af_unix-client$(EXEEXT) - $(LINK) $(test_socket_af_unix_client_OBJECTS) $(test_socket_af_unix_client_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_socket_af_unix_client_OBJECTS) $(test_socket_af_unix_client_LDADD) $(LIBS) test-socket-af_unix-server$(EXEEXT): $(test_socket_af_unix_server_OBJECTS) $(test_socket_af_unix_server_DEPENDENCIES) @rm -f test-socket-af_unix-server$(EXEEXT) - $(LINK) $(test_socket_af_unix_server_OBJECTS) $(test_socket_af_unix_server_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_socket_af_unix_server_OBJECTS) $(test_socket_af_unix_server_LDADD) $(LIBS) test-statfs$(EXEEXT): $(test_statfs_OBJECTS) $(test_statfs_DEPENDENCIES) @rm -f test-statfs$(EXEEXT) - $(LINK) $(test_statfs_OBJECTS) $(test_statfs_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_statfs_OBJECTS) $(test_statfs_LDADD) $(LIBS) test-statvfs$(EXEEXT): $(test_statvfs_OBJECTS) $(test_statvfs_DEPENDENCIES) @rm -f test-statvfs$(EXEEXT) - $(LINK) $(test_statvfs_OBJECTS) $(test_statvfs_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_statvfs_OBJECTS) $(test_statvfs_LDADD) $(LIBS) test-system$(EXEEXT): $(test_system_OBJECTS) $(test_system_DEPENDENCIES) @rm -f test-system$(EXEEXT) - $(LINK) $(test_system_OBJECTS) $(test_system_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_system_OBJECTS) $(test_system_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -368,22 +386,25 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-system.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< diff -Nru fakechroot-2.15/test/t/chroot.t fakechroot-2.16/test/t/chroot.t --- fakechroot-2.15/test/t/chroot.t 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/test/t/chroot.t 2011-12-11 12:05:34.000000000 +0000 @@ -5,8 +5,8 @@ prepare 12 -$srcdir/testtree.sh testtree/testtree -test "`cat testtree/testtree/CHROOT`" = "testtree/testtree" || bail_out "testtree/testtree" +$srcdir/testtree.sh testtree/testtree2 +test "`cat testtree/testtree2/CHROOT`" = "testtree/testtree2" || bail_out "testtree/testtree" for chroot in chroot fakechroot; do @@ -14,9 +14,9 @@ skip $(( $tap_plan / 2 )) "not root" else - for testtree in testtree /testtree ./testtree /./testtree testtree/. testtree/./.; do - t=`$srcdir/$chroot.sh testtree /usr/sbin/chroot $testtree /bin/cat /CHROOT` - test "$t" = "testtree/testtree" || not + for testtree in testtree2 /testtree2 ./testtree2 /./testtree2 testtree2/. testtree2/./.; do + t=`$srcdir/$chroot.sh testtree /usr/sbin/chroot $testtree /bin/cat /CHROOT 2>&1` + test "$t" = "testtree/testtree2" || not ok "$chroot chroot $testtree:" $t done fi diff -Nru fakechroot-2.15/test/t/cmd-subst.t fakechroot-2.16/test/t/cmd-subst.t --- fakechroot-2.15/test/t/cmd-subst.t 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/test/t/cmd-subst.t 2011-12-11 12:05:34.000000000 +0000 @@ -7,25 +7,25 @@ cmddir=`cd $srcdir; pwd`/t -t=`$srcdir/fakechroot.sh testtree /bin/pwd` +t=`$srcdir/fakechroot.sh testtree /bin/pwd 2>&1` test "$t" = "/" || not ok "fakechroot pwd [1] is" $t export FAKECHROOT_CMD_SUBST="/bin/pwd=$cmddir/cmd-subst-pwd.sh" -t=`$srcdir/fakechroot.sh testtree /bin/pwd` +t=`$srcdir/fakechroot.sh testtree /bin/pwd 2>&1` test "$t" = "substituted" || not ok "fakechroot pwd [2] is" $t export FAKECHROOT_CMD_SUBST="/no/file=foo:/bin/pwd=$cmddir/cmd-subst-pwd.sh" -t=`$srcdir/fakechroot.sh testtree /bin/pwd` +t=`$srcdir/fakechroot.sh testtree /bin/pwd 2>&1` test "$t" = "substituted" || not ok "fakechroot pwd [3] is" $t export FAKECHROOT_CMD_SUBST="/no/file=foo:/other/file=bar" -t=`$srcdir/fakechroot.sh testtree /bin/pwd` +t=`$srcdir/fakechroot.sh testtree /bin/pwd 2>&1` test "$t" = "/" || not ok "fakechroot pwd [4] is" $t diff -Nru fakechroot-2.15/test/t/popen.t fakechroot-2.16/test/t/popen.t --- fakechroot-2.15/test/t/popen.t 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/test/t/popen.t 2011-12-11 12:05:34.000000000 +0000 @@ -3,16 +3,7 @@ srcdir=${srcdir:-.} . $srcdir/common.inc -prepare 4 - -case "`uname -s`" in - Linux|GNU/kFreeBSD) - exe=exe;; - *) - exe=file;; -esac - -fakedir=`cd testtree; pwd -P` +prepare 2 for chroot in chroot fakechroot; do @@ -23,14 +14,6 @@ echo 'something' > testtree/$chroot-file echo "cat /$chroot-file" > testtree/$chroot-popen.sh - if [ ! -d /proc/1 ]; then - skip 1 "/proc filesystem not found" - else - t=`($srcdir/$chroot.sh testtree /bin/test-popen 'echo $$ > PID; while :; do sleep 1; done' &); sleep 3; pid=$(cat testtree/PID 2>&1); readlink /proc/$pid/$exe 2>&1; kill $pid 2>/dev/null` - test "$t" = "$fakedir/bin/sh" || not - ok "$chroot popen shell is" $t - fi - t=`$srcdir/$chroot.sh testtree /bin/test-popen ". /$chroot-popen.sh" 2>&1` test "$t" = "something" || not ok "$chroot popen returns" $t diff -Nru fakechroot-2.15/test/t/system.t fakechroot-2.16/test/t/system.t --- fakechroot-2.15/test/t/system.t 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/test/t/system.t 2011-12-11 12:05:34.000000000 +0000 @@ -3,34 +3,17 @@ srcdir=${srcdir:-.} . $srcdir/common.inc -prepare 4 - -case "`uname -s`" in - Linux|GNU/kFreeBSD) - exe=exe;; - *) - exe=file;; -esac - -fakedir=`cd testtree; pwd -P` +prepare 2 for chroot in chroot fakechroot; do if [ $chroot = "chroot" ] && ! is_root; then - skip 2 "not root" + skip $(( $tap_plan / 2 )) "not root" else echo 'something' > testtree/$chroot-file echo "cat /$chroot-file" > testtree/$chroot-system.sh - if [ ! -d /proc/1 ]; then - skip 1 "/proc filesystem not found" - else - t=`($srcdir/$chroot.sh testtree /bin/test-system 'echo $$ > PID; while :; do sleep 1; done' &); sleep 3; pid=$(cat testtree/PID 2>&1); readlink /proc/$pid/$exe 2>&1; kill $pid 2>/dev/null` - test "$t" = "$fakedir/bin/sh" || not - ok "$chroot system shell is" $t - fi - t=`$srcdir/$chroot.sh testtree /bin/test-system ". /$chroot-system.sh" 2>&1` test "$t" = "something" || not ok "$chroot system returns" $t diff -Nru fakechroot-2.15/test/t/test-r.t fakechroot-2.16/test/t/test-r.t --- fakechroot-2.15/test/t/test-r.t 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/test/t/test-r.t 2011-12-11 12:05:34.000000000 +0000 @@ -11,11 +11,11 @@ skip $(( $tap_plan / 2 )) "not root" else - echo "something" > testtree/tmp/$chroot-test-r.txt + echo "something" > testtree/$chroot-test-r.txt # /bin/dash uses stat64(2) and /bin/bash uses faccessat(2) - t=`$srcdir/$chroot.sh testtree ${SHELL:-/bin/sh} -c "test -r /tmp/$chroot-test-r.txt && echo ok || echo not ok" 2>&1` + t=`$srcdir/$chroot.sh testtree ${SHELL:-/bin/sh} -c "test -r /$chroot-test-r.txt && echo ok || echo not ok" 2>&1` test "$t" = "ok" || not ok "$chroot test -r is" $t fi diff -Nru fakechroot-2.15/test/testtree.sh fakechroot-2.16/test/testtree.sh --- fakechroot-2.15/test/testtree.sh 2011-09-28 20:20:00.000000000 +0000 +++ fakechroot-2.16/test/testtree.sh 2011-12-11 12:05:34.000000000 +0000 @@ -11,8 +11,13 @@ /bin \ /etc \ /lib \ + /lib/*-*-* \ /lib32 \ /lib64 \ + /usr/lib \ + /usr/lib/*-*-* \ + /usr/lib32 \ + /usr/lib64 \ /libexec \ /root \ /sbin \ @@ -20,8 +25,10 @@ /usr/bin \ /usr/lib \ /usr/sbin \ - /usr/local/bin + /usr/local/bin \ + /usr/local/lib do + test -d $d || continue mkdir -p $destdir/$d done @@ -55,14 +62,17 @@ '/bin/touch' \ '/usr/bin/basename' \ '/usr/bin/dirname' \ + '/usr/bin/env' \ '/usr/bin/find' \ '/usr/bin/id' \ + '/usr/bin/ischroot' \ '/usr/bin/less' \ '/usr/bin/ltrace' \ '/usr/bin/more' \ '/usr/bin/perl' \ '/usr/bin/readlink' \ '/usr/bin/seq' \ + '/usr/bin/sort' \ '/usr/bin/strace' \ '/usr/bin/touch' \ '/usr/sbin/chroot' \ @@ -95,12 +105,23 @@ 'libpthread.so.*' \ 'librt.so.*' \ 'libselinux.so.*' \ + 'libtinfo.so.*' \ 'libutil.so.*' \ 'linux-vdso.so.*' do - for a in '' 32 64 exec; do - fp="/lib$a/$p" - for f in $fp; do + for d in \ + /lib \ + /lib/*-*-* \ + /lib32 \ + /lib64 \ + /usr/lib \ + /usr/lib/*-*-* \ + /usr/lib32 \ + /usr/lib64 \ + /usr/local/lib + do + test -d "$d" || continue + for f in $d/$p; do cp -pf $PREFIX$f $destdir/$(dirname $f) 2>/dev/null done done