How to install a Pet file from the command line?

Using applications, configuring, problems
Message
Author
ndujoe1
Posts: 851
Joined: Mon 05 Dec 2005, 01:06

How to install a Pet file from the command line?

#1 Post by ndujoe1 »

Is there a command line statement that will install a pet file without being in X?

User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#2 Post by Aitch »


User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#3 Post by technosaurus »

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
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
upnorth
Posts: 287
Joined: Mon 11 Jan 2010, 19:32
Location: Wisconsin UTC-6 (-5 DST)
Contact:

petget at command line noX

#4 Post by upnorth »

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

User avatar
neurino
Posts: 362
Joined: Thu 15 Oct 2009, 13:08

#5 Post by neurino »

I resume this topic to know if there are some updates...

I want to make a little script that will install a bunch of pets so I can avoid the hassle of doing it one by one every time I need to make a new savefile...

Of course there must be no confirmation dialogs etc... error handling is welcome but I'd use it only with already well tested pets.

Of course I want to be able to uninstall every single pet installed with this script via classic Package manager.

Any tip?

Lord_Solrac2
Posts: 35
Joined: Thu 23 Dec 2010, 00:58
Location: Gurabo, Puerto Rico
Contact:

#6 Post by Lord_Solrac2 »

Copy and Paste This Save as "petall" (PET Install)

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
To Do Multiple I Would Suggest Making a Folder where all the pets are (of the program/lib you want are the only ones in the folder)
in the terminal

cd /dir/to/pet/files/folder
pet2tgz ./*
tar -xf ./*

Now you should have all the packages in separated folders, now just copy and paste all of the contents into another new folder (SAME DIRECTORY)

example
dir1/
bin/
app
usr/
lib/
lib.so
pet.specs

move each FOLDER (Not The Files, it'll take you longer obviously)(Forget About the pet.specs)
into one New Folder and now just close the folder
it should look like this

dir1/
<EMPTY>
pet.specs

dir2/
bin/
app
app2
usr/
lib/
lib.so
lib2.so

and in the terminal

dir2pet <FOLDER_NAME_WHERE_ALL_THE_FILES_ARE>
#^^ __Not The bin folder, the main folder (example dir would be dir2)

in the GUI window you'll just select stuff, put the package ID and Author,
The Section (if a Library, chose BuildBlock)
the rest is self done so click ok
and now

petget <THE_FINAL_DOTPET_IS_NAMED_JUST_LIKE_THE_FOLDER>

Or Just Click the pet file and install

lol I think I wrote something noob friendly xD lol No Offense
I'm Currently Doing Something Like That[/code]

For WITHOUT X just use the terminal Command above (Green Text)
And It should work still :3

User avatar
neurino
Posts: 362
Joined: Thu 15 Oct 2009, 13:08

#7 Post by neurino »

Thanks Lord_Solrac2 but your procedure would take me more than the time to install all pets just clicking on them :wink: nor I will be then able to uninstall a single package.

What I was looking for, and probably the hard part is to get rid of dialogs, a CLI tool that should work like this (suppose tool is named petjet, I omit versions in pet names):

Code: Select all

petjet gimp.pet deadbeef.pet numlockx.pet shell-fm.pet trayfm.pet tinygmc.pet skype.pet ...
or even

Code: Select all

petjet defaults/*.pet
and will install them one-by-one in a bunch with no more user intervention (given I already tested all pets in a precedent installation and I'm sure they work).

One-by-one part is mandatory sinc I want to be free to, say, later disinstall skype only and replace it with a newer version.

It's not easy, I know, but a kind of Ubuntu apt-get with limited features on install and remove and a force option to assume I always agree to the default option:

- install? => Y
- remove? => Y
- deps missing, install anyway? => Y
- rm -r / ? => N :D

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

Re: petget at command line noX

#8 Post by sc0ttman »

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
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!
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

mekalu2k4
Posts: 117
Joined: Tue 22 Apr 2014, 21:29

these commands not working?

#9 Post by mekalu2k4 »

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

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#10 Post by Semme »

It's rt-clk, install. FD700 has slapt-get for a shell installer.

Unless you know what you're doing, stick to pkgs compiled for your build.

Code: Select all

slapt-get --list | less
>>> Living with the immediacy of death helps you sort out your priorities. It helps you live a life less trivial <<<

mekalu2k4
Posts: 117
Joined: Tue 22 Apr 2014, 21:29

fd-64 is small for now, needs to grow

#11 Post by mekalu2k4 »

thanks for the inputs. will wait until this puppy grows to its name

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: these commands not working?

#12 Post by L18L »

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
Right click on desktop, choose "Help" and read the line in red might help.

Fatdog is not Puppy.
Fatdog has some threads of its own.

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

#13 Post by greengeek »

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
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.

Instead of using the download method i am trying to access pets i have already stored in /opt/b3user. Here is my script (including various explanatory notes i made to myself) if anyone is able to see what I am doing wrong:

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

User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

#14 Post by Keef »

Probably needs a 'cd' into the expanded directory.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#15 Post by MochiMoppel »

@greengeek
technosaurus responded to the OP's request "install a pet file without being in X". Is that really what you are after?
Besides: What technosaurus describes looks like a brute-force way to expand a pet package into the filesystem. This is not what I would call "installation". You wouldn't be able to uninstall (at least not easily). The way described by upnorth, using petget, should work.

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

#16 Post by greengeek »

Probably needs a 'cd' into the expanded directory.
Thanks, I will give that a try.
MochiMoppel wrote:technosaurus responded to the OP's request "install a pet file without being in X". Is that really what you are after?
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.
The way described by upnorth, using petget, should work.
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:
Attachments
petget_error.jpg
(79.19 KiB) Downloaded 848 times

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#17 Post by MochiMoppel »

Firstly: I doubt that what technosaurus described works "most of the time". May depend on the tar version and on the way the pet file was created. And pinstall.sh normally is not a hidden file. This should work better:
tar --strip-components=2 -xf /path/to/package.pet -C /
/pinstall.sh
rm /pinstall.sh
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.
greengeek wrote:I am wanting to install certain pets during the boot process - my plan was to use a script in /root/Startup.
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.

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.
even if i then accept the dialog and let it continue to install the pet I see the following messages:
What i see is a -syntactically incorrect - attempt to uninstall.

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

#18 Post by greengeek »

MochiMoppel wrote:What i see is a -syntactically incorrect - attempt to uninstall.
Oh yes. No wonder I have so much trouble getting things done - can't read properly.
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.
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.
This should work better:

Code: Select all

tar --strip-components=2 -xf /path/to/package.pet -C /
/pinstall.sh 
rm /pinstall.sh
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.
Please excuse my ignorance - do you mean that tar and gzip are the same thing?
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.
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.

Thanks for the help - this gives me some options to try.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#19 Post by MochiMoppel »

greengeek wrote:Hmmm, that surprises me. I would have thought such an idea would be welcomed
You are not alone. The world is full of surprises
Please excuse my ignorance - do you mean that tar and gzip are the same thing?
No, they are not. Tar internally first uses gzip to decompress the files, then copies the decompressed files to the destination folder(s).
Not so keen if the messages have to be acknowledged manually
That's the whole idea of a quiet command line script.

BTW. Fiddled a bit more: This should also work. Looks a bit cleaner and removes pet.specs and any puninstall.sh

Code: Select all

cd /
tar --strip-components=2 -xf /path/to/package.pet
/pinstall.sh 
rm pinstall.sh puninstall.sh pet.specs

User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

#20 Post by Keef »

4MLinux does a similar thing - apart from busybox and some core libs, all other packages are unpacked during boot-up. They are simple *tar.gz's, so 'tar -xf package.tar.gz -C /' works well.
Actually, they do it like this:

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
Everything is packed into the initrd to start with.

'Cloned' it once using Puppy libs and binaries tarred and gzipped into custom packages (lumped all the bits needed for wifi together, and also for Opera). All the X stuff was courtesy of goingnuts' (and others) static builds. A bit crude, but it worked. Too lazy to do it again.

Post Reply