Help - Search - Members - Calendar
Full Version: ipkg question
OESF Forums > General Forums > General Support and Discussion > Software
waalkman
Suppose I want to view the contents of a .ipk prior to installing it. Running "ipkg files xxx.ipk" seems to do something, but doesn't display anything to the screen.

Once the file is installed I could view it in /usr/lib/ipkg/info/xxx.list if I liked, but I'd like to be able to view the contents beforehand.


Any thoughts?


Thanks,

John
vinc17
These are just tar archives compressed with gzip. So, you could use tar and gzip recursively. Perhaps someone has already written a script to do that?
lardman
QUOTE
Running "ipkg files xxx.ipk" seems to do something


I think this only works for installed files.

You'll have to write something, as vinc17 suggests, to ge the functionality you want. This would be a useful tool, if you write it please post it.


Simon
jesizmi
If you have mc installed, you can just temporarily rename the file
from .ipk to .tar.gz
mc will then recognize the archive and you can browse into it as though it where a real directory.

j.
vinc17
The ipk file itself contains several archives. So, can mc browse into archives recursively?
waalkman
Okay, after a bit of fiddling around I got it to show the files and also to install the package as well.

Standard disclaimer: It works fine for me, but you're on your own.


To add the file extension in Midnight Commander follow these steps:

1) Fire up mc (Midnight Commander).

2) Add this to your mc extension file. To do this tap on command then select "Edit extension file".

3) Select systemwide.

Or just edit your /usr/share/mc/mc.ext file.

I put my addition just above the # deb entry, I suppose you could put it just about anywhere you like.


Add these lines to your mc.ext file:

# ipk
regex /\.ipk$
<tab>Open=ipkg install %p
<tab>View=%view{ascii} cp %f /tmp/mc-root/foo.tar.gz; cd /tmp/mc-root; tar zxf /tmp/mc-root/foo.tar.gz; tar tzf /tmp/mc-root/data.tar.gz; rm /tmp/mc-root/*

<tab> being replaced by the TAB key.

Save & exit, restart mc and you should be set. You do have to restart mc for the changes to take effect.


The only thing that's bugging me is the "sh: file: command not found" message on the command line. What gives with that?


A bit of explaination on how it works for the bored amoung us:

The "Open=ipkg install %p" is what will get executed when you select a file and hit enter. I've got mine set to go ahead and install the .ipk, you might want to consider the ramifications of that before adding this line (do you really want to install the ipk?). You can always leave the "Open=ipkg install %p" line out.

The "View=view..." line copies the file you selected (%f) to /tmp/mc-root/foo.tar.gz.
Then cd's into that directory.
Then gunzips the foo.tar.gz to foo.tar.
Then displays the contents of foo.tar.
And finally it cleans up after itself.

The only assumption that I make is that you have a /tmp/mc-root directory. This should be a pretty good guess since mc creates this for you (well, it did for me...) If you don't have this directory then create it.

Enjoy.


John
waalkman
Oh, and thanks for the .ipk = .tar.gz tip!


John


Edit:

And this is cute, fire up mc and have your packages in one frame (I put mine on my CF card) and on the other side have it showing what's in /usr/bin/ipkg/info.

This way you can easily see what has been installed already and if not just hit enter with the file selected smile.gif

Blast, don't do the open thingie - mc doesn't seem to like it. No idea as to why.
raybert
I wrote a script to extract IPKs called xipk. The output of this script is desgined to be passed to the ipkg-build.sh script to re-create the IPK. data.tar.gz and control.tar.gz are extracted and deleted from the output dir. control.tar.gz is placed into the CONTROL dir and debian-binary is deleted.

~ray
waalkman
QUOTE(raybert @ Sep 26 2004, 10:27 AM)
I wrote a script to extract IPKs called xipk.


Much fancier than mine, I'll give it a try. smile.gif


John
Mag1c
tar xfzO the-IPK-file.ipk ./data.tar.gz | gzip -d | tar tvf -

Cheers
Mag1c
Stubear
QUOTE(Mag1c @ Sep 27 2004, 11:46 PM)
tar xfzO the-IPK-file.ipk ./data.tar.gz | gzip -d | tar tvf -

Cheers
Mag1c

Actually you can cut that down a little bit more

CODE
tar xzOf the-IPK-file.ipk ./data.tar.gz | tar tzf -


Not much different really but saves typing.

Or you can make a script

CODE
#!/bin/bash
tar xzOf $1 ./data.tar.gz | tar tzf -


save it as something like ipkgview and run it with

CODE
ipkgview the-IPK-file.ipk


Stu
waalkman
QUOTE(Mag1c @ Sep 27 2004, 11:46 PM)
tar xfzO the-IPK-file.ipk ./data.tar.gz | gzip -d | tar tvf -

Cheers
Mag1c


Hmmm, I get:

ERROR: unknown sub-command `xzOf'


John
Mag1c
You did this on Zaurus itself, right ? AFAIK there is running a restricted version of tar. Maybe you can try this:

tar -x -f the-IPK-file.ipk -z -O ./data.tar.gz | tar -t -v -z -f -

and if tar does not handle gziped data, try this:

cat the-IPK-file.ipk | gzip -d | tar -x -f - -O ./data.tar.gz | gzip -d | tar -t -v -f -

bye
Mag1c
waalkman
QUOTE
You did this on Zaurus itself, right ? AFAIK there is running a restricted version of tar. Maybe you can try this:

tar -x -f the-IPK-file.ipk -z -O ./data.tar.gz | tar -t -v -z -f -


Yup, I was using the Z, I tried this line and it choked on "obsolete 64 bit headers" or something.


QUOTE
and if tar does not handle gziped data, try this:

cat the-IPK-file.ipk | gzip -d | tar -x -f - -O ./data.tar.gz | gzip -d | tar -t -v -f -

bye
Mag1c


This worked great!

Thanks for the help, and sorry it took me so long to get back to you.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.