Author Topic: ipkg question  (Read 3618 times)

waalkman

  • Full Member
  • ***
  • Posts: 176
    • View Profile
ipkg question
« on: September 25, 2004, 06:46:55 am »
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
C860, SMC Model SMC2642W, various sized memory cards

vinc17

  • Newbie
  • *
  • Posts: 39
    • View Profile
    • https://www.vinc17.net/
ipkg question
« Reply #1 on: September 25, 2004, 06:54:51 am »
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

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
ipkg question
« Reply #2 on: September 25, 2004, 11:00:00 am »
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
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

jesizmi

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
    • http://
ipkg question
« Reply #3 on: September 25, 2004, 03:36:44 pm »
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.
C860 Cacko ROM 1.23 / OZ 3.5.4.1
CF: 512M extreMemory
SD: 1G noname (2 partitions automounted; vfat+ext2)
Stylus: Tungsten T

vinc17

  • Newbie
  • *
  • Posts: 39
    • View Profile
    • https://www.vinc17.net/
ipkg question
« Reply #4 on: September 25, 2004, 04:35:59 pm »
The ipk file itself contains several archives. So, can mc browse into archives recursively?

waalkman

  • Full Member
  • ***
  • Posts: 176
    • View Profile
ipkg question
« Reply #5 on: September 26, 2004, 02:02:48 am »
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
C860, SMC Model SMC2642W, various sized memory cards

waalkman

  • Full Member
  • ***
  • Posts: 176
    • View Profile
ipkg question
« Reply #6 on: September 26, 2004, 02:04:13 am »
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

Blast, don't do the open thingie - mc doesn't seem to like it. No idea as to why.
« Last Edit: September 26, 2004, 02:42:05 am by waalkman »
C860, SMC Model SMC2642W, various sized memory cards

raybert

  • Full Member
  • ***
  • Posts: 233
    • View Profile
ipkg question
« Reply #7 on: September 26, 2004, 02:27:07 pm »
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

  • Full Member
  • ***
  • Posts: 176
    • View Profile
ipkg question
« Reply #8 on: September 27, 2004, 05:14:39 am »
Quote
I wrote a script to extract IPKs called xipk.

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


John
C860, SMC Model SMC2642W, various sized memory cards

Mag1c

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • http://
ipkg question
« Reply #9 on: September 27, 2004, 10:46:45 am »
tar xfzO the-IPK-file.ipk ./data.tar.gz | gzip -d | tar tvf -

Cheers
Mag1c

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
ipkg question
« Reply #10 on: September 27, 2004, 10:51:41 pm »
Quote
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: [Select]
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: [Select]
#!/bin/bash
tar xzOf $1 ./data.tar.gz | tar tzf -

save it as something like ipkgview and run it with

Code: [Select]
ipkgview the-IPK-file.ipk
Stu
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

waalkman

  • Full Member
  • ***
  • Posts: 176
    • View Profile
ipkg question
« Reply #11 on: October 01, 2004, 02:44:12 am »
Quote
tar xfzO the-IPK-file.ipk ./data.tar.gz | gzip -d | tar tvf -

Cheers
Mag1c

Hmmm, I get:

ERROR: unknown sub-command `xzOf'


John
C860, SMC Model SMC2642W, various sized memory cards

Mag1c

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • http://
ipkg question
« Reply #12 on: October 04, 2004, 11:26:48 am »
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

  • Full Member
  • ***
  • Posts: 176
    • View Profile
ipkg question
« Reply #13 on: October 20, 2004, 09:52:39 pm »
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.
C860, SMC Model SMC2642W, various sized memory cards