Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 25 Oct 2014, 16:55
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
UExtract-3.5 for (mainly, but not only) Slacko
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 3 of 8 Posts_count   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8 Next
Author Message
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Fri 23 Aug 2013, 11:35    Post_subject:  

For gzip'ed .deb, this works for me:
Code:
# 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.

Quote:
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!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send_private_message 
amigo

Joined: 02 Apr 2007
Posts: 2261

PostPosted: Fri 23 Aug 2013, 13:37    Post_subject:  

Code:
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:
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.
ZipZap-1.7.tar.bz2
Description  Copy of ZipZap with modified exploderpm
bz2

 Download 
Filename  ZipZap-1.7.tar.bz2 
Filesize  7.73 KB 
Downloaded  204 Time(s) 
Back to top
View user's profile Send_private_message 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Fri 23 Aug 2013, 14:45    Post_subject:  

Thank you! I like how it looks & works. Very nice. Smile
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!
greq-0.9.4.pet
Description 
pet

 Download 
Filename  greq-0.9.4.pet 
Filesize  8.78 KB 
Downloaded  199 Time(s) 

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send_private_message 
pemasu


Joined: 08 Jul 2009
Posts: 5463
Location: Finland

PostPosted: Fri 23 Aug 2013, 16:03    Post_subject:  

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/+build/4561688/+files/smplayer_0.8.5-1%7Eraring1_i386.deb
Back to top
View user's profile Send_private_message 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Fri 23 Aug 2013, 17:54    Post_subject:  

Thanks, now I can see the possible culprit:
Code:
# 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:
# [ `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. Smile

Greetings!
uextract.gz
Description 
gz

 Download 
Filename  uextract.gz 
Filesize  4.94 KB 
Downloaded  200 Time(s) 

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send_private_message 
musher0


Joined: 04 Jan 2009
Posts: 4258
Location: Gatineau (Qc), Canada

PostPosted: Fri 23 Aug 2013, 20:55    Post_subject:  

Hello, SFR.

p7zip is not in the wary 5.5 PPM, but I did have a copy of a p7zip-9.13 pet.
I then downloaded your UExtract-1.14 and everything works fine on this
wary 5.5.

May I suggest a cosmetic change in line 12 of your AppRun, like so:

Code:
xterm +tr -bg black -rv -T UExtract -e /tmp/uextract_exec -o "$CUSTOMDIR" "$@"


The "+tr" will override any transparency which may have been set in .urxvtrc,
the "-bg black" will accentuate the contrast and finally the "-rv" will produce a very readable listing on whitish background. (Please see picture.)

It's just a suggestion of course.

As to the "_extracted" ending added the extracted folder, I find it quite ugly, Embarassed
but it is obviously safer! Laughing The user can always remove the ending if necessary.

That said... job well done!

BFN.

musher0
UExtract-terminal.jpg
 Description   
 Filesize   19.94 KB
 Viewed   337 Time(s)

UExtract-terminal.jpg


_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send_private_message Visit_website 
pemasu


Joined: 08 Jul 2009
Posts: 5463
Location: Finland

PostPosted: Sat 24 Aug 2013, 01:14    Post_subject:  

SFR. It works now. Thanks.
Back to top
View user's profile Send_private_message 
amigo

Joined: 02 Apr 2007
Posts: 2261

PostPosted: Sat 24 Aug 2013, 03:43    Post_subject:  

"_extracted" I meant to comment about this, as I don't like the idea either. Archives should usually extract to their natural name -that is, the name of the archive minus the suffix(es). However, this is not always the case -even with archives like tar which can tell you if there is a toplevel dir.

In my src2pkg program, I go to great lengths to avoid 'tar bombs' being unpacked without a toplevel dir. Surely you've all had the experience of opening a (usually) *.zip archive and having ti spread lots of files into the current directory. Really messy if you happen to do that where there are already lots of files. Sad
The solution is to create the directory arbitrariy and cd in there to unpack the archive. But, then you have to figure out if there already was a 'topdir' in the archive, and if so, then cd in there and move everything up one level, back out and remove that dir. It really is messy. The alternative is to list the archive beforehand and try to figure out if it has a topdir -again messy because of the difficulty of listing and variance in the output for various archive types. This is one of the reasons I have never re-written ZipZap because a *really* sane needs better intermediate functionality -which is easier to implement before adding support for a bunch of archive types.

I also like seeing the control files in *.deb archives, so my tools usually unpack them.

My AppDir does illustrate a more featureful use of AppDirs. The RISC environement was drag-n-drop oriented and with a view from the users HOME dir. The idea was, the user knows where his files are (in HOME) and usually is running things from there. So, instead of having the user start an application and then use it's file-selector to browse to his HOME dir, find the file and open it -instead, the user simply grabs the file in question and drops into the app that he wants to open it with.

On my system, I only have left-click actions set for a couple of different file types. Since one doesn't always want to do the same thing with a file: for instance, an *.html file, I drop it onto an html editor icon or a browser icon according to what I want to do. Of course, there are options like SendTo, etc., which achieve a similar variety of options or using a GUI tool which provides the options when left-clicking. Still, if you really want to understand why rox does things differently, you need to look at it from this other perspective.

As far as I know, most of the AppDirs used in Puppy do not take advantage of the extra features of them -like the menu entries which can be created in the AppInfo.xml file.
Back to top
View user's profile Send_private_message 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Sat 24 Aug 2013, 07:42    Post_subject:  

RE: "_extracted"

Well, I don't particularly like it either, but I've chosen it as a necessary evil.
Better than fun with deleting hundreds or thousands junk files out of $HOME.
I, too, was thinking about the way of resolving it in some nicer manner, but it's a pure mess indeed.
Actually, something like this could be quite decent solution:

IF
- destination dir (which is "archive_name" without suffix(es)) contains only one and only a subdir
AND
- destination dir's name is exactly the same as its subdir's name
THEN
- rename subdir to sth rare (in case if inside is also a dir named like that)
- move all stuff from subdir one level up
- delete empty subdir


But what if the destination dir already exists or we're extracting identically named archive.tar, archive.zip, archive.rar and so on, at the same time (remember? - "mass extraction" Wink )?
We'll end up with archive, archive(1), archive(2), which is IMHO even worse than archive.tar_extracted, archive.zip_extracted.
Ahh, I'll leave it alone for now...
_____________

musher0 wrote:
May I suggest a cosmetic change in line 12 of your AppRun, like so:
Code:
xterm +tr -bg black -rv -T UExtract -e /tmp/uextract_exec -o "$CUSTOMDIR" "$@"

The "+tr" will override any transparency which may have been set in .urxvtrc,
the "-bg black" will accentuate the contrast and finally the "-rv" will produce a very readable listing on whitish background. (Please see picture.)

Unfortunately this would break compatibility with other terminal emulators than urxvt, e.g. rxvt (won't accept e.g. '+/-tr' parameter) and others, depending which one gets called by xterm.
I tried to:
Code:
echo -e '\e[30;107m'; clear

but this in turn breaks the output in "real" terminal/console.
_____________

@Pemasu: thanks for confirmation!

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send_private_message 
mikeb


Joined: 23 Nov 2006
Posts: 8368

PostPosted: Sat 24 Aug 2013, 10:28    Post_subject:  

Hmm one thing that occured to me is that on windows 7zip will list content directory by directory.....

On linux the list output includes every file and its path and I see no direct way of achiving the windows like result directly with 7z(a). Searching suggests that a bit of scripting is needed either to produce a tree or folder by folder output. Producing a tree output is covered but not found anything for folder traversal.

One to consider when dealing with an archive with 20,000 files and something I would like to throw at xarchive and it may be beneficial here.

If I am not being clear, opening my 20,000 file archive shows 10 files and 10 top level folders on windows 7zip...I can then browse down the folders or extract as required.

Any thoughts and suggestions welcome.

mike
Back to top
View user's profile Send_private_message 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Sat 24 Aug 2013, 13:12    Post_subject:  

If it comes for browsing archives (or extracting specific files) I switched to File Roller long time ago.
Supports 7z very well.
PeaZip also isn't bad...
_____________

Update, version 1.5

- fixed: problems with some .deb pkgs
- added: warning msg if given extraction tool isn't installed
- some minor corrections

First post updated!

Ok, I think that's it (for now). I need a break anyway. Wink

Thank you all &
Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send_private_message 
amigo

Joined: 02 Apr 2007
Posts: 2261

PostPosted: Sat 24 Aug 2013, 13:33    Post_subject:  

"But what if the destination dir already exists or we're extracting identically named archive.tar" Most extractors will overwrite existing files by default. Some, at least, are configurable from cli options.

"contains only one and only a subdir" & "move all stuff from subdir one level up" This is basically what I do in src2pkg, although most compressors will show us a listing -but it can still be hard to tell if a toplevel is really the top -and top of where? An archive which is an installable package may have no toplevel, but include several subdirs.
Heuristics would suggest that *.zip, *.rar and any formats commonly found on windows machines would be more likely to be a tar 'bomb. It also suggests that archives named like this: *.tar.gz are less likely to be 'tar bomb' than those with names like: *.tgz
Back to top
View user's profile Send_private_message 
mikeb


Joined: 23 Nov 2006
Posts: 8368

PostPosted: Sun 25 Aug 2013, 07:26    Post_subject:  

Thanks SFR .. Its fun to get carried away Smile

regards

Mike
Back to top
View user's profile Send_private_message 
amigo

Joined: 02 Apr 2007
Posts: 2261

PostPosted: Mon 26 Aug 2013, 09:36    Post_subject:  

@SFR, I had a pretty long look yesterday at your code and I've gotta say it looks pretty good! Very readable -nicely indented, etc.
I did see a couple of rough spots though -I'll post a diff a little later with a fix or two.

I can see the logic in supporting filesytem images, like *.iso and *.sfs files, but I really think you ought to pull the video/audio/pdf stuff out of the tool. An archiver is usually meant to work with groups of archived/compressed files. The audi/video features would go nicely in their own little utility and pdf/other document tools could go elsewhere.

Then you might look at incorporating ideas from ZipZap for handling dropping files/dirs onto the AppDir.
Back to top
View user's profile Send_private_message 
mikeb


Joined: 23 Nov 2006
Posts: 8368

PostPosted: Mon 26 Aug 2013, 13:00    Post_subject:  

Quote:
Very readable -nicely indented, etc.


Someone should buy Barry a 'tab' key for christmas Very Happy

mike
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 3 of 8 Posts_count   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1080s ][ Queries: 12 (0.0080s) ][ GZIP on ]