UExtract-4.2

Miscellaneous tools
Post Reply
Message
Author
User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#16 Post by SFR »

mikeb wrote:I find with 7z sfs 3 and 4 are handled but symlinks do not extract correctly..you get a text file containing the path...not sure if that still applies but it is very handy to grab a file even on windows. I considered a workaround but as you mention unsquahfs is probably a better solution.
Yeah, if only 7z could handle symlinks and permissions better, most of other tools could go away!
mikeb wrote:I built a custom 7za as a static as I found 7z could not find its own shared library under xarchive.... wondered if you had any problems. The sources are quite modular/customizable so in my case I only included formats not covered by standard linux utilities. I also included rar into the static.
The full 7z included in Slacko works ok for me, can create/extract under xarchive (I just had to symlink 7z to 7za, as xarchive has only a wrapper for 7za).
mikeb wrote:One bonus bunny was having a standard format for use in xarchive so one wrapper could handle many formats. we all love 7zip :)
Yes, we do! :)
sc0ttman wrote:Also, techno made a start at at GUI for tar or something... How is uextract at listing archive contents before unpacking/mounting them?? .. If it can list contents of most filetypes too, then it might be a good project for a gtkdialog frontend..
Would be nice indeed, however I just checked and most of tools displays the contents of archives in a specifically formatted, unique way, so it'd be a nighmare to try to unify it. :lol:
sc0ttman wrote:Just a quick question, if I keep the static 7z bin i got in akita, will uextract still use exploderpm/rpm2cpio or would i need to remove 7z for that to workl??
Sure, you can keep it. :)
The sequence of use is 'exploderpm > 7z > rpm2cpio'.

Thanks guys &
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#17 Post by amigo »

exploderpm is a tool I put together -combining altered code from two other tools -it will also extract *.deb archives. It works for rpm's without using rpm2cpio -rpm2cpio fails for certain types of rpm's. It works for *.deb archives without using ar.

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#18 Post by SFR »

Hey Amigo

Thanks for the tip! Will be default also for .deb (dpkg-deb as a fallback) in the next version.

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#19 Post by don570 »

I put UEtract 1.1 in my rightclick menu utility

http://murga-linux.com/puppy/viewtopic. ... 872#720872

I'll try to keep it up-to-date in future.
______________________________________

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#20 Post by SFR »

Update, version 1.3

- exploderpm is now default tool for extracting .deb (dpkg-deb as a fallback)
- now can extract multiple audio/video streams from video files
- command line option '-l|--list' has been changed to '-f|--formats'
- added '-l|--list' option that lists contents of an archive, instead of extracting

@Sc0ttman: I implemented this, but like I said - the output varies very much!
Besides I'm not sure if UExtract will be useful as a backend for a GUI, since it's designed for "mass extraction", so it's "all or nothing" - won't unpack specific files from within an archive.
Anyway, feel free to tinker with the code.

BTW, I just noticed that exploderpm fails with some of .rpm pkgs, for example this one.
What's interesting, rpm2cpio can handle those, so I changed the order again to 'rpm2cpio > exploderpm > 7z'.
But this time they're in a chain - if first tool fails, next one is used, and so on.

First post updated!

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#21 Post by mikeb »

Oh the joy of 'what are they using for rpm this week'. disrpm used to be my regular ...nowadays throw 7zip at it and it seems to get there...better still avoid and use debs

Does you obsession with 'mass extraction' suggest you come from a long line of dentists?

mike

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#22 Post by SFR »

Yeah, apparently they must take great delight in making our life a bit more difficult...
Those .rpm are like a digital version of Lemarchand's box. :roll:
Does you obsession with 'mass extraction' suggest you come from a long line of dentists?
:lol:

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#23 Post by amigo »

"exploderpm fails with some of .rpm pkgs, for example this one. " Thanks for the heads up on that -and I've fixed it already. Seems fc20 is using 7z algorithm instead of xz -or at least signing the compressed objects as being 7z. The signature matches neither lzma or lzma2 -which is xz.

Here's the quick patch to exploderpm:

Code: Select all

--- ./exploderpm.00	2013-02-19 12:24:39.000000000 +0000
+++ ./exploderpm	2013-08-22 20:17:36.000000000 +0000
@@ -86,7 +86,7 @@
 		case "$comp" in
 			BZh)      dd if="$pkg" ibs=$o skip=1 2>/dev/null | bunzip2 | cpio --quiet -ivdm ;;
 			"$gz"*)   dd if="$pkg" ibs=$o skip=1 2>/dev/null | gunzip | cpio --quiet -ivdm ;;
-			"]"*)     dd if="$pkg" ibs=$o skip=1 2>/dev/null | unxz | cpio --quiet -ivdm ;;
+			"]"*|*"7z"*)     dd if="$pkg" ibs=$o skip=1 2>/dev/null | unxz | cpio --quiet -ivdm ;;
 			*)        echo "Unrecognized rpm file: $pkg"; return 1 ;;
 		esac
 	;;
@@ -94,7 +94,7 @@
 		case "$comp" in
 			BZh)      dd if="$pkg" ibs=$o skip=1 2>/dev/null | bunzip2 | cpio --quiet -t$VERBOSE ;;
 			"$gz"*)   dd if="$pkg" ibs=$o skip=1 2>/dev/null | gunzip | cpio --quiet -t$VERBOSE ;;
-			"]"*)     dd if="$pkg" ibs=$o skip=1 2>/dev/null | unxz | cpio --quiet -t$VERBOSE ;;
+			"]"*|*"7z"*)     dd if="$pkg" ibs=$o skip=1 2>/dev/null | unxz | cpio --quiet -t$VERBOSE ;;
 			*)        echo "Unrecognized rpm file: $pkg"; return 1 ;;
 		esac
 	;;

I was also able to handle the mentioned rpm" bash-4.2.45-4.fc20.i686.rpm" with this command:
rpm2cpio *.rpm |unxz |cpio -i -d

BTW, unlzma should not be necessary as xz should be able to handle old-style archives also. lzma(1) didn't have a really reliable way to detect the file magic.

Edit: I'll credit you for finding the problem when I next update exploderpm in src2pkg. Let's see, I saw your full name around here the other day...

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#24 Post by SFR »

Thanks, works for me too! :)
I was also able to handle the mentioned rpm" bash-4.2.45-4.fc20.i686.rpm" with this command:
rpm2cpio *.rpm |unxz |cpio -i -d
Interesting... This one doesn't work for me:

Code: Select all

# rpm2cpio bash-4.2.45-4.fc20.i686.rpm | unxz | cpio -id
unxz: (stdin): File format not recognized
cpio: premature end of archive
# 
Without unxz is ok. Maybe different versions..?

Code: Select all

# rpm2cpio --help
BusyBox v1.21.0 (2013-02-18 15:57:06 WST) multi-call binary.
Let's see, I saw your full name around here the other day...
Try here. :wink:

Thanks again &
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#25 Post by amigo »

Yeah, different rpm2cpio versions. I'm using the 'real' one, but not the latest.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#26 Post by musher0 »

And where would one find the full 7zip for Linux, please? Thanks in advance.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#27 Post by SFR »

musher0 wrote:And where would one find the full 7zip for Linux, please? Thanks in advance.
Hi Musher0, try in the PPM or here.
_______________

Update, version 1.4

Bugfix release...
After I changed the syntax of ffmpeg/avconv in v1.3, naturally I forgot to test it in Precise and of course (that damned Murphy!) it stopped working there.
Fixed and, this time, tested with several video formats in Slacko and Precise (and FatDog for sure).
Unfortunately in Akita, streams are not being extracted/copied, but re-encoded. Dunno how to fix it ATM.
EDIT: No, I just double-checked and it works ok in Akita, I only had a problem with .mkv file.

Also, the "rpm chain" has been complemented with 'rpm2cpio $ARCHPATH | unxz | cpio -idmv' for compatibility with full/older rpm2cpio.

First post updated!

Greetings!
Last edited by SFR on Fri 23 Aug 2013, 18:43, edited 1 time in total.
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#28 Post by pemasu »

UExtract-1.4 in test. The rox right click extract with your UExtract looks really great.

I downloaded ubuntu raring universe repo 7z: p7zip-full_9.20.1 deb

I tested tar.bz2 and it was extracted fine. But .deb extraction extracted just control files.

It can be that the p7zip-full_9.20.1.deb was not the right one. Just wanted to post my result. For me control file extraction is fine tool. You get the package dependencies from control file :)

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#29 Post by SFR »

Hey Pemasu, thanks for testing! :)

Hmm, UExtract fully unpacks all debs I have (not so many, ~5). So...where can I find that black sheep? :wink:

BTW, only exploderpm and dpkg-deb are utilized for .deb.
The control files are thanks to exploderpm; dpkg won't extract them.

EDIT: Actually, 7z is rather optional, only necessary if you really need to handle some of these:
*.7z|*.exe|*.dll|*.cpl|*.scr|*.cb7|*.arj|*.cab|*.lza|*.lha|*.lzh|*.mobi|*.xrns|*.wim|*.chm|*.msi|*.dmg|*.vhd|*.fat|*.nsis|*.swm|*.zipx|*.crx|*.tar.7z|*.cpio.7z|*.a|*.ar| ...and finally *.rpm (if nothing else helps).
The rest is "7zip-free". :wink:

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#30 Post by amigo »

You can also use 'ar' and pipe through gzip/bzip2/xz to just extract the data and not the control. Hmm, I don't find example syntax right now, but it's fairly simple -except for needing to find out which compression method was used, which wastes some time. The exploderpm way is maybe faster. But, anyway, you could have third use-case with ar+decompressor.

I still want to look at your code -although I think you've gone overboard, by now, with what the thing should do -ripping/decoding video/audio would be more appropriate for other tools -IMO.

As an archiving tool, I use an AppDir which I created. My AppDirs are usually drag-n-drop oriented, so if you drop an archive on it, it naturally decompresses it. But, if you drop a file or folder on it, then it offers you options for archive creation. Since I work with tons of sources it is very handy -but it is limited to the most-used archives types for such content.

The 'real' 7-tip is a windows-only, but open-source, program. The homepage links to the '7z' project for linux/bsd support.

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#31 Post by SFR »

For gzip'ed .deb, this works for me:

Code: Select all

# ar t ttyrec_1.0.8-5_i386.deb 
debian-binary
control.tar.gz
data.tar.gz
#
# ar p ttyrec_1.0.8-5_i386.deb data.tar.gz | tar xzvf -
./
./usr/
./usr/bin/
./usr/bin/ttyrec
./usr/bin/ttyplay
./usr/bin/ttytime
./usr/share/
./usr/share/doc/
./usr/share/doc/ttyrec/
./usr/share/doc/ttyrec/README
./usr/share/doc/ttyrec/copyright
./usr/share/doc/ttyrec/examples/
./usr/share/doc/ttyrec/examples/sample1.tty.gz
./usr/share/doc/ttyrec/changelog.Debian.gz
./usr/share/man/
./usr/share/man/man1/
./usr/share/man/man1/ttyrec.1.gz
./usr/share/man/man1/ttyplay.1.gz
./usr/share/man/man1/ttytime.1.gz
./usr/lib/
./usr/lib/mime/
./usr/lib/mime/packages/
./usr/lib/mime/packages/ttyrec
# 
But the bad thing is that 'ar' is not in the main .sfs, only in the devx, so I hesitate to give it more scope.
And that's why I use 7z (but only if ar's not there) also for *.a and *.ar.
I still want to look at your code -although I think you've gone overboard, by now, with what the thing should do -ripping/decoding video/audio would be more appropriate for other tools -IMO.
TBH, I too feel it's extravagance, but seeking and adding new formats was (I think there's not much left to be added, what could work OOTB in Slacko) like a drug - I couldn't stop myself. :wink:
BTW, it only do extract streams from within a container, not (en|de)codes them.

As for your AppDir, is it available somewhere?
This link is down.

Thanks &
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#32 Post by amigo »

Code: Select all

ar p ttyrec_1.0.8-5_i386.deb data.tar.gz | tar xzvf -
Trouble is that newer debs have data.tar.xz, so:

Code: Select all

ar p ttyrec_1.0.8-5_i386.deb data.tar.xz | tar xJvf -
I'll just attach a copy of my AppDir since it is small -just a couple of scripts in there(disrpm is unused but left to rest there...)

You won't be able to use the AppDir, though, unless you have Xdialog, gtk-shell and greq all installed -I was fiddling around with vearious UI builders...

Still, you may be able to glean some ideas from it. I've been threaening to re-write it for years, but I use it more than any other 'utility' application on my system.

Another thing I rather dislike is including binaries in an AppDir without the sources. Mine is simply a wrapper for tools which should be available. One really should check to see if the decompressor is available or warn and quit. And, checking the file-type could be done another way -I check archives using 'file' instead of relying on the file suffix.
Attachments
ZipZap-1.7.tar.bz2
Copy of ZipZap with modified exploderpm
(7.73 KiB) Downloaded 895 times

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#33 Post by SFR »

Thank you! I like how it looks & works. Very nice. :)
Xdialog is OOTB in most (all?) of Puppies these days and it seems that only greq is necessary - couldn't find any reference to 'get_dest_dir()', where gtk-shell is used.
I attached .pet of greq if anyone would also like to play with it.

Greetings!
Attachments
greq-0.9.4.pet
(8.78 KiB) Downloaded 887 times
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#34 Post by pemasu »

Here is the .deb I tested. Of course I should have tested several of them.
Pure Ubuntu Raring repositories .debs seems to extract both control files and the package installable content. Which is great. I do like that I can check the control files included postinst script commands and the control file dependencies list.

Thanks.

https://launchpad.net/~rvm/+archive/ppa ... 1_i386.deb

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#35 Post by SFR »

Thanks, now I can see the possible culprit:

Code: Select all

# ar t smplayer_0.8.5-1~raring1_i386.deb 
debian-binary
control.tar.gz
data.tar.lzma
# 
@Amigo: can we assume it's because of .lzma?

Ok, since I'd like to preserve exploderpm as primary tool for .deb (for those extra control files), I'll rig up some workaround for the next version, e.g. this ugly one seems to work well:

Code: Select all

# [ `exploderpm -l smplayer_0.8.5-1~raring1_i386.deb | grep '^./$' | wc -l | cut -f1 -d ' '` -eq 2 ] && echo "Use exploderpm" || echo "Use dpkg-deb"
Use dpkg-deb
# 
# [ `exploderpm -l ttyrec_1.0.8-5_i386.deb | grep '^./$' | wc -l | cut -f1 -d ' '` -eq 2 ] && echo "Use exploderpm" || echo "Use dpkg-deb"
Use exploderpm
# 
@Pemasu: I attached uextract with this fix (real .gz, script only, goes to /usr/local/bin & chmod +x), so if you'd like to test it in spare time, would be nice. :)

Greetings!
Attachments
uextract.gz
(4.94 KiB) Downloaded 897 times
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

Post Reply