If the TMPDIR environment variable is set then the gentoo-sources-2.4.20-r5 ebuild fails during the "unpack" stage Reproducible: Always Steps to Reproduce: 1. export TMPDIR="~/tmp" 2. emerge gentoo-sources Actual Results: ... Current kernel version is 2.4.20 Scanning patch directory: '.' Checking 000_o1_pe_ll_030412_ck_2.4.20 (plain text format)... patch: **** Can't create file '~/tmp/ppcIo0jQ' : No such file or directory cat: write error: Broken pipe can't be applied. Please modify the patch. !!! ERROR: sys-kernel/gentoo-sources-2.4.20-r5 failed. !!! Function kernel_src_unpack, Line 83, Exitcode 1 !!! Addpatches failed, bad KERNEL_EXCLUDE? Expected Results: Applied Gentoo patches to the vanilla kernel This is a showstopper for people who have TMPDIR set and don't know why they are getting errors. Here's the output I get from emerge info: Portage 2.0.48-r1 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1) ================================================================= System uname: 2.4.20-gentoo-r3 i686 AMD Athlon(tm) XP 2000+ GENTOO_MIRRORS="http://localhost ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo" CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /var/bind /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/config" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" PORTDIR="/usr/portage" DISTDIR="/usr/portage/distfiles" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR_OVERLAY="" USE="x86 oss apm avi crypt encode gif jpeg libg++ libwww mikmod mmx ncurses nls pdflib png quicktime spell truetype xml2 xmms xv zlib gdbm berkdb slang readline arts bonobo svga tcltk java guile X sdl gpm tcpd pam ssl perl python esd imlib oggvorbis motif opengl mozilla scanner dga cups usb qt kde gtk gnome 3dnow mpeg mysql dvd" COMPILER="gcc3" CHOST="i686-pc-linux-gnu" CFLAGS="-O2 -mcpu=athlon-xp -march=athlon-xp -fomit-frame-pointer -falign-functions=4 -pipe -mmmx -m3dnow" CXXFLAGS="-O2 -mcpu=i686 -pipe" ACCEPT_KEYWORDS="x86 ~x86" MAKEOPTS="-j2" AUTOCLEAN="yes" SYNC="rsync://rsync.us.gentoo.org/gentoo-portage" FEATURES="sandbox ccache"
Apparantly, this bug was more widespread and not gentoo-sources specific... Other patched packages fail too, including gcc, xfree, binutils, vim, gpm, and lynx.
this is not a gentoo-sources bug. looks like addpatches... who maintains that package? Jay
This is a user error. We can't fix everything that can be broken. TMPDIR is more than likely not doing expansion on the value it contains. Set it to a real path and make sure that path has sane build-rights. Unless someone takes interest, I will close this bug Invalid.
Having TMPDIR set is a user error? Certainly not! This turned out to be a really simple problem with a really simple fix. The change should be made in ebuild.sh. Search for "TMPDIR" in this file. As you see, this problem has already been fixed for the "compile" and "install" stages. Simply copy the two environment assignments (and comments) into the dyn_unpack() function before src_unpack() is called. I have tested this fix and it works perfectly. Frankly, I consider this a crucial bug - affecting practically everyone who uses TMPDIR. BTW, A better fix would be to place the code at a global level before any of the dyn_* functions are called, removing the need for several copies.
TMP and TMPDIR moved to ${T} as in dyn_compile fixed in cvs