How to install a Pet file from the command line?
Posted: Sun 28 Feb 2010, 13:48
Is there a command line statement that will install a pet file without being in X?
READ-ONLY Archive
https://oldforum.puppylinux.com/
Code: Select all
#!/bin/sh
if [ $1 = "" ]; then
echo "Usage :: petall /dir/to/pet/file "\("Don't Put The .pet at the end"\)""
exit 0
fi
if [ -f "$1" ]; then
pet2tgz "$1".pet
tar -xf "$1".tar.gz
cd "$1"
if [ -f ./pinstall.sh ]; then
./pinistall.sh
exit 0
fi
if [ -f ./.pinstall.sh ]; then
./.pinstall.sh
exit 0
fi
rm -rf ./pet.specs
mv -rf ./* /
echo "Done"
exit 0
fi
Code: Select all
petjet gimp.pet deadbeef.pet numlockx.pet shell-fm.pet trayfm.pet tinygmc.pet skype.pet ...
Code: Select all
petjet defaults/*.pet
I will have to try this... Never found petget to work for me before, unless I am running an X desktop... I want a true CLI version... So I'll try this again!upnorth wrote:You should try "petget +<package name>" to install
"petget -<package name>" to uninstall
Just to clarify:
when installing, use an absolute path.
eg: #petget +/root/downloads/firefox-3.0.pet
when uninstalling, don't specify name with suffix, only package name.
eg: #petget -firefox-3.0
Code: Select all
slapt-get --list | less
Right click on desktop, choose "Help" and read the line in red might help.mekalu2k4 wrote:Hi,
I just installed fatdog64 and have a few pets and sfs files [like libreoffice, compiz, thunderbird etc].
how to install (or add) them?
the commands onthis page [petget + ....] seem to be not working.
Thanks in advance for clarification and assistance
I could be using this wrong but I don't see how this installs the actual directories included with the .pet - i can see how it runs the pinstall.sh and then removes the pinstall.sh, but I just end up with the expanded directories sitting in /root and not installed.technosaurus wrote:or something like this should work most of the time
wget -c http://URL/package.pet
pet2tgz package.pet
tar -xf package.tar.gz /
/.pinstall.sh
rm /.pinstall.sh
Code: Select all
#!/bin/bash
#Based on technosaurus method to cli install a pet
#http://www.murga-linux.com/puppy/viewtopic.php?p=396930#396930
#(I plan to use this to expand /opt/pets by action of /root/Startup script)
#Next version I should probably copy the pet as some generic name before installing it so it doesn't disappear.
pet2tgz /opt/b3user/FoxitPDF_b3gg-0.1.pet
#next line didnt work so i had to remove the / off the end - then it opened into root
#tar -xf /opt/b3user/FoxitPDF_b3gg-0.1.tar.gz /
tar -xf /opt/b3user/FoxitPDF_b3gg-0.1.tar.gz
#Next line doesnt work as it doesnt reference the folder in /root
#/.pinstall.sh
/root/FoxitPDF_b3gg-0.1/.pinstall.sh
#again - next line does not reference location of expanded pet and also calls it dotpinstall.sh
#rm /.pinstall.sh
rm /root/FoxitPDF_b3gg-0.1/pinstall.sh
rm /root/FoxitPDF_b3gg-0.1/pet.specs
Thanks, I will give that a try.Probably needs a 'cd' into the expanded directory.
I am wanting to install certain pets during the boot process - my plan was to use a script in /root/Startup. (My reasoning is that I could add compatible pets into my Puppy derivative as a 'payload' as they take up less room in pet form than they do as installed software). I guess X is in fact running at the stage of processing /root/Startup scripts, so in that sense yes i am probably in the wrong thread - although if the pet installation can occur prior to X starting that would be a potential solution too.MochiMoppel wrote:technosaurus responded to the OP's request "install a pet file without being in X". Is that really what you are after?
Thanks. Just gave that a try and there are two problems. Firstly if i do that I get a dialog box asking me if i want to install the pet (which makes it a manual process rather than automatic and unseen by the user) and secondly, even if i then accept the dialog and let it continue to install the pet I see the following messages:The way described by upnorth, using petget, should work.
You don't really need to run pet2tgz. Gzip will - in its own words - "ignore the garbage" , i.e. the trailing md5 string attached to each pet file. In some cases, when you don't care about littered pet.specs files and you don't need to uninstall, this crude method may work for you, but generally I don't recommend it.tar --strip-components=2 -xf /path/to/package.pet -C /
/pinstall.sh
rm /pinstall.sh
OK, so you want the same as neurino: A hasslefree and silent installation of pets. Happens to be the same I was proposing here, but judging from the odd reactions I received this is not what many users want and some users even oppose. Just look at this thread: It's more than 4 years since neurino asked for it. Nothing happended.greengeek wrote:I am wanting to install certain pets during the boot process - my plan was to use a script in /root/Startup.
What i see is a -syntactically incorrect - attempt to uninstall.even if i then accept the dialog and let it continue to install the pet I see the following messages:
Oh yes. No wonder I have so much trouble getting things done - can't read properly.MochiMoppel wrote:What i see is a -syntactically incorrect - attempt to uninstall.
Hmmm, that surprises me. I would have thought such an idea would be welcomed - especially as carrying a pet as a payload seems to consume less storage space than having it expanded into the filesystem already.
Please excuse my ignorance - do you mean that tar and gzip are the same thing?This should work better:You don't really need to run pet2tgz. Gzip will - in its own words - "ignore the garbage" , i.e. the trailing md5 string attached to each pet file. In some cases, when you don't care about littered pet.specs files and you don't need to uninstall, this crude method may work for you, but generally I don't recommend it.Code: Select all
tar --strip-components=2 -xf /path/to/package.pet -C / /pinstall.sh rm /pinstall.sh
I would really like an automatic method (not involving manual input) but I don't really mind verbosity - especially if it occurs while the system is booting then disappears. Not so keen if the messages have to be acknowledged manually.Peeling off all these pesky confirmation and warning dialogs for a true command line operation is a lot of work. From my own experience: Very interesting and rewarding, because you can get exactly what you need, but it's not much fun.
You are not alone. The world is full of surprisesgreengeek wrote:Hmmm, that surprises me. I would have thought such an idea would be welcomed
No, they are not. Tar internally first uses gzip to decompress the files, then copies the decompressed files to the destination folder(s).Please excuse my ignorance - do you mean that tar and gzip are the same thing?
That's the whole idea of a quiet command line script.Not so keen if the messages have to be acknowledged manually
Code: Select all
cd /
tar --strip-components=2 -xf /path/to/package.pet
/pinstall.sh
rm pinstall.sh puninstall.sh pet.specs
Code: Select all
echo "The item NEW ADDONS is being processed..."
mkdir /var/4MLinux 2>/dev/null
ADDON_LIST=$(ls /etc/init.d/addon_*.tar.gz 2>/dev/null)
for i in $ADDON_LIST; do
echo "->Installing $i"
tar -xz -f $i -C /
mv $i /var/4MLinux
done
mv /etc/init.d/core /var/4MLinux 2>/dev/null