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 Thu 27 Nov 2014, 03:05
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Improving The Wrappers From Xarchive
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 2 Posts_count   Goto page: 1, 2 Next
Author Message
abushcrafter


Joined: 30 Oct 2009
Posts: 1447
Location: England

PostPosted: Fri 11 Jun 2010, 08:41    Post_subject:  Improving The Wrappers From Xarchive
Sub_title: Adding support for more formats.
 

My aim is for all the formats that Peazip supports for Xarchiver to support too. I could do with a lot of help with adding the formats left as my bash knowledge is near to none.

Achievements:
One of the new formats that xarchive can now support is PET at last! It only need 4 extra characters added to the tar-wrap.sh!

Green means format is tested and should work.

To Do:

Add support for:
  • swf
  • SLP (Stampede Linux packages)
  • pea


Check wherever these added formats work:
    7zip-wrap.sh
  • gnm
  • 7z
  • cab
  • chm
  • cpio
  • dmg
  • hfs
  • iso
  • lzh
  • msi
  • nsis
  • udf
  • wim
  • xar
  • exe
  • swm
  • chw
  • hxs

    zip-wrap.sh
  • ear
  • war
  • pak
  • pk3
  • pk4
  • smzip
  • up3
  • xpi
  • ods
  • ots
  • odb
  • odf
  • odg
  • otg
  • odp
  • otp
  • odt
  • ott
  • oth
  • odm
  • odt
  • oxt
  • pup

tar-wrap.sh
  • tar.7z
  • pet
  • tar.xz/txz/pxt (Added: Sun13/6/2010 Version:002)
  • (NEW: Wed7/7/2010 Version:003)tar.lzma, tar.lz, tlz

(NEW: Sat25/9/2010) lha-wrap.sh
  • lha
  • lzh

(NEW: Sat25/9/2010) uu-wrap.sh
  • uu

(NEW: Sat25/9/2010) zoo-wrap.sh
  • zoo


(NEW: THU26/5/2011) pupzip
  • shar


Latest version of p7zip binary is here:
Puppy Linux Discussion Forum :: View topic - [PET] p7zip 9.13 Full

Latest version of ZOO binary is here:
Puppy Linux Discussion Forum :: View topic - [PET] ZOO 2.10-21

Latest version of LHA binary is here:
Puppy Linux Discussion Forum :: View topic - [PET] LHA 1.17

To use, extract to "/".

PV=Package Version
ImprovedPupZipAndXarchiveWrappers.PV007.tar.bz2
Description 
bz2

 Download 
Filename  ImprovedPupZipAndXarchiveWrappers.PV007.tar.bz2 
Filesize  9.96 KB 
Downloaded  1188 Time(s) 

Edited_times_total
Back to top
View user's profile Send_private_message Visit_website 
sc0ttman


Joined: 16 Sep 2009
Posts: 2386
Location: UK

PostPosted: Fri 11 Jun 2010, 13:31    Post_subject:  

Good luck with this, great idea.. if I knew how to help, I would..

Maybe the authors of unrar, undeb, etc, can post their wrappers as examples?

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send_private_message 
abushcrafter


Joined: 30 Oct 2009
Posts: 1447
Location: England

PostPosted: Fri 11 Jun 2010, 16:33    Post_subject:  

sc0ttman wrote:
Maybe the authors of unrar, undeb, etc, can post their wrappers as examples?
Puppy comes with the wrapper for unrar it just needs the unrar binary. Puppy comes the the deb binary so that works out of the box.

sc0ttman wrote:
Good luck with this, great idea.. if I knew how to help, I would..
Thanks. It's ok. No hard feelings.
Back to top
View user's profile Send_private_message Visit_website 
abushcrafter


Joined: 30 Oct 2009
Posts: 1447
Location: England

PostPosted: Fri 11 Jun 2010, 17:22    Post_subject:  

Update!
Back to top
View user's profile Send_private_message Visit_website 
technosaurus


Joined: 18 May 2008
Posts: 4380

PostPosted: Fri 11 Jun 2010, 21:43    Post_subject:  

I have already patched it to work with lzma and xz (and also to be more compatible with busybox versions) - sent it to Barry a few months ago ... should be in any new package since then. If not it is easy to reproduce using tar.gz as a template for lzma and xz ... for busybox compatibility just use short options instead of long versions
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
abushcrafter


Joined: 30 Oct 2009
Posts: 1447
Location: England

PostPosted: Sun 13 Jun 2010, 18:21    Post_subject:  

Thanks technosaurus. Added tar.xz support. Still need to add lzma support.

Update!
Back to top
View user's profile Send_private_message Visit_website 
abushcrafter


Joined: 30 Oct 2009
Posts: 1447
Location: England

PostPosted: Wed 07 Jul 2010, 09:38    Post_subject:  

Updated!
Package Version (PV)=003

tar-wrap.sh:
Code:
#   2010-06-13  Alexander .S.T. Ross (abushcrafter) Email: <http://www.google.com/recaptcha/mailhide/d?k=01uNeUuXxeNm9FA3Zciuoqzw==&c=nVfKeb7kjqZVVIQanqJwEC2DP5zrALkSERTopYvj_pU=>
#      * 0.0.2: Added support for tar.xz, txz, pxt, and t7z files.
#      * 0.0.2: Added the changelog.

7z-wrap.sh:
Code:

#   2010-06-30  Alexander S.T. Ross (abushcrafter) Email: <http://www.google.com/recaptcha/mailhide/d?k=01uNeUuXxeNm9FA3Zciuoqzw==&c=nVfKeb7kjqZVVIQanqJwEC2DP5zrALkSERTopYvj_pU=>
#      * 0.0.3: Added support for tar.lzma, tar.lz, tlz files.
#      * 0.0.3: Fixed missing info from the changelog.

_________________
adobe flash is rubbish!
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/
Back to top
View user's profile Send_private_message Visit_website 
amigo

Joined: 02 Apr 2007
Posts: 2279

PostPosted: Wed 07 Jul 2010, 14:10    Post_subject:  

Here's a chunk of code for you which covers quite a few formats:

gitunpack:
Code:
#! /bin/sh

###############################################################################
###                               ###
###         GNU Interactive Tools unpack script              ###
###    Copyright (C) 1997-2000, 2006-2007 Free Software Foundation, Inc.  ###
###                                                                         ###
###                  This file is part of gnuit.                            ###
###                                                                         ###
###  gnuit is free software: you can redistribute it and/or modify it       ###
###  under the terms of the GNU General Public License as published         ###
###  by the Free Software Foundation, either version 3 of the               ###
###  License, or (at your option) any later version.                        ###
###                                                                         ###
###  gnuit is distributed in the hope that it will be useful, but           ###
###  WITHOUT ANY WARRANTY; without even the implied warranty of             ###
###  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          ###
###  GNU General Public License for more details.                           ###
###                                                                         ###
###  You should have received a copy of the GNU General Public              ###
###  License along with this program. If not, see                           ###
###  http://www.gnu.org/licenses/.                                          ###
###                               ###
###          Written by Tudor Hulubei and Viorel Anghel.          ###
###                               ###
###############################################################################


# We can have one or two arguments.
if test "$#" -lt 2; then
    echo "usage: $0 destdir archives..."
    exit 1
fi

destdir="$1"
shift
srcdir=`pwd`

cd "$destdir" 2> /dev/null
if test "$?" -ne 0; then
    gitmkdirs "$destdir"
    if test "$?" -ne 0; then
   exit 1;
    fi

    cd "$destdir"
    if test "$?" -ne 0; then
   exit 1;
    fi
fi

exit_code=0
while [ $# -gt 0 ] ; do
    archive=$1

    if [ ! -e "$archive" ] ; then
   echo "$0: $archive: not found"
    elif [ -d "$archive" ] ; then
   echo "$0: $archive: not a regular file" >&2
   exit_code=1
    else
   # `ln' will fail if $destdir is the same as $srcdir.
   ln -s "$srcdir/$archive" "$archive" 2> /dev/null
   link_created=$?

   lcarchive="$(echo "$archive"|tr '[:upper:]' '[:lower:]')"
   case "$lcarchive" in
        *.tar|*.cbt)                tar -xvf "$archive";;
        *.tar.bz)                   bzip -dc "$archive"|tar -xvf -;;
        *.tar.bz2)                  bzip2 -dc "$archive"|tar -xvf -;;
        *.tar.gz)                   gzip -dc -- "$archive"|tar -xvf -;;
        *.tar.z)                    uncompress -dc "$archive"|tar -xvf -;;
        *.tar.z)                    uncompress -dc "$archive"|tar -xvf -;;
   *.tar.7z)                   7z x -y -so -- "$archive" | tar -xvf -;;
   *.tar.lzma)                 lzma -c -d -- "$archive" | tar -xvf -;;
        *.cpio)                     cat "$archive"|cpio -i -d;;
        *.cpio.bz)                  bzip -dc "$archive"|cpio -i -d;;
        *.cpio.bz2)                 bzip2 -dc "$archive"|cpio -i -d;;
        *.cpio.gz)                  gzip -dc -- "$archive"|cpio -i -d;;
        *.cpio.z)                   uncompress -dc "$archive"|cpio -i -d;;
   *.cpio.7z)                  7z x -y -so -- "$archive" | cpio -i -d;;
   *.cpio.lzma)                lzma -c -d -- "$archive" | cpio -i -d;;
   *.7z)                       7z x -- "$archive";;
   *.lzma)                     lzma -d -- "$archive";;
        *.tgz)                      gzip -dc -- "$archive"|tar -xvf -;;
        *.t[ar]z)                   uncompress -dc "$archive"|tar -xvf -;;
        *.jar)                      jar -xvf "$archive";;
        *.zip|*.cbz)                unzip -o "$archive";;
        *.arj|*.a[0-9][0-9])        unarj x "$archive";;
        *.rar|*.cbr|*.r[0-9][0-9])  rar x -y -r -v "$archive";;
        *.lha|*.lzh)                lha -xvf "$archive";;
        *.z)                        uncompress "$archive";;
        *.bz)                       bzip -d "$archive";;
        *.bz2)                      bzip2 -d "$archive";;
        *.gz)                       gunzip "$archive";;
        *.shar)                     sh "$archive";;
        *.uu)                       uudecode "$archive";;
        *.rpm)                      rpm2cpio "$archive"|cpio -v -i -d;;
        *.deb)                      ar -xv "$archive";;
        *.a)                        ar -xv "$archive";;
   *.zoo)                      zoo --extract "$archive";;
        *) echo "$0: $archive: unknown archive type" >&2
           exit_code=1
        esac

   if test $? -ne 0; then
       exit_code=$?
   fi

   if test "$link_created" -eq 0; then
       rm "$archive"
   fi
    fi

    shift
done

exit $exit_code



I started once to adapt the code so it would check to make sure the indicated decompressor is available and warn if not.
Back to top
View user's profile Send_private_message 
abushcrafter


Joined: 30 Oct 2009
Posts: 1447
Location: England

PostPosted: Wed 07 Jul 2010, 17:36    Post_subject:  

I will try this out and see how it compares to unp unp installation and configuration in debian.
_________________
adobe flash is rubbish!
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/
Back to top
View user's profile Send_private_message Visit_website 
vovchik


Joined: 23 Oct 2006
Posts: 1287
Location: Ukraine

PostPosted: Wed 07 Jul 2010, 19:21    Post_subject:  

Dear puppians,

Here is unp 2.0~pre4 (Debian Sid) as a pet.

With kind regards,
vovchik
unp-2.0.pet
Description 
pet

 Download 
Filename  unp-2.0.pet 
Filesize  12.12 KB 
Downloaded  916 Time(s) 
Back to top
View user's profile Send_private_message 
amigo

Joined: 02 Apr 2007
Posts: 2279

PostPosted: Thu 08 Jul 2010, 02:04    Post_subject:  

The bas things about unp is it is a perl script...
Back to top
View user's profile Send_private_message 
abushcrafter


Joined: 30 Oct 2009
Posts: 1447
Location: England

PostPosted: Sun 11 Jul 2010, 17:46    Post_subject:  

Thanks for the new version of unp. I have decided to stick with unp as it is very powerful. For example it supports PET out of the box. Not because it knows about the .pet extension but because (I think. Do correct me if I am wrong.) it is able to find out what it's MIME is/what archive type it is. Another feature I like is the "-u" parameter.

Now to extract code from that gitunpack script for xarchiver which I get around to it Rolling Eyes. Remind me if I forget to do it.

_________________
adobe flash is rubbish!
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/
Back to top
View user's profile Send_private_message Visit_website 
abushcrafter


Joined: 30 Oct 2009
Posts: 1447
Location: England

PostPosted: Sat 25 Sep 2010, 15:48    Post_subject: Update!  

New wrappers and a few miner bug fixes.

Thanks to amigofor the suggestion/info. New wrappers:
  • lha-wrap.sh
  • uu-wrap.sh
  • zoo-wrap.sh


I have begun work on a CPIO wrapper but have got stuck due to lack of knowledge and probably time and the ability to face it Mad.

So someone please finish it! Here it is:
cpio-wrap.sh.001.InDev.tar.bz2
Description 
bz2

 Download 
Filename  cpio-wrap.sh.001.InDev.tar.bz2 
Filesize  3.04 KB 
Downloaded  728 Time(s) 

_________________
adobe flash is rubbish!
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/
Back to top
View user's profile Send_private_message Visit_website 
abushcrafter


Joined: 30 Oct 2009
Posts: 1447
Location: England

PostPosted: Mon 11 Oct 2010, 16:25    Post_subject: Update! See First Post!  

I have successfully extracted a "pup" archive with this new version.

"zip-wrap.sh":
Code:

#ChangeLog ----------------------------------------------------------------------
#   2010-10-02-Sat 10:03:28  Alexander S.T. Ross (abushcrafter) Email: <http://www.google.com/recaptcha/mailhide/d?k=01uNeUuXxeNm9FA3Zciuoqzw==&c=nVfKeb7kjqZVVIQanqJwEC2DP5zrALkSERTopYvj_pU=>
#      * 0.0.2: Added support for "pup".


"tar-wrap.sh":
Code:

#ChangeLog ----------------------------------------------------------------------
#   2010-10-02-Sat 10:03:28  Alexander S.T. Ross (abushcrafter) Email: <http://www.google.com/recaptcha/mailhide/d?k=01uNeUuXxeNm9FA3Zciuoqzw==&c=nVfKeb7kjqZVVIQanqJwEC2DP5zrALkSERTopYvj_pU=>
#      * 0.0.5: Removed suport for "pup" as it is a "zip" not a "tar.gz".


I have attached a ".tar.bz2" which contains just the "tar-wrap.sh" and the "zip-wrap.sh" updated wrappers.

I also added to the first post, links to the threads for the ZOO and LHA PETs I made.
JustTheTARAndZIPXarchiveWrappersFromPV006.tar.bz2
Description 
bz2

 Download 
Filename  JustTheTARAndZIPXarchiveWrappersFromPV006.tar.bz2 
Filesize  4.39 KB 
Downloaded  721 Time(s) 

_________________
adobe flash is rubbish!
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/
Back to top
View user's profile Send_private_message Visit_website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Tue 08 Feb 2011, 18:51    Post_subject:  

I would like to suggest to change the error output from the wrapper files from ">/dev/stderr" ["> /dev/stderr"] to something like this :
">>/tmp/xarchive_errs.log" , because many times my /tmp/xerrs.log becomes unreadable and/or overwritten .
Code:
cd /usr/local/lib/xarchive/wrappers
for i in *; do cat $i | sed 's#> /dev/stderr#>>/tmp/xarchive_errs.log#g' > $i; done
for i in *; do cat $i | sed 's#>/dev/stderr#>>/tmp/xarchive_errs.log#g' > $i; done

also interesting to have :
Code:
for FILE in *; do L=`grep -n 'E_UNSUPPORTED=' $FILE | cut -f 1 -d ':'` ; echo $L ; SEDINSL=`expr $L - 2`; SEDINS='echo >>/tmp/xarchive_errs.log' ; sed -i "$SEDINSL i $SEDINS" $FILE ; done
for FILE in *; do L=`grep -n 'opt="$1"' $FILE | cut -f 1 -d ':'` ; echo $L ; SEDINSL=`expr $L + 1`; SEDINS='echo opt $opt >>/tmp/xarchive_errs.log' ; sed -i "$SEDINSL i $SEDINS" $FILE ; done
for FILE in *; do L=`grep -n 'archive="$1"' $FILE | cut -f 1 -d ':'` ; echo $L ; SEDINSL=`expr $L + 1`; SEDINS='echo archive $archive >>/tmp/xarchive_errs.log' ; sed -i "$SEDINSL i $SEDINS" $FILE ; done

The output of
Quote:
grep -n 'archive="$1"' *
7za-wrap.sh:56:archive="$1"

and
Quote:
for FILE in *; do L=`grep -n 'archive="$1"' $FILE` ;echo $L; done
56:archive="$1"

differ slightly , so i put in "echo $L"
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 1 of 2 Posts_count   Goto page: 1, 2 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


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