Here is another version of fextiu written for a later
Puppy Linux, Fatdog64. It has become necessary for me
to look at 64-bit because of reasons beyond my control.
What I can do is adapt my scripts.
Don't get me wrong, I still use my old computers
(with Puppy of course). One is over a decade old and
the other is newer (but not like recent 'new')
-both run Lucid 5.2.8 and still run well.
The 64-bit Frontier Gets Its Turn...
Fextiu_2 is tested as well as shortened while still
packing the punch of the originals. Once again, no
scripts are involved, and no X is needed. It is
a little shorter than a 100 lines of code, but has been
effective for me. This also demonstrates the
adaptability of the code.
A great part of freedom of code is the ability to do
whatever you want to it. If the code doesn't work as
original, just modify it so that it does. Just be
mindful of its limits and how they can be expanded.
Enough chit chat, here it is:
Code:
#! /bin/bash
# FEXTIU_2 - for fatdog64 620 beta 3 (maybe beyond, maybe before)
# a rewrite of fextiu script - does not execute scripts
# even works partially for fd64-32bit-libs-6.sfs both ways
# only additional help (sometimes optional) is rm -r lib32 to clean empty paths
#
# supports: deb, tar, sfs, zip, pet
# warnings: ubuntu packages have become risky, using debian packages is better
# do not use wildcards like *
# some deb packages may produce output, check /FEXTIU if they installed successfully
# global variables
mdir=" " #special variable for pet
# functions
uninstaller() {
sed -i 's/^/\//' /*.fextiutxt #make small correction
a=$(echo /*.fextiutxt)
xargs rm < $a 2>/dev/null #xargs used to uninstall from list
echo "fextiu'd" #remove if too wordy
rm /*.fextiutxt
return;
}
generate() { # no longer a f(f(x))
if [ ! -d "/FEXTIU" ]; then mkdir /FEXTIU;fi
b=$(echo "$1" | sed -re 's/^.+\///') #strip path
find * > "/FEXTIU/$b.fextiutxt"
tar cf - * | ( cd /; tar xfp -) 2> /dev/null # tar move to /
return;
}
xtar() {
echo "...extracting tar $1 to /FTEMP"
tar -xf "$1" -C /FTEMP
return;
}
xzip() {
echo "...extracting zip $1 to /FTEMP"
cp "$1" /FTEMP; cd /FTEMP
unzip *.zip > /dev/null ; rm *.zip
return;
}
xdeb() { #ubuntu debs not guaranteed - some debs may show output
echo "...installing deb $1"
dpkg-deb -x "$1" /FTEMP 2> /dev/null
cd /FTEMP
return;
}
xpet() {
echo "...installing pet $1"
tar -xf "$1" -C /FTEMP 2> /dev/null; cd /FTEMP/*
mdir=$(pwd); #special variable needed here
return;
}
xsfs() { #if script mounts, it won't umount - so copying directly
echo "...installing sfs $1: needs lots of space"
cp "$1" /FTEMP; cd /FTEMP
b=$(echo "$1" | sed -re 's/^.+\///') #strip path
unsquashfs $b; cd squashfs-root
rm /FTEMP/"$1"
return;
}
# MAIN
if [ "$1" = "-h" ]; then {
clear
echo "FEXTIU_2: Fast EXTractor and Installer/Uninstaller v.2"; echo
echo "Usage: fextiu_2 [options] [file_path]"
echo "Ex: # fextiu_2 -deb /root/randomdeb.deb"; echo
echo "Options:"
echo "deb........installs from debs (ubuntu debs not guaranteed)"
echo "sfs........sfs4 squash files"
echo "tar........tar with -xf option only"
echo " to cut coding, will be extracted to /FTEMP"
echo "pet........pets are supported"
echo "zip........zip files are supported"
echo; echo "Fextiu_2 can also uninstall with -u; just copy file below to / then run:"
echo "# fextiu_2 -u"; echo
echo "Files: Each .fextiutxt file is stored in /FEXTIU"
echo "/FTEMP is intentionally left behind for examination-remove with '# rm -r /FTEMP'"
}; fi
rm -r /FTEMP; mkdir /FTEMP # cleared - backup if desired
if [ "$1" = "-pet" ]; then xpet "$2"; generate "$mdir"; fi
if [ "$1" = "-sfs" ]; then xsfs "$2"; generate "$2"; fi
if [ "$1" = "-zip" ]; then xzip "$2"; fi
if [ "$1" = "-deb" ]; then xdeb "$2"; generate "$2"; fi #read sub
if [ "$1" = "-tar" ]; then xtar "$2"; fi
if [ "$1" = "-u" ]; then uninstaller; fi
# EOF