(OLD) (ARCHIVED) Puppy Linux Discussion Forum Forum Index (OLD) (ARCHIVED) Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info

This forum can also be accessed as http://oldforum.puppylinux.com
It is now read-only and serves only as archives.

Please register over the NEW forum
https://forum.puppylinux.com
and continue your work there. Thank you.

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups    
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 04 Dec 2020, 01:32
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Improving The Wrappers From Xarchive
Moderators: Flash, Ian, JohnMurga
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
Page 2 of 2 [23 Posts]   Goto page: Previous 1, 2
Author Message
abushcrafter


Joined: 30 Oct 2009
Posts: 1438
Location: England

PostPosted: Wed 25 May 2011, 18:51    Post subject:  

Update!

The new change is the "pupzip" script is now included and has support for the formats I added to the improved xarchive wrappers and support for "shar". I also removed some wrappers that did not have any improvements in the first place.

@Karl Godt.
I tried to understand what changes where need but I only understood one, I think Confused. Though I am not at all sure that I did understood that one. So if you could apply your changes to the new version I posted and PM them to me and I will post a new version.

_________________
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 poster's website 
Karl Godt


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

PostPosted: Thu 26 May 2011, 09:44    Post subject:  

Done

Maybe
Quote:
cat $i | sed 's#> /dev/stderr#>>/tmp/xarchive_errs.log#g' > $i

gives an empty file

This should do it better :
Code:
for i in *; do cat $i | sed 's#>/dev/stderr#>>/tmp/xarchive_errs.log#g' > /tmp/$i; mv -f /tmp/$i ./$i ; done

for i in *; do cat $i | sed 's#> /dev/stderr#>>/tmp/xarchive_errs.log#g' > /tmp/$i; mv -f /tmp/$i ./$i ; done
Back to top
View user's profile Send private message 
gcav


Joined: 25 May 2012
Posts: 105
Location: Ontario

PostPosted: Thu 27 Dec 2012, 01:28    Post subject: wrapper for lzh  

I could not find one.. So I hacked this up..

Code:

#! /bin/bash
# Wrapper for LZH - GCL
# Based on rar-wrap.sh - bash rar wrapper for xarchive

# set up exit status variables
E_UNSUPPORTED=65

# Supported file extentions for lha
EXTS="lzh lharc lha"

# Program to wrap
if [ "$(which lha)" ]; then
    LHA_PROG="lha"
else
    LHA_PROG="lha"
fi

# Setup awk program to use
AWK_PROGS="mawk gawk awk"
AWK_PROG=""
for awkprog in $AWK_PROGS; do
    if [ "$(which $awkprog)" ]; then
        AWK_PROG="$awkprog"
        break
    fi
done

# Setup xterm program to use
XTERM_PROGS="xterm rxvt xvt wterm aterm Eterm"
XTERM_PROG=""
for xtermprog in $XTERM_PROGS; do
    if [ "$(which $xtermprog)" ]; then
        XTERM_PROG="$xtermprog"
        break
    fi
done

# setup variables opt and archive.
# the shifting will leave the files passed as
# all the remaining args "$@"
opt="$1"
shift 1
archive="$1"
shift 1

# Command line options for prog functions
# disable comments when opening
OPEN_OPTS="l"
ADD_OPTS="a"
NEW_OPTS="a"
REMOVE_OPTS="d"
EXTRACT_OPTS="x"
PASS_EXTRACT_OPTS="x"

# the option switches
case "$opt" in
    -i) # info: output supported extentions for progs that exist
        if [ ! "$AWK_PROG" ]; then
            echo none of the awk programs $AWK_PROGS found >> /dev/stderr
            echo extentions $EXTS ignored >> /dev/stderr
        elif [ "$(which $LHA_PROG)" ]; then
            for ext in $EXTS; do
                printf "%s;" $ext
            done
        else
            echo command $LHA_PROG not found >> /dev/stderr
            echo extentions $EXTS ignored >> /dev/stderr
        fi
        printf "\n"
        exit
        ;;

    -o) # open: mangle output of lha cmd for xarchive
        # format of lha output:
# PERMSSN    UID  GID      SIZE  RATIO     STAMP           NAME
# ---------- ----------- ------- ------ ------------ --------------------
# drwxr-xr-x     0/0           0 ****** Jul 11 23:46 AppBuilder-0.4/
# -rwxr-xr-x     0/500      2948 100.0% Feb 12  2002 AppBuilder-0.4/.DirIcon
# -rw-r-----     0/500       317  59.0% Mar 21  2006 AppBuilder-0.4/AppInfo.xml
# -rwxr-x---     0/500      2907  47.0% Dec  4  2006 AppBuilder-0.4/AppRun
# drwxr-xr-x     0/0           0 ****** Jul 11 23:46 AppBuilder-0.4/Help/
# -rw-r--r--   100/500      1356  59.7% Mar 10  2006 AppBuilder-0.4/Help/AppBuilder.htm
#     1           2          3       4   5   6    7    8
       
        $LHA_PROG $OPEN_OPTS "$archive" | $AWK_PROG -v uuid=${UID-0} '
        # The body of info we wish to process starts with a dashed line
        # so set a flag to signal when to start and stop processing.
        # The name is on one line with the info on the next so toggle
        # a line flag letting us know what kinda info to get.
   /^-------/ { flag++; if (flag > 1) exit 0; next }
   {
   if (flag == 0) next
   #year=$7
   #month=$5
   #day=$6
   gid=$2
   time=$5"-"$6"-"$7
   attr=$1
   size=$3
   #$0=substr($0, 54)
   name=$8
   gsub(/\\/, "/", name)
                                             
   printf "%s;%d;%s;%d;%d;%s;-\n", name, size, attr, uid,gid,   time
   }'
                                                                                                                                                                              
        exit
        ;;

    -a) # add:  to archive passed files
        # we only want to add the file's basename, not
        # the full path so...
        while [ "$1" ]; do
            cd "$(dirname "$1")"
            $LHA_PROG $ADD_OPTS "$archive" "$(basename "$1")"
            wrapper_status=$?
            shift 1
        done
        exit $wrapper_status
        ;;

    -n) # new: create new archive with passed files
        # create will only be passed the first file, the
        # rest will be "added" to the new archive
        cd "$(dirname "$1")"
        $LHA_PROG $NEW_OPTS "$archive" "$(basename "$1")"
        exit
        ;;

    -r) # remove: from archive passed files
        $LHA_PROG $REMOVE_OPTS "$archive" "$@"
        exit
        ;;

    -e) # extract: from archive passed files
        # xarchive will put is the right extract dir
        # so we just have to extract.
        $LHA_PROG $EXTRACT_OPTS "$archive" "$@"
        if [ "$?" -ne "0" ] && [ "$XTERM_PROG" ]; then
            echo Probably password protected,
            echo Opening an x-terminal...
            $XTERM_PROG -e $LHA_PROG $PASS_EXTRACT_OPTS "$archive" "$@"
        fi
        exit
        ;;

     *) echo "error, option $opt not supported"
        echo "use one of these:"
        echo "-i                #info"
        echo "-o archive        #open"
        echo "-a archive files  #add"
        echo "-n archive file   #new"
        echo "-r archive files  #remove"
        echo "-e archive files  #extract"
        exit
esac
Back to top
View user's profile Send private message 
gcav


Joined: 25 May 2012
Posts: 105
Location: Ontario

PostPosted: Thu 27 Dec 2012, 10:28    Post subject: lha... and 7z  

Just realized that 7z and its wrapper supports lha... oh well...

gc
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2647

PostPosted: Tue 05 Feb 2013, 15:18    Post subject:  

Just realized that my program: AppBuilder-0.4
was being used as an example. People should write me and tell me they are using my stuff -I might be able to help them!
Back to top
View user's profile Send private message 
peebee


Joined: 21 Sep 2008
Posts: 4391
Location: Worcestershire, UK

PostPosted: Thu 16 Jan 2020, 13:27    Post subject: How to extend Xarchive for tar.zst archives??  

New post to a very old thread.........

http://distro.ibiblio.org/puppylinux/pet_packages-common32/xarchive-0.2.8-6-i18n-i686_common32.pet

http://distro.ibiblio.org/puppylinux/pet_packages-common64/xarchive-0.2.8-6-i18n-x86_64_common64.pet

Packages are starting to appear from Arch Linux using zstd compression - tar.zst archives.

Xarchive needs to be extended with a new wrapper to cope with these new files....see below

Thanks
peebee

_________________
LxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

Last edited by peebee on Sun 19 Jan 2020, 12:36; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
Dry Falls

Joined: 16 Dec 2014
Posts: 616
Location: Upper Columbia

PostPosted: Thu 16 Jan 2020, 18:54    Post subject:  

Hi Peebee.

What I did was...
Code:
mkdir /root/.config/rox.sourceforge.net/OpenWith/.application_x-zstd-compressed-tar
and symlink Xarchiver.desktop there and also /usr/local/bin/ExtractWithXarchiver.

ExtractWithXarchiver:
Code:
#!/bin/sh
/usr/bin/xarchiver -e "$@"


You can make pet or pkg (from pkgtools) from there.

df

edit: Ah, you're looking for an entry in /usr/local/lib/xarchive/
Sorry, good question.
Back to top
View user's profile Send private message 
peebee


Joined: 21 Sep 2008
Posts: 4391
Location: Worcestershire, UK

PostPosted: Sun 19 Jan 2020, 12:31    Post subject: Zstandard integration  

Only works if your system has the zstd binary.... check with
Code:
which zstd
before installing. (LxPupSc and ScPup have zstd but don't think any other pup does....)

Changes or adds the following files (which are spread all over the Woof-CE build system):
/etc/
/etc/xdg/
/etc/xdg/rox.sourceforge.net/
/etc/xdg/rox.sourceforge.net/MIME-types/
/etc/xdg/rox.sourceforge.net/MIME-types/application_x-archlinux-package-zst
/etc/xdg/rox.sourceforge.net/MIME-types/application_x-zstd-compressed-tar
/root/
/root/.config/
/root/.config/rox.sourceforge.net/
/root/.config/rox.sourceforge.net/OpenWith/
/root/.config/rox.sourceforge.net/OpenWith/.application_x-zstd/
/root/.config/rox.sourceforge.net/OpenWith/.application_x-zstd/Add Bookmark
/root/.config/rox.sourceforge.net/OpenWith/.application_x-zstd-compressed-tar/
/root/.config/rox.sourceforge.net/OpenWith/.application_x-zstd-compressed-tar/Add Bookmark
/root/.config/rox.sourceforge.net/OpenWith/.application_x-zstd-compressed-tar/pupMd5sum
/root/.config/rox.sourceforge.net/OpenWith/.application_x-zstd/pupMd5sum
/usr/
/usr/bin/
/usr/bin/pcompress
/usr/bin/pextract
/usr/lib/
/usr/lib/xarchive/
/usr/lib/xarchive/wrappers/
/usr/lib/xarchive/wrappers/tar-wrap.sh
/usr/share/
/usr/share/applications/
/usr/share/applications/mimeapps.list
/usr/share/applications/pextract.desktop
/usr/share/icons/
/usr/share/icons/hicolor/
/usr/share/icons/hicolor/scalable/
/usr/share/icons/hicolor/scalable/mimetypes/
/usr/share/icons/hicolor/scalable/mimetypes/application-x-archlinux-package-gz.svg
/usr/share/icons/hicolor/scalable/mimetypes/application-x-archlinux-package-xz.svg
/usr/share/icons/hicolor/scalable/mimetypes/application-x-archlinux-package-zst.svg
/usr/share/icons/hicolor/scalable/mimetypes/application-x-gz-compressed-tar.svg
/usr/share/icons/hicolor/scalable/mimetypes/application-x-gz.svg
/usr/share/icons/hicolor/scalable/mimetypes/application-x-xz-compressed-tar.svg
/usr/share/icons/hicolor/scalable/mimetypes/application-x-xz.svg
/usr/share/icons/hicolor/scalable/mimetypes/application-x-zstd-compressed-tar.svg
/usr/share/icons/hicolor/scalable/mimetypes/application-x-zstd.svg
/usr/share/mime/
/usr/share/mime/application/
/usr/share/mime/application/x-archlinux-package-gz.xml
/usr/share/mime/application/x-archlinux-package-xz.xml
/usr/share/mime/application/x-archlinux-package-zst.xml
/usr/share/mime/application/x-zstd-compressed-tar.xml
/usr/share/mime/application/x-zstd.xml
/usr/share/mime/packages/
/usr/share/mime/packages/puppy.xml
zstd4puppy-1.0.pet
Description 
pet

 Download 
Filename  zstd4puppy-1.0.pet 
Filesize  10.53 KB 
Downloaded  183 Time(s) 

_________________
LxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 2 of 2 [23 Posts]   Goto page: Previous 1, 2
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
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: 1.0863s ][ Queries: 13 (0.9966s) ][ GZIP on ]