Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 38410 - Erroneous grep in the unipatch function of the kernel-2.eclass
Summary: Erroneous grep in the unipatch function of the kernel-2.eclass
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High major
Assignee: John Mylchreest (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-16 08:19 UTC by Andreas Vinsander
Modified: 2004-01-16 16:08 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to fix the grep in unipatch function (grep_fix.diff,429 bytes, patch)
2004-01-16 10:46 UTC, Andreas Vinsander
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Vinsander 2004-01-16 08:19:59 UTC
My distfiles are situated on a path where the chars "tar" is part, e.g. "ryttargarden/distfiles".

The unipatch functions uses a grep statement:
if [ -n "$(echo ${i} | grep -e ".tar" -e ".tbz" -e ".tgz")" ]
This will not work with a path as the above stated when unpacking a patch like "gentoo-sources-2.4.22-r5.patch.bz2" which isn't a tar archive.

The grep should have been something like this:
if [ -n "$(echo ${i} | grep -e "\.tar" -e "\.tbz" -e "\.tgz")" ]
Escapeing the dot (.) is essential!

/Andreas

Reproducible: Always
Steps to Reproduce:
1. Place your distfiles directory on a path where the chars "tar" is included and point it out to portage.
2. ebuild <some kernel ebuild with a patch that is not a tar archive> unpack

Actual Results:  
tar: This does not look like a tar archive 
tar: Skipping to next header 
tar: Archive contains obsolescent base-64 headers 
tar: Error exit delayed from previous errors 
Failed to 
unpack /usr/portage/portage.ryttargarden/distfiles/gentoo-sources-2.4.22-r5.patch.bz2 
<snip> 
!!! Function unipatch, Line 253, Exitcode 0 

Expected Results:  
Clean unpack of the kernel source of choice 

Portage 2.0.50_pre16 (default-x86-1.4, gcc-3.3.2, glibc-2.3.3_pre20031222-r0, 
2.4.22-gentoo-r4) 
================================================================= 
System uname: 2.4.22-gentoo-r4 i686 AMD Athlon(tm) XP 2200+ 
Gentoo Base System version 1.4.3.12 
distcc 2.12.1 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) 
[enabled] 
ccache version 2.3 [enabled] 
Autoconf: sys-devel/autoconf-2.59 
Automake: sys-devel/automake-1.7.8 
ACCEPT_KEYWORDS="x86 ~x86" 
AUTOCLEAN="yes" 
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer" 
CHOST="i686-pc-linux-gnu" 
COMPILER="gcc3" 
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" 
CXXFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer" 
DISTDIR="/usr/portage/portage.ryttargarden/distfiles" 
FEATURES="autoaddcvs ccache distcc sandbox" 
GENTOO_MIRRORS="http://ds.thn.htu.se/linux/gentoo http://gentoo.linux.no/ 
http://gentoo.oregonstate.edu/ 
http://www.ibiblio.org/pub/Linux/distributions/gentoo" 
MAKEOPTS="-j5" 
PKGDIR="/usr/portage/portage.ryttargarden/packages/arch/athlon-xp" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR="/usr/portage" 
PORTDIR_OVERLAY="" 
SYNC="rsync://portage.ryttargarden/gentoo-portage" 
USE="3dnow X alsa apm arts avi berkdb cdr crypt cups dvd emacs encode esd evms2 
foomaticdb gdbm gif gphoto2 gpm gtk2 imlib java jikes joystick jpeg kde libg++ 
libwww mad maildir mikmod mmx motif mozilla mpeg ncurses nls oggvorbis opengl 
oss pam pda pdflib perl png python qt quicktime readline scanner sdl slang 
spell sse ssl svga tcltk tcpd tiff truetype usb x86 xml2 xmms xv zlib"
Comment 1 Andreas Vinsander 2004-01-16 10:46:17 UTC
Created attachment 23939 [details, diff]
Patch to fix the grep in unipatch function
Comment 2 John Mylchreest (RETIRED) gentoo-dev 2004-01-16 16:00:46 UTC
thanks for pointing this out, a small oversight on my part :)
fixed in portage
Comment 3 John Mylchreest (RETIRED) gentoo-dev 2004-01-16 16:08:15 UTC
now in portage