How to install multiple pets at one time [SOLVED]

Using applications, configuring, problems
Message
Author
slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

How to install multiple pets at one time [SOLVED]

#1 Post by slavvo67 »

Thanks to BarryK and his original Puppy Package Manager, Rufwoof with his hard work at editing the PPM, Dejan555 and GC Martin, this is SOLVED!

The pet is at: http://www.complianceman.com/puppy2 along with some other pets I find useful. It creates a simple menu entry under Filesystem called Pet-Install-Quiet and 2 scripts under root/my-applications/bin. I'm posting the md5sums there shortly, as well.

You basically point the program to one directory where you keep all the pets you want to install. In most cases, it will install the pets without you needing to hit "OK" after each install.

If anyone would like to assist with adding a nice front-end GUI, please do so and I'll post the new package!

ADDED NOTES (T+1): Okay, day two and a few extra notes on this.

(1) If you already have the pet installed, you will get the pop-up. Be sure your directory only includes pets not previously installed to your Puppy.

(2) Don570's Right Click Pet has a language pop-up that requires a click. It's still very worth while to install but you may want to do this one separately.

Best,

Slavvo67

----------------------------------------------------------------
Original Post
-----------------------------------------------------------------
I thought that I saw a thread somewhere else about this but I couldn't locate it.

Basically, I'm looking to install maybe 20 pets without clicking. So, no gui and no click to confirm install. I have all the pet packages in one directory. One thing, Also, I want the pet directory to stay intact, as pets after install.

Has anyone done something like this? I suppose I can decompose the pet and copy the desktop files to the appropriate directory and underlying scripts to the other. Just trying to automate it a bit.

Thanks for your help.

Slavvo
Last edited by slavvo67 on Sun 20 Apr 2014, 17:10, edited 7 times in total.

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#2 Post by dejan555 »

You can loop the script from here in a "for" loop
http://www.murga-linux.com/puppy/viewtopic.php?t=93043

for i in *.pet;do scriptname "$i";done
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

gcmartin

#3 Post by gcmartin »

Cant put my finger on it right now, but someone instructed how to combine a bunch of PETs in a folder into a single SFS with a single utility. (or maybe it was the other way around.)

If I find the link, I'll get it posted here.

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#4 Post by rufwoof »

A quick test of copying petget to petgetquiet and editing out prompts in petgetquiet resulted in my being able to exit X and run a petget of the file and it loaded OK

Don't forget with petget you have to fully qualify the pet i.e. full path to the pet file as the parameter - perhaps something like :

./petgetquiet /mnt/sda4/mypets/petfile.pet

The lines commented out are marked with

###Rufwoof

To load SFS's quietly I usually use a script (in the directory where the sfs's are) :

#!/bin/bash
curdir=`pwd`
sfs_load -c -q $curdir/MM.sfs

You could run a series of sfs_load and/or petgetquiet one after another in such a script.

There's no guarantee that will be quiet however, for instance when I load nvidia.sfs using that it still pops up a dialog asking to run Xorgwizard.

#!/bin/sh
#(c) Copyright Barry Kauler 2009, puppylinux.com
#2009 Lesser GPL licence v2 (http://www.fsf.org/licensing/licenses/lgpl.html).
#Note: Puppy Package Manager is started from /usr/local/petget/pkg_chooser.sh for the GUI.
#'petget' is for commandline execution, especially from ROX-Filer.
#If passed param is a pkg name preceded by a + to install pkg, - to uninstall pkg.
# example: +xbubble-0.2.4
#For integration with Rox-Filer, commandline is a .pet|.deb|.tgz|.tar,gz with absolute path, install.
# ex: petget /root/xbubble-0.2.4.pet
#For integration with browser, ex: petget http://somewhere.on.internet/xbubble-0.2.4.pet
#Note, petget also get called from /etc/rc.d/rc.update to remove packages. ex:
# petget -xbubble-0.2.4
# ...when X not running, removal will not put up any DLG windows, will remove without question.
#w482 restart jwm immediately to update menu.
#v424 fix .pet in path with space chars.
#100616 add support for .txz slackware pkgs.
#101116 call download_file to download pkg, instead of direct run of wget.
#101221 yaf-splash fix.
#110505 support sudo for non-root user.
#110523 support for rpm pkgs.
#120101 01micko: jwm >=547 has -reload, no screen flicker.
#120116 rev. 514 introduced icon rendering method which broke -reload at 547. fixed at rev. 574.
#120203 BK: internationalized.
#120323 replace 'xmessage' with 'pupmessage'.

export TEXTDOMAIN=petget___petget
export OUTPUT_CHARSET=UTF-8

[ "`whoami`" != "root" ] && exec sudo -A ${0} ${@} #110505

[ ! $1 ] && exit

#export LANG=C
. /etc/DISTRO_SPECS #has DISTRO_BINARY_COMPAT, DISTRO_COMPAT_VERSION

PASSEDPARAM="$1"

if [ "`echo -n "$PASSEDPARAM" | grep '^\\-'`" != "" ];then
#remove a package...
PKGNAME="`echo -n "$PASSEDPARAM" | cut -c 2-99`"
TREE2="$PKGNAME"
export TREE2
/usr/local/petget/removepreview.sh
exit
fi

#want to install a pkg...

COMPAT_EXT=""
case $DISTRO_BINARY_COMPAT in
slackware)
COMPAT_EXT=".tgz"
;;
debian|ubuntu)
COMPAT_EXT=".deb"
;;
arch)
COMPAT_EXT=".tar.gz"
;;
scientific|redhat|mandriva|mageia) #110523
COMPAT_EXT=".rpm"
;;
esac

#what type is it...
PASSEDBASE="`basename "$PASSEDPARAM"`"
case $PASSEDBASE in
*.pet)
EXT=".pet"
;;
*.deb)
EXT=".deb"
;;
*.tgz)
EXT=".tgz"
;;
*.txz)
EXT=".txz"
;;
*.tar.gz)
EXT=".tar.gz"
;;
*.rpm) #110523
EXT=".rpm"
;;
*)
EXT=""
;;
esac

#download if required...
PKGNAME=""
if [ "`echo -n "$PASSEDPARAM" | grep -E '^ftp|^http'`" != "" ];then
cd /root
#101116 use download_file utility...
#rxvt -title "Puppy Package Manager: download" -bg orange -geometry 80x10 -e wget "$PASSEDPARAM"
download_file "$PASSEDPARAM"
PKGPATH="`dirname "$PASSEDPARAM"`" #really a url.
FULLPKGNAME="`basename "$PASSEDPARAM"`"
PKGMAIN="`basename "$PASSEDPARAM" ${EXT}`"
if [ ! -f "$FULLPKGNAME" ];then
pupmessage -bg red "$(gettext 'Sorry, failed to download') $FULLPKGNAME"
exit
fi
else
#get rid of any leading '+'...
PASSEDPARAM="`echo -n "$PASSEDPARAM" | sed -e 's%^+%%'`"
FIRSTCHAR="`echo -n "$PASSEDPARAM" | cut -c 1`"
if [ "$FIRSTCHAR" = "/" -o "$FIRSTCHAR" = "." ];then
PKGPATH="`dirname "$PASSEDPARAM"`"
FULLPKGNAME="`basename "$PASSEDPARAM"`"
PKGMAIN="`basename "$PASSEDPARAM" ${EXT}`"
else
PKGPATH="`pwd`"
if [ "$EXT" = "" ];then
PKGMAIN="$PASSEDPARAM"
FULLPKGNAME="${PKGMAIN}.pet"
EXT=".pet"
else
FULLPKGNAME="`basename "$PASSEDPARAM"`"
PKGMAIN="`basename "$PASSEDPARAM" ${EXT}`"
fi
fi
cp -f "${PKGPATH}/${FULLPKGNAME}" /root/ 2>/dev/null #v424 fix if spaces in path.
fi
originPKGPATH="$PKGPATH" #w482
PKGPATH=/root

#split PKGMAIN, ex: FULLPKGNAME=xvidtune-1.0.1-i486-1.tgz has PKGNAME=xvidtune-1.0.1
case $EXT in
.deb)
#deb ex: xsltproc_1.1.24-1ubuntu2_i386.deb xserver-common_1.5.2-2ubuntu3_all.deb
DB_nameonly="`echo -n "$PKGMAIN" | cut -f 1 -d '_'`"
DB_pkgrelease="`echo -n "$PKGMAIN" | rev | cut -f 2 -d '_' | cut -f 1 -d '-' | rev`"
prPATTERN="s%\\-${DB_pkgrelease}.*%%"
PKGNAME="`echo -n "$PKGMAIN" | sed -e "$prPATTERN"`"
DB_version="`echo "$PKGNAME" | cut -f 2 -d '_'`"
;;
.pet)
PKGNAME="$PKGMAIN"
DB_version="`echo -n "$PKGNAME" | grep -o '\\-[0-9].*' | sed -e 's%^\-%%'`"
xDB_version="`echo -n "$DB_version" | sed -e 's%\\-%\\\\-%g' -e 's%\\.%\\\\.%g'`"
xPATTERN="s%${xDB_version}%%"
DB_nameonly="`echo -n "$PKGNAME" | sed -e "$xPATTERN" -e 's%\\-$%%'`"
DB_pkgrelease=""
;;
.tgz|.txz)
#slack ex: xvidtune-1.0.1-i486-1.tgz printproto-1.0.4-noarch-1.tgz
PKGNAME="`echo -n "$PKGMAIN" | sed -e 's%\\-i[3456]86.*%%' -e 's%\\-noarch.*%%'`"
DB_version="`echo -n "$PKGNAME" | grep -o '\\-[0-9].*' | sed -e 's%^\\-%%'`"
xDB_version="`echo -n "$DB_version" | sed -e 's%\\-%\\\\-%g' -e 's%\\.%\\\\.%g'`"
xPATTERN="s%${xDB_version}%%"
DB_nameonly="`echo -n "$PKGNAME" | sed -e "$xPATTERN" -e 's%\-$%%'`"
DB_pkgrelease="`echo -n "$PKGMAIN" | sed -e 's%.*\\-i[3456]86%%' -e 's%.*\\-noarch%%' -e 's%^\\-%%'`"
;;
.tar.gz)
#arch ex: xproto-7.0.14-1-i686.pkg.tar.gz trapproto-3.4.3-1.pkg.tar.gz
PKGNAME="`echo -n "$PKGMAIN" | sed -e 's%\\-i[3456]86.*%%' -e 's%\\.pkg$%%' | rev | cut -f 2-9 -d '-' | rev`"
DB_version="`echo -n "$PKGNAME" | grep -o '\\-[0-9].*' | sed -e 's%^\\-%%'`"
xDB_version="`echo -n "$DB_version" | sed -e 's%\\-%\\\\-%g' -e 's%\\.%\\\\.%g'`"
xPATTERN="s%${xDB_version}%%"
DB_nameonly="`echo -n "$PKGNAME" | sed -e "$xPATTERN" -e 's%\\-$%%'`"
DB_pkgrelease="`echo -n "$PKGMAIN" | sed -e 's%\\-i[3456]86.*%%' -e 's%\\.pkg$%%' | rev | cut -f 1 -d '-' | rev`"
;;
.rpm) #110523
#exs: hunspell-fr-3.4-1.1.el6.noarch.rpm
PKGNAME="$PKGMAIN"
DB_version="`echo -n "$PKGNAME" | grep -o '\\-[0-9].*' | sed -e 's%^\-%%'`"
xDB_version="`echo -n "$DB_version" | sed -e 's%\\-%\\\\-%g' -e 's%\\.%\\\\.%g'`"
xPATTERN="s%${xDB_version}%%"
DB_nameonly="`echo -n "$PKGNAME" | sed -e "$xPATTERN" -e 's%\\-$%%'`"
DB_pkgrelease=""
;;
esac

cd "$PKGPATH" #well, this is /root

#confirm want to install...
export INSTALL_DIALOG="<window title=\"$(gettext 'Puppy Package Manager')\" icon-name=\"gtk-about\">
<vbox>
<pixmap><input file>/usr/local/lib/X11/pixmaps/question.xpm</input></pixmap>
<text><label>$(gettext "Click 'OK' button to confirm that you wish to install this package:")</label></text>
<text use-markup=\"true\"><label>\"<b>${FULLPKGNAME}</b>\"</label></text>
<hbox>
<button ok></button>
<button cancel></button>
</hbox>
</vbox>
</window>"
### Rufwoof RETPARAMS="`gtkdialog3 --program=INSTALL_DIALOG`"
### Rufwoof eval "$RETPARAMS"
### Rufwoof [ "$EXIT" != "OK" ] && exit

#find entry in databases...
#pkgname|nameonly|version|pkgrelease|category|size|path|fullfilename|dependencies|description|
#optionally on the end: compileddistro|compiledrelease|repo| (fields 11,12,13)
pPATTERN='^'"$PKGNAME"'|'
if [ "$EXT" = ".pet" ];then
DB_ENTRY="`cat /root/.packages/Packages-puppy-* | grep "$pPATTERN" | sort -r | head -n 1`"
else
DB_ENTRY="`cat /root/.packages/Packages-${DISTRO_BINARY_COMPAT}-* | grep "$pPATTERN" | head -n 1`"
fi

#w482 doesn't matter if incomplete, installpkg.sh will read .desktop file for description and category...
#also, if .pet pkg has pet.specs, that will get written to /root/.packages/user-packages-installed
if [ "$DB_ENTRY" = "" ];then
DB_ENTRY="${PKGNAME}|${DB_nameonly}|${DB_version}|${DB_pkgrelease}||||${FULLPKGNAME}|||"
fi

#w482 hack, if pkg was originally at /root then don't delete it...
[ "$originPKGPATH" = "$PKGPATH" ] && cp -f ${PKGPATH}/${FULLPKGNAME} ${PKGPATH}/${FULLPKGNAME}-TEMPBACKUP

#install pkg...
rm -f /tmp/petget_missing_dbentries-Packages-* 2>/dev/null
rm -f /tmp/petget-installed-pkgs-log 2>/dev/null
echo "$DB_ENTRY" > /tmp/petget_missing_dbentries-Packages-alien
/usr/local/petget/installpkg.sh $PKGPATH/$FULLPKGNAME
RETVAL=$?

#installpkg.sh has already done this...
rm -f $PKGPATH/$FULLPKGNAME 2>/dev/null
rm -f $PKGPATH/${PKGNAME}.tar.gz 2>/dev/null

#w482 hack, if pkg was originally at /root then don't delete it...
[ "$originPKGPATH" = "$PKGPATH" ] && mv -f ${PKGPATH}/${FULLPKGNAME}-TEMPBACKUP ${PKGPATH}/${FULLPKGNAME}

#announce result...
if [ $RETVAL -ne 0 -o ! -s /tmp/petget-installed-pkgs-log ];then
export FAIL_DIALOG="<window title=\"$(gettext 'Puppy Package Manager')\" icon-name=\"gtk-about\">
<vbox>
<pixmap><input file>/usr/local/lib/X11/pixmaps/error.xpm</input></pixmap>
<text use-markup=\"true\"><label>\"<b>$(gettext 'Error, package') ${FULLPKGNAME} $(gettext 'failed to install.')</b>\"</label></text>
<hbox>
<button ok></button>
</hbox>
</vbox>
</window>"
### Rufwoof gtkdialog3 --program=FAIL_DIALOG
exit
fi

INSTALLEDMSG="`cat /tmp/petget-installed-pkgs-log`"
MENUMSG=""
INSTALLEDCAT="`echo -n "$INSTALLEDMSG" | rev | cut -f 1 -d ' ' | rev`"
if [ "$INSTALLEDCAT" = "none" ];then
MENUMSG="<text><label>$(gettext '...note, this package does not have a menu entry.')</label></text>"
else
MENUMSG="<text><label>$(gettext '...look in') '${INSTALLEDCAT}' $(gettext 'in the menu (bottom-left of screen) to run the application.')</label></text>"
fi

#installpkg.sh will have logged to /tmp/petget-installed-pkgs-log
export INSTALL_DIALOG="<window title=\"$(gettext 'Puppy Package Manager')\" icon-name=\"gtk-about\">
<vbox>
<pixmap><input file>/usr/local/lib/X11/pixmaps/ok.xpm</input></pixmap>
<text><label>$(gettext 'The following package has been successfully installed:')</label></text>
<text use-markup=\"true\"><label>\"<b>${INSTALLEDMSG}</b>\"</label></text>
${MENUMSG}
<hbox>
<button ok></button>
</hbox>
</vbox>
</window>
"
### Rufwoof gtkdialog3 --program=INSTALL_DIALOG

RESTARTMSG="$(gettext 'Please wait, updating help page and menu...')"
if [ "`pidof jwm`" != "" ];then #120101
JWMVER=`jwm -v|head -n1|cut -d ' ' -f2|cut -d - -f2`
if vercmp $JWMVER lt 574;then #120116 547 to 574.
RESTARTMSG="$(gettext 'Please wait, updating help page and menu (the screen will flicker!)...')"
fi
fi
[ "$INSTALLEDCAT" = "none" ] && RESTARTMSG="$(gettext 'Please wait, updating help page...')"
#/usr/X11R7/bin/yaf-splash -font "8x16" -outline 0 -margin 4 -bg orange -text "${RESTARTMSG}" &
### Rufwoof yaf-splash -bg orange -text "${RESTARTMSG}" &
X3PID=$!

#w0910 update image cache...
if [ -f /root/.packages/${PKGNAME}.files ];then
if [ "`grep 'usr/share/icons/hicolor' /root/.packages/${PKGNAME}.files`" != "" ];then
gtk-update-icon-cache -f /usr/share/icons/hicolor/
fi
fi

#master help index has to be updated...
/usr/sbin/indexgen.sh
#Reconstruct configuration files for JWM, Fvwm95, IceWM...
if [ "$INSTALLEDCAT" != "none" ];then
/usr/sbin/fixmenus
if [ "`pidof jwm`" != "" ];then #120101
if vercmp $JWMVER lt 574;then #120116 547 to 574.
jwm -restart #w482
else
jwm -reload
fi
fi
fi

kill $X3PID

###END###
Last edited by rufwoof on Sun 20 Apr 2014, 17:23, edited 1 time in total.

gcmartin

#5 Post by gcmartin »

Hello @Slavvo67

Question
  • Would it matter if the multiple PET installer had a frontend GUI kicker where the folder path was selected?
I'm still searching for that utility I remember which took multiples and combined them into a single. Seemingly, that utility could be adapted easily to meet system installation desire.

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#6 Post by rufwoof »

With that petgetquiet script (standard petget but with the gtk and yaf-splash dialogs commented out, if you wanted to load all pets in a directory, you could use a script such as

#!/bin/bash
curdir=`pwd`
ls *.pet >/tmp/pets
while read line; do petgetquiet "$curdir/$line"; done < /tmp/pets
rm /tmp/pets

which assumes the script is in the directory where the pets were and petgetquiet had been installed (and made executable) in /usr/sbin (or somewhere else in the $PATH).

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#7 Post by rufwoof »

gcmartin wrote:I'm still searching for that utility I remember which took multiples and combined them into a single. Seemingly, that utility could be adapted easily to meet system installation desire.
Perhaps have a look at the likes of

mksquashsfs - which takes a directory content (maybe extracted tar file) and turns it into a sfs

createsfs - which takes pets and/or sfs's and combines them into a single sfs

for instance I use something like

./createsfs -f multimedia xvidcap-1.1.6-i486.pet audacity-1.3.14.pet

to create a multimedia_.sfs file that contains xvidcap and audacity

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#8 Post by slavvo67 »

Guys:

As an update, I found Dejan's solution worked ok for my purposes. I do, however have very simple pets (1 script for root/my-applications/bin and 1 desktop menu file in each pet). It seems to error out when more complex pet packages are used. I'd like to fix it up and package it with a menu entry so others can use.

Thank you all for your help with this. I'm sure there are other solutions, as well so please keep posting them!

Dejan, thanks for your help and your nice photo links.

Slavvo

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#9 Post by slavvo67 »

Hi @GCMARTIN

The initial start-up isn't important. The basis is simply not having to click ok, ok, ok, a hundred times when installing multiple pets to a Puppy. The solution by Dejan doesn't work on all pets so I'm still seeking something better.

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#10 Post by slavvo67 »

@Rufwoof

Thank you for the insanely long post! LOL So, I copied your editing work and renamed it petgetq. So the q is for quiet, of course. I then created Quietinstall1, a mini script to grab all the pets from my directory and use petgetq to install:

cd /
cd /mnt/sda1/Quirky_Tested_Pets/Must_Have_Utils
for i in *.pet; do
petgetq "$i"
done
echo "Fixing menus so the Menu entries appear ... ... ..."
fixmenus

The fixmenus is probably not necessary. This baby worked like a charm. So I'm going to package the 2 into 1 pet for others after changing the 2nd line above to an input directory line.

I'm going to add it to this link for others to download. I'm working on adding must have pets to this site for myself and others.

http://www.complianceman.com/puppy2

OK - It's now uploaded along with an "AnyCarve" Script that I put together a while back. Anycarve puts a menu entry in Business (where I keep most menu entries for my scripts) and Pet-Installer-Quiet will put a menu entry under Filesystem.

I hope this helps others that are seeking to do the same.

All the best,

Slavvo

gcmartin

#11 Post by gcmartin »

Great! Understanding that this combined creations by everyone of you culminated in a solution that can make life easier for many users who stumble onto this thread's effort.

Months back some members were looking a how to stop certain PPM versions from destroying the PETs after installation. They were successful to the point where some PPMs offer a "download only" or a "save after install feature". Assuming one captures many PETs into a single folder, I think everyone can see how having this kind of application has benefit in testing, recoveries, restructuring, or building a new system with the folder PETs.

A single front-end could make this very obvious for anyone new and learning simple ways in PUPPY packaging and uses while providing simple explanation. GUI could launch if no folder input provided when script used. Just an idea.

Great work..everyone. Cheers! 8)

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#12 Post by Puppus Dogfellow »

there's also LazyFBI from RSH:

Introducing LazY FBI 0.1!

LazY-FBI, the (F)antastic (B)atch-Mode Pet-(I)nstaller makes you able to install all files from a directory into your puppy.

All you have to do, is: do a right-click on a directory containing .pet, .deb, .tar.gz, .tgz, .txz and tar.bz2 files.
iirc, i used it in precise 5.4.3 with success.

gcmartin

Multiple PETs Combining Tool

#13 Post by gcmartin »

Hi Everyone

OK, I did not find who provides this (I have it dated 2012-03-18 ), but, here's what I have. I have it named "pets2PET.sh". Hope it is found useful at this late stage.

Code: Select all

#!/bin/sh
# ____________________________________________________________
# This script intends to take a single directory of PETs and build a
# "single composite PET" containing all PETs found in the directory
# 
# When invoked, it expect the path-name of the directory
# containing the PETS
# ____________________________________________________________

if [ ! $1 ];then
   echo "No dir given. Usage: `basename $0` [directory]
   
Example: `basename $0` $HOME/myfiles

Info:

This script combines your .PETs into a single .PET or .SFS file.
You will be asked to create a .PET file first, then a .SFS file
if no .PET was created. This script takes one argument - the
directory containing the .PETs that you want to combine into
a single package.

"
   exit
fi

mkdir $1/pets
mkdir $1/files
for i in "$1/"* ; do # for each file in the given package dir
   # get filenames, and extensions, without paths
   export fullname=`basename "$i"`    # filename and extension
   export filename=${fullname%.*}    # filename, no extension
   export extension=${fullname##*.} # extension only
   tar -xzvf "$i" -C "$1/pets"
   # copy extracted contents (only the stuff inside the extracted folders) from $workdir into $basedir
   cp --preserve=all -f -v -r "$1/pets/$filename/"* "$1/files"
   # remove pet.spec files in $basedir
   rm -v "$1/files/"*"pet.specs"
done
rm -r -v $1/pets
rmdir $1/pets

REPLY="none"
# ask to create pet
[ -e `which dir2pet` ] && Xdialog --title "Pet Create" --yesno "Do you want to create new pet file of the pets you have extracted?" 0 0 && REPLY=$?
if [ "$REPLY" = 0 ];then
   petname=$(Xdialog --title "Name your pet" --stdout --inputbox "Choose a filename for your pet file" 0 0 "name-version.pet")
   mv $1/files $1/${petname%.*} # rename dir to $petname, without extension
   rxvt -e dir2pet $1/${petname%.*}
else
   # ask to make sfs file
   [ -e `which dir2pet` ] && Xdialog --title "SFS Create" --yesno "Do you want to create an sfs file of the pets you have extracted?" 0 0 && REPLY=$?
   [ "$REPLY" = 0 ] && rxvt -e dir2sfs $1/files
fi

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#14 Post by slavvo67 »

Thank you Puppus and GC. I will try them, as well. I'm pretty happy with what we accomplished but I know RSH does some quality work so I will tet that pet and that script seems to have some promise, as well.

Either way, I have officially overcome the problem of reinstalling pets that I like everytime I download a new puppy distro. If I'm correct, our original solution still makes entries into the Puppy Package Manager in case you want to easily uninstall. For me, that's a pretty big thing, as well.

The next issue is sorting pets for each puppy version. I'm feeling this will be more challenging....

UPDATE: I just tried the LazyFBI and accidentally did it in the wrong directory. Now I have the package manager trying to install everything, including css files, html files, etc. Please use that one with extreme caution.

The Script provided by GCMartin apparently combined 2 pets but did not take all 5 of mine that I had in one directory. It looks interesting and promising with some tweaks but does not seem to get the job done in its current format.

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#15 Post by rufwoof »

Hi gcmartin.

Whilst its nice to combine multiple PET's into a single PET (or SFS), I suspect the 'quietly load all PET's in a directory' is potentially more useful overall. With a single large PET (or SFS) comprised of many individual PET's, if any one PET is changed then .... create a new single large SFS/PET again ?

With all PET's in a directory being loaded there's less of a management task involved (just remove myap_v1.pet from the directory and replace it with myap_v2.pet)

I like the idea of the core puppy being very light and leave it to the owner to decide which pets to have loaded or not. Abiword, geany, gnumeric, leafpad, LibreOffice ...etc. Some owners will prefer some combinations of pets, other owners will prefer other choices of pets. IME once in a distro, removing existing programs (abiword..etc) is more awkward than not having it in the distro in the first place and adding a pet to include the program if desired.

Not so much an issue for those who run a full install or even frugal/savefile. But for those of us who use a LiveCD approach and dynamically load (or not) different Pet's and Sfs's at each session, the load all pets in a directory is a useful utility.

Slavvo
Thank you for the insanely long post!
Sorry about that. On other boards when you enter text between CODE tags IME the code window tends to be relatively short (10 lines or so) and scrollable. I didn't realise that here that's not the case (and I was too lazy/tired to remove/edit the post after I'd posted it).

gcmartin

#16 Post by gcmartin »

HI @Rufwoof. Thanks for sharing what you did.
Rufwoof wrote:I like the idea of the core puppy being very light and leave it to the owner to decide which pets to have loaded or not. Abiword, geany, gnumeric, leafpad, LibreOffice ...etc. Some ...
This statement is important! Reason: This is where there exist much contention in the Puppy community. There are those, experienced members, who feel that making any user work for what his system should look like is good; while others, especially newbies want complete operation out-of the-box (OOTB) distros, where they begin immediately with a base set of applications built-in being productive with little to no need to install anything.

There is no right answer to this, as everyone comes to Puppyland with completely differing backgrounds.

Most of the people I have helped over the years find comfort in OOTB to get them started. Everyone of them were/are Windows users,not programmers or scriptwriters. After which, they are free to then evaluate what other distros they should consider. People that I know who have industry experience, almost never ask for help; but, from time to time have ask my opinion.

I take no offense or positions to those who want to provide a base where its the user's responsibility to learn, each and every thing one must include in his system.

I take no offense or position to those who want to make system use with a goodly combination of matching subsystems as they find in MACs or Windows PC. But, it has been my experience that any PC sold in the last decade will easily run every PUPPY distro, in Puppyland, including light, fat, phat, etc..

I take, again, no position on trying to help members, as you do too, who seek to investigate ways of managing a portable base of subsystems that they can add at various times to distros they test or use. The effort in this thread seems to be one of those.

Are there pitfalls, yes! One is what you have shared when new versions of a PET become available not to mention management of the PPM tables reflecting current status of installed packages. But, as things have gone in the past in this forum, ideas usually start small and flower into an across the board solution. Not saying that this will be one of those, but ???

I don't think we are ever going to have a consensus on which distro approach is best, but, it is nice to know that Linux, at large, and Puppyland as a subset, the discussion and feeling as to which is better, "minimalist" or "complete" continues to have 2 camps.

I see benefits in each.

Here to help

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#17 Post by slavvo67 »

I agree to disagree... Woof Woof!!!

It's funny because I like both types of distros. There are pet applications that I would never find if they weren't installed in some distro. Ultimately, it helps me build a library of what's worth while. On the other hand, I don't care for a distro cluttered with stuff that I'll never use. Also, there are some applications that I almost expect to be there as a standard (i.e. what, no Geany?). If they're not included, I scratch my head and ask what the developer was thinking. It's a tough call, for sure.

I have a much bigger issue with developers making puppies that are less friendly to novice or even intermediate users. You shouldn't have to use a programming script to install ... or have some non-automated way to make a save file. This is where a balance or even more a common sense should come into play...

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#18 Post by slavvo67 »

I have upgraded this package to Pet-Installer-Quiet-2 which allows for choosing the Pet directory using GUI. It still works primarily in the terminal, but now you can point and click to choose the directory where your pets are installed. This was done with a small Zenity script so be sure you have Zenity installed before using. I'm also keeping the old Pet-Installer-Quiet up for those that just want to use terminal. If you're not sure, just type zenity in your terminal window. You'll know....

One note: I'm not a pro at using GUI so this was simply an attempt to make the script slightly more user friendly. The pet package creates a Pet-Installer-Quiet2 Menu item in the Filesystem Menu.

This will be added momentarily to:
http://www.complianceman.com/puppy2

Best,

Slavvo

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#19 Post by greengeek »

Hi slavvo - thanks for the pets. I gave them a try last night but could not find the right way to make them work. I was confusd by the fact that the "quietinstall" scripts do not have a "#!/bin/bash" line at the top?? Is that how they are supposed to be?

Anyway, I was able to use your code to build myself another pet to fulfill my specific needs and I will post my pet here in case it suits anyone else:

This pet loads a "petloadquiet" script into /root/Startup so that it runs at each boot or after a restart of X. It looks for a directory called /root/Startup/pets2install and installs all pets that it finds inside that directory. (The user has to previously create the /root/Startup/pets2install directory manually and ensure that pets they place in there are compatible and proven to run).

This works well for me because I do not have any savefile - I want my puppy to boot into a "generic" state every time and if I want to change its behaviour I just add pets into that directory and let the pet auto installer do it for me. I have added a couple of advisory messages to keep the user informed, but no clicking or interaction is required.

It runs on my Slacko 5.6 derivative but may also run elsewhere.
Attachments
petloadquiet_gg-0.2.pet
(4.56 KiB) Downloaded 157 times

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#20 Post by slavvo67 »

Yikes! So my amateur ways have come out. The bin/bash is actually not necessary if you have it clicked as executable and I keep these scripts in root/my-applications/bin.

That being said, I should revisit my script, as well. My script might not work in Slacko because Slacko doesn't have YAD installed (I think). I'll revisit this....

Best,

Slavvo67

Post Reply