Skip to Content.
Sympa Menu

baslinux - Re: [BL] installing RPM package

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: Neo Sze Wee <neoszewee AT gmx.net>
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] installing RPM package
  • Date: Sat, 5 Jul 2003 17:04:48 +0000

On Fri, Jul 04, 2003 at 01:05:22AM -0700, Jhommer Oblego wrote:
> Hi there, i'd like to know if is there a rpm to tgz converter for BL2, coz
> i got a package (program) in rpm format and want to install it in BL2. is
> there a way to install this rpm package and how to do it.

There is and it is better. Search google for disrpm to know more. You
need the full version of sed, dd and od.

<prompt> cat /usr/local/sbin/_unrpm
+---------------------------------------------------------------------
| #!/bin/sh
|
| # disrpm/undeb v1.3
| # Small (bourne) shell script to extract/unzip/unpack/unarchive *.rpm or
*.deb archives
| # If you use it, send me an e-mail, ok?
| # bjdouma AT xs4all.nl, april 2003
|
| ############################################################
| ME=`basename $0`
| ############################################################
| # hey, you can even set HEADER_SIZE as an environment variable!
| # disrpm v1.0 had 32000, a bit too little for those huge archives
|
| [ -z $HEADER_SIZE ] && HEADER_SIZE=256000
| ############################################################
|
| function usage()
| {
| cat <<IO
| disrpm v1.3 (bjdouma AT xs4all.nl)
| usage: $ME <-v|-x> file
|
| $ME -v|-l file view (list) contents of the *.rpm or *.deb archive.
| $ME -x file extract the archive.
|
| (note: using \`$HD' to sniff out gzip offsets)
| IO
| exit 1
| }
|
| function error_exit()
| {
| echo $1 >&2
| exit 1
| }
|
| function gzip_sieve()
| {
| # gzip-magic: 0x1F,0x8B
| sed -ne '/1[fF]/{;N;/\(8[bB]$\)$/{;s/1[fF]//g;s/^0*//g;P;};}'
| }
|
| function bzip2_sieve()
| {
| # bzip2-magic 0x42,0x5A,0x68 (used in RPM's v4, it seems)
| sed -ne
'/42/{;N;/\(5[aA]$\)$/{;N;/\(68$\)$/{s/42//g;s/5[aA]//g;s/^0*//g;P;};};}'
| }
|
| function probe()
| {
| dd if=$FILE ibs=$OFFSET skip=1 2>/dev/null \
| | $2 -dc - 2>/dev/null \
| | cpio "$1" 2>/dev/null
| }
|
| ############################################################
|
| BYTE_DUMPER=`type -p hexdump` || BYTE_DUMPER=`type -p od` || error_exit
"oops, can't find hexdump or od -- bailing out"
| HD=`basename $BYTE_DUMPER`
|
| CMD=$1
| [ -z $CMD ] && usage
|
| PASS1="probe -tv"
| { [ "$CMD" = "-l" -o "$CMD" = "-v" ] && PASS2=":" ; } || { [ "$CMD" = "-x"
] && PASS2="probe -mid" ; } || usage
|
| FILE=$2
| [ x"$FILE"x == xx ] && usage
| echo $FILE
|
| # ok, let's get to work:
|
| for AR in gzip bzip2
| do
| e=1
|
| if [ "$HD" = "od" ]
| then
| ZIP_OFFSETS=`$HD -A d -N $HEADER_SIZE -v -t x1 -w1 $FILE |
${AR}_sieve`
| elif
| [ "$HD" = "hexdump" ]
| then
| ZIP_OFFSETS=`$HD -n $HEADER_SIZE -v -e '"%_ad " 1/1 "%02x"
"\n"' $FILE | ${AR}_sieve`
| fi
|
| for OFFSET in $ZIP_OFFSETS
| do
| echo "--> at offset $OFFSET:" >&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 13)"
|
| exit $e
+---------------------------------------------------------------------

>
> thanks,
> jhommer
>
>
> ---------------------------------
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> _______________________________________________
> BasLinux mailing list
> BasLinux AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/baslinux






Archive powered by MHonArc 2.6.24.

Top of Page