(OLD) (ARCHIVED) Puppy Linux Discussion Forum Forum Index (OLD) (ARCHIVED) Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info

This forum can also be accessed as http://oldforum.puppylinux.com
It is now read-only and serves only as archives.

Please register over the NEW forum
https://forum.puppylinux.com
and continue your work there. Thank you.

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups    
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 22 Sep 2020, 02:02
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
PPM: How to download packages into any directory
Moderators: Flash, Ian, JohnMurga
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
Page 5 of 6 [85 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6 Next
Author Message
mavrothal


Joined: 24 Aug 2009
Posts: 3108

PostPosted: Wed 03 Dec 2014, 16:06    Post subject:  

mavrothal wrote:
Yes could be using the defined directory for consistency


OK here is a patch for petget. Whoever builds the next version (if not me) is welcome to use it.
Code:
--- a/usr/local/petget/petget   2014-08-27 23:07:44.000000000 +0300
+++ b/usr/local/petget/petget   2014-12-03 23:53:14.036633783 +0200
@@ -35,6 +35,12 @@
 
 [ ! $1 ] && exit
 
+if [ -f /root/.packages/download_path ]; then
+ . /root/.packages/download_path
+ [ -d "$dir_prefix" ] && dir_prefix="$dir_prefix" || dir_prefix=/root
+else
+ dir_prefix=/root
+fi
 #export LANG=C
 . /etc/DISTRO_SPECS #has DISTRO_BINARY_COMPAT, DISTRO_COMPAT_VERSION
 
@@ -97,7 +103,7 @@
 #download if required...
 PKGNAME=""
 if [ "`echo -n "$PASSEDPARAM" | grep -E '^ftp|^http'`" != "" ];then
- cd /root
+ cd "$dir_prefix"
  #101116 use download_file utility...
  download_file "$PASSEDPARAM"
  PKGPATH="`dirname "$PASSEDPARAM"`" #really a url.
@@ -126,10 +132,10 @@
    PKGMAIN="`basename "$PASSEDPARAM" ${EXT}`"
   fi
  fi
- cp -f "${PKGPATH}/${FULLPKGNAME}" /root/ 2>/dev/null #v424 fix if spaces in path.
+ cp -f "${PKGPATH}/${FULLPKGNAME}" "$dir_prefix"/ 2>/dev/null #v424 fix if spaces in path.
 fi
 originPKGPATH="$PKGPATH" #w482
-PKGPATH=/root
+PKGPATH="$dir_prefix"
 
 #split PKGMAIN, ex: FULLPKGNAME=xvidtune-1.0.1-i486-1.tgz has PKGNAME=xvidtune-1.0.1
  case $EXT in
@@ -178,7 +184,7 @@
   ;;
  esac
 
-cd "$PKGPATH" #well, this is /root
+cd "$PKGPATH"
 
 #confirm want to install...
 export INSTALL_DIALOG="<window title=\"$(gettext 'Puppy Package Manager')\" icon-name=\"gtk-about\">
@@ -219,7 +225,7 @@
 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
+/usr/local/petget/installpkg.sh "$PKGPATH"/$FULLPKGNAME
 RETVAL=$?
 
 #installpkg.sh has already done this...


In the mean time you may want to test the next PPM project: Installing multiple packages at once with PPM (attended too)

_________________
== Here is how to solve your Linux problems fast ==
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 2084
Location: Japan

PostPosted: Wed 03 Dec 2014, 21:42    Post subject:  

bigpup wrote:
I too was looking for a download location option as Greengeek talks about.
You should keep in mind the main reason for a download option (see 2nd para of my initial post): to help people who have a skimpy pupsave file and not enough room in /root. The download directory is foremost a working directory, should be the fastest possible and /root is still a good choice for most users. The present default is: download pet to RAM, install and delete. The pet never touches your USB or HDD.

EDIT: OK, last statement depends on PUPMODE. I'm using PUPMODE 5 and tend to forget that some modes write directly to disc.

If you ask for a default directory for download-only pets, then we are possibly talking about a target somewhere on a permanent save location. Normally this location outside of RAM would be much slower and not ideal for PPM as a working directory.

@mavrothal
After good night's sleep I think that petget should keep its current defaults. Was just one of those ideas Laughing


-

Last edited by MochiMoppel on Thu 04 Dec 2014, 02:36; edited 1 time in total
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 13981
Location: S.C. USA

PostPosted: Thu 04 Dec 2014, 02:00    Post subject:  

MochiMoppel you bring up some good points.

However, this feature is already changing the default download location and making this change the new default setting.

I may be wrong, but as it stands the normal install operation:
Quote:
download pet to RAM, install and delete

is not that clearcut anymore.
It will use this new location to do the install.
So, does it not already do what you are worried about?

AT least what I propose would make you at least verify the setting is what you want to use and give you option to change it, just before doing the download.

Just to make the discussion more confusing.
Seems working only in ram, is not that clear, for a normal program install.
Before adding the download feature it still had options.

PPM could have two possible looks after adding this feature.

see images:
capture12187.png
 Description   PPM before adding download option
 Filesize   33.66 KB
 Viewed   410 Time(s)

capture12187.png

download_folder.png
 Description   download feature added to PPM on a hard drive install
 Filesize   26.51 KB
 Viewed   414 Time(s)

download_folder.png

capture15919.png
 Description   download feature added to PPM on a USB flash drive
 Filesize   38.39 KB
 Viewed   408 Time(s)

capture15919.png


_________________
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected Shocked
YaPI(any iso installer)
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 2084
Location: Japan

PostPosted: Thu 04 Dec 2014, 10:19    Post subject:  

@bigpup
Interesting. I've never seen the installation mode option. This will be shown only to users of PUPMODE 3,7 or 13.
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 2084
Location: Japan

PostPosted: Tue 09 Dec 2014, 09:41    Post subject:  

mavrothal wrote:
configure.sh: Add GUI code to check and save user options for download folder and to save installed pets
downloadpkgs.sh: Add code to look for presets (dir and save pet); cd to preset dir; change hard coded /root to preset dir;
installpkg.sh: double quote pre-existing variables so will accept path names with spaces; modify code so will not delete installed pets if we choose to save them
verifypkg.sh : double quote pre-existing variables so will accept path names with spaces
pet2tgz: modify code so will not delete installed pets if we choose to save them
download_file.sh: Add code to look for presets dir (only when called from PPM); cd to preset dir; double quote pre-existing variables so will accept path names with spaces; added download dir variable to wget command (this last one could be skipped since we already cd'ed in it but some extra precausion)

Would be nice if some of these changes can be eliminated and still maintain the same functionality.

Done. Laughing I tried to keep changes to a minimum, which eliminates some of your fixes but on the other hand adds some new ones.

I tested in Slacko and Precise. I tried to make it compatible with Lucid 5.2.8 but gave up. Too many differences. Lucid users can still patch manually (solution 2), this worked. And Puppy 4.2...no way, but solution 1 always works.

Biggest change is the GUI. I moved the directory selection from the configuration dialog to the preinstall dialog. I did this mainly for technical reason, but there is also a benefit for the users: The choices are more visible and are better linked to their context. It also answers the request of some forum members who asked for the option to choose a download directory before each download.
Features of directory input field:
  • Input field shows current download directory
  • New directories entered into the field will be created on-the-fly if they don't exist.
  • User may enclose path with quotation marks (he shouldn't, but if he does, the marks will be stripped automatically)
The pet includes 4 files:

installpreview.sh
- Added GUI code to check and save user options for download folder and to save installed packages.

downloadpkgs.sh:
- cd to preset dir
- Removed hard coded /root
- Modified "Finished. The packages have been downloaded" dialog to show correct download path
- Fixed bug which would show "Finished. The packages have been downloaded" dialog even if download failed and nothing had been downloaded.

installpkg.sh:
- Added function to optionally keep installed packages in the download directory.
- Added code to correctly reassemble .pet files after PPM changed them to .tar.gz files

download_file
- Changed PWD variable to dot placeholder to avoid problems with spaces in path name.

Keyword "mochi" will find all my changes and comments.
preinstall.png
 Description   
 Filesize   30.74 KB
 Viewed   351 Time(s)

preinstall.png

ppm_mochi-1.pet
Description  Adds option to choose dl directory and to keep pkgs after install
pet

 Download 
Filename  ppm_mochi-1.pet 
Filesize  27.35 KB 
Downloaded  250 Time(s) 
Back to top
View user's profile Send private message 
Jasper

Joined: 25 Apr 2010
Posts: 1350
Location: England

PostPosted: Tue 09 Dec 2014, 12:48    Post subject:
Subject description: ppm_mochi-1.pet
 

Hi all,

I have tried the above pet with Precise 5.6 (in pupmode 77) and also with Quirky unicorn 6.2.1 and it worked well in both.

Thank you MochiMoppel.

My regards
Back to top
View user's profile Send private message 
Griot


Joined: 12 Sep 2014
Posts: 131
Location: Serbia

PostPosted: Tue 09 Dec 2014, 15:21    Post subject:
Subject description: PPM vs. gtkdialog - solved!
 

Ok, after Mochi's intervention on the installpreview.sh script,
my problem with the PPM disappeared. Very Happy
There was some kind of gtkdialog nonsense which caused
an error while trying to select download dir. It's gone with the wind.

Thanks again Mochi. Wink
sjp15_8.jpg
 Description   Good luck!
 Filesize   5.81 KB
 Viewed   228 Time(s)

sjp15_8.jpg


Last edited by Griot on Thu 11 Dec 2014, 11:08; edited 2 times in total
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 2084
Location: Japan

PostPosted: Tue 09 Dec 2014, 23:07    Post subject:  

@ Jasper:Thanks for testing.
@ Griot: Check your mail Wink
Back to top
View user's profile Send private message 
mavrothal


Joined: 24 Aug 2009
Posts: 3108

PostPosted: Wed 10 Dec 2014, 00:58    Post subject:  

MochiMoppel wrote:
mavrothal wrote:

Would be nice if some of these changes can be eliminated and still maintain the same functionality.

Done. Laughing I tried to keep changes to a minimum, which eliminates some of your fixes but on the other hand adds some new ones.


Works OK.
As far as I can see you moved the configure.sh and pet2tgz changes in installpreview.sh (BTW, why duplicate the pet2tgz function ?) and left out the verifypkg.sh change.
One thing I noticed in the current implementation is that if someone drags a folder in the path field, the name is added in what ever is already there, and also accepts files too. So you can have "/mnt/home/Download/more pets/root/my-documents/test.txt" as your path. And then it goes ahead and creates the folder with this path and name (which is good - the folder creation). You may want to erase the previous path and accept only folders, when drag&drop.
I also noticed in the code that you already marked some bugs. Are you working on these?

I personally find the installprview window too loaded and maybe confusing (specially if you add the examine dependencies button and info on top), combining configuration and installation options with minimal info, but I'm sure there are people preferring it this way Cool. I go the "opposite" way right now, automating things Wink Is good for puppy users to have options Very Happy
You may still want to keep configuration options in configure.sh and add the change-folder option only when "Download" is pressed .

_________________
== Here is how to solve your Linux problems fast ==
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 2084
Location: Japan

PostPosted: Thu 11 Dec 2014, 22:44    Post subject:  

mavrothal wrote:
As far as I can see you moved the configure.sh and pet2tgz changes in installpreview.sh
I moved pet2tgz changes to installpkg.sh, not installpreview.sh, keeping pet2tgz unchanged
Quote:
(BTW, why duplicate the pet2tgz function ?)
Wasn't my idea. That's the way bug fix 101225 was implemented in verifypkg.sh, and since we need exactly the same functionality for installed pets that was needed for download-only pets, I used the same code. I figured it would be confusing to have 2 different code solutions for the same thing. That doesn't mean that I like the code. There are much more elegant ways to do it, but then I would also have to fix the bug fix 101225, which obviously was approved by the Puppy makers. As I said before I tried to keep changes to a minimum. The target is to implement the new download functionality. Changes not directly related to that will have to wait.
Quote:
.... left out the verifypkg.sh change.
There was nothing to change.
Quote:
One thing I noticed in the current implementation is that if someone drags a folder in the path field, the name is added in what ever is already there
Just normal behavior in any input field. I believe that users who prefer drag&drop already know this. I can change this and have the input text selected whenever the window is activated. This would replace the existing path when another path is dropped on it.
Quote:
I also noticed in the code that you already marked some bugs. Are you working on these?
Only one, and that I fixed already. What else did you notice?
Quote:
I personally find the installprview window too loaded and maybe confusing (specially if you add the examine dependencies button and info on top), combining configuration and installation options with minimal info
I'm not sure if I understand correctly. I fully agree that the preinstall dialog is overloaded, but only because it carries too much non-essential text. Just look at the screenshot. Who needs that stuff? Telling me that everything looks OK and that PPM will check again to make sure that it is really OK and that I may push the "Install" button now. Frankly, I prefer to know only if something is not OK. And then this big "More Info" button, together with a lengthy explanation what I can expect when I push it. I appreciate explanations, but they belong into tooltips, keeping the main window tidy. Could it be that tooltips were not yet implemented when the dialogs were designed?
Your "minimal information" refers to the entry field? Whatever is neccessary is there, the rest should go into a tooltip. I haven't done it yet, we are still in alpha. Particularly the checkbox needs explanation because not every user understands the installation procedure.
I think we can't make a clear-cut distinction between configuration and installation option. If a user prefers to always download pets to the same folder and always keep installed pets, then you may call it a configuration option. Set and forget. Other users may change their preference depending on the information in the preinstall dialog, mainly the package size. They may want to download huge packages to a different location than they normally would download small ones. And likewise they may opt to discard installed pets depending on the nature of the pets. For such users it would be an installation option.
Quote:
You may still want to keep configuration options in configure.sh and add the change-folder option only when "Download" is pressed .
Do we agree that the user may want to know where downloads will be saved and that he may want to know this before he presses the Install or Download-only button?
Back to top
View user's profile Send private message 
mavrothal


Joined: 24 Aug 2009
Posts: 3108

PostPosted: Fri 12 Dec 2014, 01:06    Post subject:  

MochiMoppel wrote:
Do we agree that the user may want to know where downloads will be saved and that he may want to know this before he presses the Install or Download-only button?


Don't wary about it. Will always be people disagree or agree with whatever is there. So do as you like. Laughing
I would prefer a cleaner GUI with configurations in "preferences", and there in addition to the "path" and "keep" options, have the "ask every time" option that will show up only when you choose to "download only" or have "keep" preselected in config.
But I'm sure <puppyuser2> is loving it the way it is and ask if possible to add a field/button so "when there are dependencies to keep the main package and its dependencies in their own folder " Rolling Eyes

_________________
== Here is how to solve your Linux problems fast ==
Back to top
View user's profile Send private message 
Jasper

Joined: 25 Apr 2010
Posts: 1350
Location: England

PostPosted: Fri 12 Dec 2014, 07:57    Post subject:  

Hi mavrothal,

As I wrote above - MochiMoppel's pet worked for me - and I understood the options. So, in an effort to help others.....

and as an exercise in logic - I have just spent some 40 minutes trying to simplify a small part of the gui wording limited to the download location and saving and deletion and, so far, I'm not pleased with my attempts.

I hope the use of a later version of the pet (if any) will be optional rather than mandatory.

My regards
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5834
Location: Republic of Novo Zelande

PostPosted: Fri 12 Dec 2014, 15:44    Post subject:  

MochiMoppel wrote:
Done. Laughing I tried to keep changes to a minimum, which eliminates some of your fixes but on the other hand adds some new ones.
ppm_mochi-1.pet works perfectly for me on a Slacko 5.6 derivative. Sorry for the late report - I got odd results during testing but then found it was my own fault for losing a vital symlink during a remaster and that stuffed up my PPM.

I like the way this pet is working - it does everything I need. (I don't do anything complex with PPM so can't say that I've done extensive testing...)
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 13981
Location: S.C. USA

PostPosted: Fri 12 Dec 2014, 22:06    Post subject:  

Just to give you some added information.

All that information on the GUI is old school Puppy.
From Puppies beginning, it was common for the information about what you were doing would be displayed when you did it.
Tried to eliminate the need for help documents to read or even need to have in Puppy.

It does seem a little overdone at times, but not to a new user of Puppy. Wink
They need any and all the help they can get.

Remember, you where one at one time Laughing

_________________
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected Shocked
YaPI(any iso installer)
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 2084
Location: Japan

PostPosted: Sat 13 Dec 2014, 00:50    Post subject:
Subject description: PPM vs. gtkdialog - solved!
 

Griot wrote:
Ok, after Mochi's intervention on the installpreview.sh script,
my problem with the PPM disappeared. Very Happy
There was some kind of gtkdialog nonsense which caused
an error while trying to select download dir. It's gone with the wind.

I guess I'll have to explain that. Laughing

In short: The folder dialog that appears when you press the "Change" button doesn't work correctly in Precise (all versions). After pressing "OK" the dialog doesn't close and the selected folder path would not be pasted into the entry field.

The problem occurs because PPM calls "gtkdialog3" to display the preinstall dialog. Though gtkdialog3 is obsolete, there is no problem in Slacko: A symlink gtkdialog3 points to the binary gtkdialog, which happens to be the latest gtkdialog version.

In Precise, for reasons beyond me, 2 indentically named symlinks gtkdialog exist, one points to binary gtkdialog4, the other to gtkdialog3. In Precise, a script gets what it asks for. If it calls gtkdialog3, Precise runs a real gtkdialog3, version 0.7.20 to be precise. The functions in the folder dialog require at least version 0.7.21.

Changing the code in PPM from "gtkdialog3" to "gtkdialog" fixes the problem, because Precise first will try the symlink gtkdialog that points to gtkdialog4.

@mavrothal: Any chance that all references to gtkdialogX are changed to gtkdialog to facilitate future updates? You already touched this problem in your other thread.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 5 of 6 [85 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6 Next
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


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