Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 27 Nov 2014, 05:40
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Getting the APPDIR from installed PET?
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
R-S-H

Joined: 18 Feb 2013
Posts: 490

PostPosted: Sat 16 Mar 2013, 00:03    Post_subject:  Getting the APPDIR from installed PET?  

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

_________________
LazY Puppy Home
The new LazY Puppy Information Centre

Back to top
View user's profile Send_private_message 
amigo

Joined: 02 Apr 2007
Posts: 2279

PostPosted: Sat 16 Mar 2013, 04:20    Post_subject:  

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?
Back to top
View user's profile Send_private_message 
R-S-H

Joined: 18 Feb 2013
Posts: 490

PostPosted: Sat 16 Mar 2013, 04:49    Post_subject:  

Quote:
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. Very Happy

_________________
LazY Puppy Home
The new LazY Puppy Information Centre

Back to top
View user's profile Send_private_message 
amigo

Joined: 02 Apr 2007
Posts: 2279

PostPosted: Sat 16 Mar 2013, 06:14    Post_subject:  

"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"...
Back to top
View user's profile Send_private_message 
R-S-H

Joined: 18 Feb 2013
Posts: 490

PostPosted: Sat 16 Mar 2013, 06:21    Post_subject:  

Quote:
"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).

Quote:
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


Quote:
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... Laughing

_________________
LazY Puppy Home
The new LazY Puppy Information Centre

Back to top
View user's profile Send_private_message 
amigo

Joined: 02 Apr 2007
Posts: 2279

PostPosted: Sat 16 Mar 2013, 11:48    Post_subject:  

"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!
Back to top
View user's profile Send_private_message 
R-S-H

Joined: 18 Feb 2013
Posts: 490

PostPosted: Sat 16 Mar 2013, 15:58    Post_subject:  

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:
cp -f "${PKGPATH}/${FULLPKGNAME}" /root/ 2>/dev/null #v424 fix if spaces in path.

The petget just would need to do:
Code:
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! Very Happy

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

_________________
LazY Puppy Home
The new LazY Puppy Information Centre

Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0649s ][ Queries: 12 (0.0050s) ][ GZIP on ]