Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 174910

Summary: portage unpack() function uses only file extension
Product: Gentoo Linux Reporter: jieryn <jieryn>
Component: [OLD] Core systemAssignee: Portage team <dev-portage>
Status: RESOLVED WONTFIX    
Severity: enhancement CC: mmokrejs
Priority: High    
Version: 2006.0   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info

Description jieryn 2007-04-17 14:09:07 UTC
The unpack() function for ebuilds does not take into account the actual file type when determining if it can unpack one of its parameters. I have a binary blob ebuild I'm writing for in house solution and upstream will not rename one of their tar files away from .pdb extension. Unfortunately, unpack silly.pdb, even after it has been properly fetched via SRC_URI, fails.

$ file /usr/portage/distfiles/us-prod-profile-linux.pdb
/usr/portage/distfiles/us-prod-profile-linux.pdb: POSIX tar archive (GNU)

unpack "us-prod-profile-linux.pdb" yields:

unpack us-prod-profile-linux.pdb: file format not recognized. Ignoring.

I would request that unpack be more lenient for its unpacking criteria. Thanks!

Reproducible: Always



Expected Results:  
unpack can handle anything which `tar` can
Comment 1 jieryn 2007-04-17 14:09:27 UTC
Created attachment 116508 [details]
emerge --info
Comment 2 Togge 2007-04-17 14:44:13 UTC
How about using something similar to this in the ebuild?
src_unpack() {
	myA=${A%.*}.tar
	mv ${DISTDIR}/${A} ${DISTDIR}/${myA}
	unpack ${myA}
}
Comment 3 jieryn 2007-04-17 15:10:24 UTC
This would cause refetch of the .pdb every time.
Comment 4 Togge 2007-04-17 15:18:26 UTC
Then use cp, I was just pointing to the fact that you can manipulate the file before unpack.
Comment 5 jieryn 2007-04-17 15:23:47 UTC
Yep, that is the work around I'm using now.

I beleive that unpack can, and should, be smarter about prematurely bailing out of an unpack operation. Running `file` on the parameter would quickly show that we're dealing with a GNU archive and are eligible for processing from unpack.
Comment 6 SpanKY gentoo-dev 2007-04-17 23:36:39 UTC
i dont see much value in the over head needed in order to properly detect a file by ignoring its suffix ...

just symlink it:
ln -s ${DISTDIR}/${A} ${A}.tar
unpack ./${A}.tar
Comment 7 Jakub Moc (RETIRED) gentoo-dev 2008-02-20 13:49:02 UTC
*** Bug 210878 has been marked as a duplicate of this bug. ***