Getting the APPDIR from installed PET?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
R-S-H
Posts: 487
Joined: Mon 18 Feb 2013, 12:47

Getting the APPDIR from installed PET?

#1 Post by R-S-H »

Hi.

Is there any way to make a pinstall.sh script able to know from which location its PET is installed?

Let's say, the PET is downloaded to /root /downloads (but can also be somewhere else) and the pinstall.sh script could find the PET in /root/downloads (or somewhere else) - is this possible?

Thanks

RSH
[b][url=http://lazy-puppy.weebly.com]LazY Puppy Home
The new LazY Puppy Information Centre[/url][/b]

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#2 Post by amigo »

I don't think so -the script gets run in '/' by the intsaller -you could modify PPM (or whatever it is) so that the location of the raw package could be used. But, it sounds like you are trying to do something really weird(outside the scope of the script) -why should the pinstall.sh care or need to know where the original package is?

R-S-H
Posts: 487
Joined: Mon 18 Feb 2013, 12:47

#3 Post by R-S-H »

But, it sounds like you are trying to do something really weird(outside the scope of the script) -why should the pinstall.sh care or need to know where the original package is?
The original package is a special build package for automated update application. It creates and supports files to read information and to look at screenshots online before installing the package.

To exclude the package from the list (if then installed) at next check for updates, each package has an automatically created pinstall.sh script (existing one is first renamed and then included at this action) that writes an empty file to mark the package as installed in the OS.

The idea is now to include available online information into this empty file.

I can do this from within the Updater GUI code - already done and working. But if one chooses to download only and install later (online information is downloaded also then) the package needs to find the now local saved information file.

Inside the Updater GUI it will then be possible to read all information to online available and not yet installed packages (first tab) and also to read all information to already installed packages (second tab) - so the user would be well informed at every time. :D
[b][url=http://lazy-puppy.weebly.com]LazY Puppy Home
The new LazY Puppy Information Centre[/url][/b]

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#4 Post by amigo »

"package needs to find the now local saved information file" Then, the location of these information files needs to be standardized so that any pinstall.sh can find the right one.

But, what you are trying to do is way outside the scope of an install script: 'look at screenshots online before installing the package' By the time the install script is run -the package has already been installed! The install script performs any actions which are needed to complete the installation -but the dirs and files of the package are already in place at this time.

You are trying to do something elegant with package handling, but you are building on top of a completly non-elegant packaging and installation system. Neither PPM or even the pet format are equipped for doing anything fancy -they don't even cover the most basic functionality of software delivery and installation. I seem to recall something about "sow ears and silk purses"...

R-S-H
Posts: 487
Joined: Mon 18 Feb 2013, 12:47

#5 Post by R-S-H »

"package needs to find the now local saved information file" Then, the location of these information files needs to be standardized so that any pinstall.sh can find the right one.
That's how they are (until the user moves the package before installing) - made with a especially build petmaker for these sort of packages (which are usual packages with additions).
But, what you are trying to do is way outside the scope of an install script: 'look at screenshots online before installing the package' By the time the install script is run -the package has already been installed! The install script performs any actions which are needed to complete the installation -but the dirs and files of the package are already in place at this time.
No, the pinstall script does only msrk the package as installed. Everything else is either build/created by the special petmaker or provided through the Updater GUI

You are trying to do something elegant with package handling, but you are building on top of a completly non-elegant packaging and installation system. Neither PPM or even the pet format are equipped for doing anything fancy -they don't even cover the most basic functionality of software delivery and installation. I seem to recall something about "sow ears and silk purses"...
So, I got to get creative a little... :lol:
[b][url=http://lazy-puppy.weebly.com]LazY Puppy Home
The new LazY Puppy Information Centre[/url][/b]

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#6 Post by amigo »

"location of these information files needs to be standardized" I man use an absolute path -then it won't matter where the package is.

PPM really does very little in the way of 'housekeeping' -that's its' first problem- so it wouldn't take much to duplicate(and expand) its' functionality completely with your tool. Who knows? You might come up with the next Big Thing in Puppylandia!

R-S-H
Posts: 487
Joined: Mon 18 Feb 2013, 12:47

#7 Post by R-S-H »

amigo wrote:PPM really does very little in the way of 'housekeeping' -that's its' first problem- so it wouldn't take much to duplicate(and expand) its' functionality completely with your tool.
I do not know much about the package manager, but it would be exactly just one single line needed to add to the code of petget.

This is line 285 in LazY Puppy petget, which is a modified version (password check for the User mode kids, beginner and intermediary; check for available SFS of program to install (names of SFS are placed in diff. lists); preventing some predefined files not to be replaced on package install (as the whole petget directory) etc.pp.) - so, in the usual petget it's surely another line number:

Code: Select all

cp -f "${PKGPATH}/${FULLPKGNAME}" /root/ 2>/dev/null #v424 fix if spaces in path.
The petget just would need to do:

Code: Select all

echo "${PKGPATH}/${FULLPKGNAME}" > /path/to/a/file
just after the code below. Then each (that kind of) pinstall.sh script reads the file and would know the original place of its PET! :D

But this would need to be built in by default, otherwise its gone when updating the installed petget (that's why I did add functions to LazY Puppy petget; one can install updates of petget, but these updates will never stay!).

To add full functionality of this to the package manager it would be surely some more work to do, but, for sure, its even possible.

For anyone who might be interested on the project where this here is placed in, please look here.

RSH
[b][url=http://lazy-puppy.weebly.com]LazY Puppy Home
The new LazY Puppy Information Centre[/url][/b]

Post Reply