Created attachment 342860 [details, diff] unpacker.eclass.diff proposal attached, maybe you want to do the error handling different
Comment on attachment 342860 [details, diff] unpacker.eclass.diff i'm not seeing the usefulness of this, and it can be accomplished with `unpack` ln -s "${DISTDIR}/fooblahblah" file.zip unpack ./file.zip
that does not work unless you do: nonfatal unpack ./file.zip which disables error handling completely
(In reply to comment #2) the code really doesn't explain that. the focus on "self extracting" is noise. you can make note in the description that this is useful in that scenario. call the func "unpack_zip", and document clearly what the point is -- to ignore non-fatal warnings drop the `type` check. the latter $? check will catch that case. add a call to unpack_banner before you actually do the unpack. you should also pass along the -o flag. update _unpacker to call this for *.zip files. finally, you can convert some existing packages like games-fps/etqw-demo. have it inherit 'unpacker', and call unpack_zip manually. you can update games-fps/ut2004-muralis by inheriting 'unpacker', and deleting src_unpack entirely. i'm sure there's other games examples.
unfortunately: _unpacker() { [...] assert "unpacking ${a} failed (comp=${comp} arch=${arch})" } This function call would cause failure in the example of games-fps/ut2004-muralis if we remove src_unpack, however calling unpack_zip directly would work ofc. We could add a check for that assert call and skip it if we have arch="unpack_zip"? However that means changing the default behavior of the eclass regarding .zip files.
Created attachment 342948 [details, diff] unpacker.eclass.diff proposal
Created attachment 342950 [details, diff] unpacker.eclass.diff typo
Comment on attachment 342950 [details, diff] unpacker.eclass.diff >+# This function has an error tolerance of 1 by default. this sentence doesn't make sense. rephrase it to say: # This function ignores all non-fatal errors (i.e. warnings). # That is useful for zip archives with extra crap attached # (e.g. self-extracting archives). >- assert "unpacking ${a} failed (comp=${comp} arch=${arch})" >+ # respect special error handling of unpack_zip >+ [[ ${arch} == "unpack_zip" ]] || assert "unpacking ${a} failed (comp=${comp} arch=${arch})" err, no. fix the unpack_zip code so it returns 0 normally. [[ $? -le 1 ]] || die "unpacking ${zip} failed"
Created attachment 342992 [details, diff] unpacker.eclass.diff ah, I understand now :D
Comment on attachment 342992 [details, diff] unpacker.eclass.diff >+# @USAGE: <one selfzip file> i would use "<zip file>" and be done w/this change, does converting those other game ebuilds work as suggested ? if so, feel free to commit (with that comment fix) and update those games as well as any others you find ...
+ 23 Mar 2013; Julian Ospald <hasufell@gentoo.org> unpacker.eclass: + add unpack_zip function to unpacker.eclass wrt #462612