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 Mon 10 Dec 2018, 16:08
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
Xmessage wrappers for rpm and deb
Moderators: deshlab, Flash, GuestToo, Ian, JohnMurga, Lobster
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [5 Posts]  
Author Message
mikeb


Joined: 23 Nov 2006
Posts: 11209

PostPosted: Fri 29 Feb 2008, 13:35    Post subject:  Xmessage wrappers for rpm and deb  

I've modified the xarchive wrappers to open/extract deb and rpm files using the busybox dpkg-deb and rpm functions.

only limitation is for rpm files no file details are available but otherise listing and partial/full extraction is possible.
Obviously the Pupzip script will still give the error message so altering file associations to directly opening with xarchive.

Tested in puppy 2 series.

mike
wrappers.tar.gz
Description 
gz

 Download 
Filename  wrappers.tar.gz 
Filesize  2.58 KB 
Downloaded  297 Time(s) 
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2642

PostPosted: Sat 01 Mar 2008, 05:18    Post subject:  

I recommend using the disrpm script for rpm and debian conversion or content listing. It uses od or hexdump to do the work which should be in most distros. You might alos look at using dd as a solution. The rpm2tgz program which is in slackware and other distros uses dd as an option if no rpm2cpio is available.
I use disrpm in a couple of prgrams and find that it will unpack rpm that even rpm2cpio will fail on.
It's short enough so I'll just post the code right here:
Code:
#!/bin/sh

# disrpm / undeb
# small (bourne) shell script to extract/unzip/unpack/unarchive *.rpm or *.deb packages.
# uses sh, sed, hexdump|od, gzip|bzip2, dd, cpio.
# released under the Gnu General Public License (GPL)
# (c) bjdouma@xs4all.nl
######################
VER="v1.5, october 2004"
ME="${0##*/}"

# change HEADER_SIZE here or issue e.g.
# $> HEADER_SIZE=512000 disrpm -v foo.rpm
[ -z $HEADER_SIZE ] && HEADER_SIZE=256000
######################

usage()
{
   echo -e "disrpm $VER (bjdouma@xs4all.nl)

usage:    $ME -v|-x foo.rpm
    $ME -v|-x foo.deb

options: -v|-l  view (list) contents of foo.
    -x     extract foo.
"
   exit 1
}

error_exit()
{
   echo $1 >&2
   exit 1
}

gzip_sieve()
{
   # gzip-magic: 0x1F,0x8B
   sed -ne '/1[fF]/{;N;/8[bB]$/{;s/1[fF]//g;s/^0*//g;P;};}'
}

bzip2_sieve()
{
   # bzip2-magic: 0x42,0x5A,0x68
   sed -ne '/42/{;N;/5[aA]$/{;N;/68$/{s/42//g;s/5[aA]//g;s/^0*//g;P;};};}'
}

probe()
{
   dd if=$FILE ibs=$O skip=1 2>/dev/null \
   | $2 -dc - 2>/dev/null \
   | cpio "$1" 2>/dev/null
}

######################

XDUMP=`type -P hexdump` || XDUMP=`type -P od` || error_exit "oops, can't find hexdump or od -- bailing out"
XDUMP="${XDUMP##*/}"

OPT=$1
[ -z $OPT ] && usage

PASS1="probe -tv"
{ [ "$OPT" = "-l" -o "$OPT" = "-v" ] && PASS2=":" ; } || { [ "$OPT" = "-x" ] && PASS2="probe -mid" ; } || usage

FILE=$2
[ x"$FILE"x == xx ] && usage
[ -e "$FILE" ] || error_exit "$FILE: No such file or directory"
 
for AR in gzip bzip2
do
   e=1

   [ "$XDUMP" = "od" ] && AR_OFFSETS=`$XDUMP -A d -N $HEADER_SIZE -v -t x1 -w1 $FILE | ${AR}_sieve`
   [ "$XDUMP" = "hexdump" ] && AR_OFFSETS=`$XDUMP -n $HEADER_SIZE -v -e '"%_ad " 1/1 "%02x" "\n"' $FILE | ${AR}_sieve`

   for O in $AR_OFFSETS
   do
      echo "--> at offset $O:" >&2
      $PASS1 $AR 2>/dev/null && $PASS2 $AR && e=0 \
      || echo "... hmm, probably false drop" >&2
   done

   [ $e -eq 0 ] && break
done

[ $e -eq 1 ] && echo "$ME: failed to find anything -- maybe HEADER_SIZE is too small (currently $HEADER_SIZE, see line 14)" >&2

exit $e

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


Joined: 23 Nov 2006
Posts: 11209

PostPosted: Mon 24 Mar 2008, 12:52    Post subject:  

Thanks for the script...seems to work ok in puppy 2.xx Smile...certianly gives better rpm handling so will incorpotate at some point.

Sorry for the delayed response...I completely missed your message somehow Embarassed

regards

mike
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 8739
Location: Perth, Western Australia

PostPosted: Tue 04 Dec 2018, 08:46    Post subject:  

@mikeb
Many years down the track, I have looked at those wrappers you posted.

The busybox rpm was not working with Xarchive in EasyOS, so I put in your fix, but extraction doesn't work.

I added the use of 'exploderpm' rather than busybox rpm, but still have an extraction problem:

http://bkhome.org/news/201812/fix-rpm-extraction-in-xarchive.html

...put in a temporary workaround, to always extract all files.

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
mikeb


Joined: 23 Nov 2006
Posts: 11209

PostPosted: Tue 04 Dec 2018, 11:49    Post subject:  

Well from rusty memory I believe the problem is they went to xz compression like debs though the index was still readable.

Since Xarchive uses scripts to handle everything, in theory with say 7zip or xz around it should be possible to workaround this.

mike
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [5 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
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.0467s ][ Queries: 12 (0.0113s) ][ GZIP on ]