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 Sun 20 Apr 2014, 21:50
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
View contents of .pet or .deb packages
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [14 Posts]  
Author Message
cimarron

Joined: 30 May 2013
Posts: 51

PostPosted: Mon 18 Nov 2013, 11:15    Post subject:  View contents of .pet or .deb packages  

Sometimes I want to see what's in a pet (or deb) package before installing it. It's not hard to do manually, but takes a few steps. These scripts streamline the process, creating and opening a temporary directory with the package contents so you can see what's there (and install parts of it manually, if desired).

I found this "pet2dir" script in a thread by koulaxizis, I believe, but I can't find it now:
Code:
#!/bin/sh
#Tman
clear
mkdir -p /tmp/pet
cp -f "$@" /tmp/pet 2>/dev/null
cd /tmp/pet
pet2tgz *.pet
tar -x -f *.gz
rm /tmp/pet/*.gz
echo "Done converting:"
ls
spacefm /tmp/pet 2>/dev/null

The last line opens the directory in your file manager (SpaceFM in my case). Change spacefm to rox or whatever FM you use, save the script in, say, /usr/local/bin, and give it execute permissions. It uses pet2tgz, which I think is standard in pups (in /usr/bin), but I'll attach it below for anyone that might not have it.

The "deb2dir" script I just made based on the pet script:
Code:
#!/bin/sh

clear
mkdir -p /tmp/deb
cp -f "$@" /tmp/deb 2>/dev/null
cd /tmp/deb
dpkg-deb -x *.deb /tmp/deb
rm /tmp/deb/*.deb
echo "Done extracting:"
ls
spacefm /tmp/deb 2>/dev/null

Again, the last line opens the directory in your file manager (SpaceFM in my case). Change spacefm to rox or whatever FM you use, save the script in, say, /usr/local/bin, and give it execute permissions. This uses dpkg-deb, which I think is standard in pups (in /usr/bin), but I'll include it below for anyone that might not have it.

I added these scripts to the right-click menu in my SpaceFM, or they could be used from the command line, followed by the filename of the pet or deb package.
deb2dir.tar.gz
Description 
gz

 Download 
Filename  deb2dir.tar.gz 
Filesize  234 Bytes 
Downloaded  125 Time(s) 
pet2dir.tar.gz
Description 
gz

 Download 
Filename  pet2dir.tar.gz 
Filesize  244 Bytes 
Downloaded  128 Time(s) 
extras.tar.gz
Description  contains pet2tgz and dpkg-deb
gz

 Download 
Filename  extras.tar.gz 
Filesize  49.16 KB 
Downloaded  132 Time(s) 
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 7197

PostPosted: Mon 18 Nov 2013, 12:11    Post subject:  

If you have Xarchive you can add .pet to its archive list in the tar wrapper (and to pupzip) then it will open pets like any other archive which I find convenient.

mike
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2169

PostPosted: Mon 18 Nov 2013, 14:39    Post subject:  

Those are both really 'expensive' utilities -needlessly extrcaing the archive and then listing it.

For a pet, simply do:
Code:
tar --use-compress-program=gzip -tf $1 2>/dev/null


You'll have to check for debs, but this:
Code:
dpkg-deb -l $1
should work.

You might call them 'lspet' and 'lsdeb' respectively.
Back to top
View user's profile Send private message 
cimarron

Joined: 30 May 2013
Posts: 51

PostPosted: Mon 18 Nov 2013, 17:54    Post subject:  

I find it useful to extract the packages (not just list their contents) because sometimes I want to manually install parts of the package, or take a script out and edit it, etc.
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2169

PostPosted: Tue 19 Nov 2013, 02:25    Post subject:  

Well, the title of the thread says 'view content', not extract.
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 7197

PostPosted: Tue 19 Nov 2013, 07:56    Post subject:  

600 pixels makes for slim GUI's ...does debs too.

mike
xarchive.png
 Description   
 Filesize   74.65 KB
 Viewed   592 Time(s)

xarchive.png

Back to top
View user's profile Send private message 
watchdog

Joined: 28 Sep 2012
Posts: 431

PostPosted: Wed 20 Nov 2013, 07:20    Post subject:  

I always install peazip which can open and extract file from a large variety of archives. I use the linux portable for Gtk version from:

http://peazip.org/

In wary the Gtk version does not work and I use the Qt version with the qt-4.7.1.sfs loaded:

http://www.4shared.com/file/Fs1zcssq/qt-471.html

You have to copy from peazip folder the Qt4pas.so in /opt/qt4/lib and create to it in the same folder a symlink named Qt4pas.so.5.
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 7197

PostPosted: Wed 20 Nov 2013, 13:12    Post subject:  

Quote:
In wary the Gtk version does not work

what is that missing...I have peazip running on some pretty old distros? Just curious.
Peazip is a bit of a lump but wins for browsing say a pup_xxx.sfs. I can do it in xarchive using 7za backend but of course it displays every file rather than just one level so is s-l-o-w. Its like the windows equivalent...super fast for grabbing a file from an sfs....and can even browse down into initrds.... simpler than on linux that one Very Happy

Back to topic... yes I agree to simply view contents unpacking seems a little odd...ok if small, but large archives such as sources can get messy.

Sorry cimarron if you got the wrong sort of attention here..... it happens sometimes.

mike
Back to top
View user's profile Send private message 
cimarron

Joined: 30 May 2013
Posts: 51

PostPosted: Wed 20 Nov 2013, 13:34    Post subject:  

As I said, I often like to do more than just look, so extracting makes sense for me. I'll pull out the parts I want and install them manually, or edit a script before installing, etc.

I like xarchiver a lot. These pet and deb scripts are nice for quick one-click access to the package contents, though. And there's no cleaning up when you're done messing with the extracted contents, since the scripts open the packages in a tmp directory.
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Wed 20 Nov 2013, 13:46    Post subject:  

watchdog wrote:
I always install peazip which can open and extract file from a large variety of archives. I use the linux portable for Gtk version from:

http://peazip.org/

In wary the Gtk version does not work and I use the Qt version with the qt-4.7.1.sfs loaded:

http://www.4shared.com/file/Fs1zcssq/qt-471.html

You have to copy from peazip folder the Qt4pas.so in /opt/qt4/lib and create to it in the same folder a symlink named Qt4pas.so.5.


Hi, watchdog.

You know of UExtract and PackIt, don't you, from Puppy member SFR?
They are as efficient and do the same as Peazip in about 1/4 of the size.
And they don't need the Qt libs.

Best regards.

musher0

_________________
"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 poster's website 
musher0


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

PostPosted: Fri 22 Nov 2013, 02:08    Post subject:  

Hello again, cimarron.

The above-mentioned resources are here:
UExtract : http://murga-linux.com/puppy/viewtopic.php?t=87864
PackIt : http://murga-linux.com/puppy/viewtopic.php?t=89211

BFN.

musher0

_________________
"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 poster's website 
cimarron

Joined: 30 May 2013
Posts: 51

PostPosted: Fri 22 Nov 2013, 08:51    Post subject:  

I'm happy with Xarchiver. And the scripts I posted above work great for extracting and examining pet and deb packages (at least the smaller ones I use most of the time). I can run them with a click from within SpaceFM, quicker and easier than using a separate archiver application.
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 7197

PostPosted: Fri 22 Nov 2013, 09:38    Post subject:  

Quote:
They are as efficient and do the same as Peazip in about 1/4 of the size.

well they do not descend through folder hierarchies as I mentioned which to me it the raison d'etre of using peazip over smaller extractors and saves a lot of time with large archives. Try wading through 5000 files in a gtk interface after its taken 2 minutes to load.

mike
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Fri 22 Nov 2013, 16:28    Post subject:  

mikeb wrote:
Quote:
They are as efficient and do the same as Peazip in about 1/4 of the size.

well they do not descend through folder hierarchies as I mentioned which to me it the raison d'etre of using peazip over smaller extractors and saves a lot of time with large archives. Try wading through 5000 files in a gtk interface after its taken 2 minutes to load.

mike


True.

_________________
"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 poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [14 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0733s ][ Queries: 13 (0.0084s) ][ GZIP on ]