The time now is Tue 19 Jan 2021, 16:43
All times are UTC - 4 |
Page 1 of 6 [85 Posts] |
Goto page: 1, 2, 3, 4, 5, 6 Next |
Author |
Message |
MochiMoppel

Joined: 26 Jan 2011 Posts: 2084 Location: Japan
|
Posted: Tue 25 Nov 2014, 00:00 Post subject:
PPM: How to download packages into any directory Subject description: Building a new PPM pet and providing hacks for old Puppies |
|
The Puppy Package Manager (PPM) tends to download, install and then delete packages. I prefer to keep the package, inspect the contents and - maybe - install it by clicking on the downloaded pet file. I don't want PPM to install it for me. Adding a download-only button to PPM can help here, but adding such button to older distros is cumbersome and may not even work. Too many PPM flavors.
Another cause for trouble is the download directory. PPM insists on downloading to /root. Downloads to /root, even temporary ones, eat into the personal storage space (e.g. remaining space on pupsave file) and may freeze the system. Direct downloads to a destination outside of Puppy, e.g. /mnt/home, would alleviate the problem.
The following solutions can solve both problems.
Solution 1
Extremely simple, keeps downloaded pets, prevents automatic installation, works even in very old Puppy versions
Necessary actions:
Step 1: Open editor and create new document
Step 2: Add line dir_prefix = /mnt/home/downloads <= adapt path. No quotation marks!
Step 3: Save as /root/.wgetrc
What happens
Pushing the "Install" or the "Download-only" button in PPM will save packages directly to the defined directory.
PPM doesn't like that and responds with funny messages: "Error, failed to download XXX.pet", followed by an equally phony "Finished. The packages have been downloaded to /root". Ignore them. Tip: If you have a choice between an "Install" and a "Download-only" button, always push the "Install" button. This prevents the second message. In no case will packages be installed.
How it works
As many other programs, PPM "outsources" the downloading job to /usr/bin/wget, yet PPM blindly relies on wget's default behaviour. By default wget downloads to the current working directory, so PPM would set this directory with a "cd /root" command, and when it passes the package's URL to wget it would expect that wget saves the file to /root. PPM is not clever enough to check if the user has set a different default path in the .wgetrc config file and it also doesn't bother to add the target directory to the download parameters . When wget passes control back to PPM, PPM would search for the downloaded file in /root, can't find it and cries foul.
How to reset
Many options...
- Delete or rename .wgetrc
- Comment out the line (# dir_prefix = /mnt/home/downloads)
- If you feel nerdy, set it to default: dir_prefix = . (that's a single period, representing the current directory)
and of course you can scriptify any of those simple manual tasks
Solution 2
Some editing necessary, keeps PPM fully functional, works in all fairly new Puppies. Tested in Lucid 5.2.8
Necessary actions:
Step 1: Open file /usr/local/petget/downloadpkgs.sh with an editor
Step 2: Find line cd /root and change to cd "/mnt/home" (or whatever download directory you prefer)
Step 3: Find lines
/usr/local/petget/verifypkg.sh /root/$DLPKG
else
/usr/local/petget/installpkg.sh /root/$DLPKG
Change to
/usr/local/petget/verifypkg.sh $DLPKG
else
/usr/local/petget/installpkg.sh $DLPKG
Step 4: Find line
<text><label>$(gettext 'Finished. The packages have been downloaded to') /root $(gettext 'directory.')</label></text>
Change to
<text><label>$(gettext 'Finished. The packages have been downloaded to') $PWD $(gettext 'directory.')</label></text>
What happens
Pushing the "Install" or the "Download-only" button in PPM will download packages directly to the defined directory. If the defined directory does not exist (unmounted, removed, misspelled etc.) the packages will be downloaded to /root. By default PPM will delete downloaded packages after installation. If you want to keep them, do this:
Optional actions (to prevent deletion of downloaded packages):
Step 5: While still editing file downloadpkgs.sh find line
[ "$PASSEDPARAM" != "DOWNLOADONLY" ] && rm -f /root/$DLPKG 2>/dev/null
Comment it out by putting a # in front:
#[ "$PASSEDPARAM" != "DOWNLOADONLY" ] && rm -f /root/$DLPKG 2>/dev/null
Step 6: Save and close downloadpkgs.sh and open file /usr/local/petget/installpkg.sh
Step 7: Use the "Find" dialog of your editor and search for the string "rm -f $DLPKG"
Depending on PPM version this will find once or twice these 2 lines:
rm -f $DLPKG_BASE 2>/dev/null
rm -f $DLPKG_MAIN.tar.${EXT} 2>/dev/null
Comment them out by putting a # in front:#rm -f $DLPKG_BASE 2>/dev/null
#rm -f $DLPKG_MAIN.tar.${EXT} 2>/dev/null
What happens
After completing steps 1-7 you will have a PPM that
- Works as usual, but for downloads uses the path set in step 2
- Keeps the downloaded packages after install
- Handles inaccessible download directories gracefully, falls back to /root
Solution 3 (added 2014-12-17)
Here the pizza with everything. A pet with the features of solution 2. Does not work with Lucid, but should be OK with all recent Precise and Slacko variants. For users of Precise: The "Download-only" button is also inluded, so no need to apply a manual patch.
The pet is the result of following vivid discussions and put here for better accessibility.
Features:
- Option to keep or discard packages after installation
- Last selected download folder will be saved
- New folders will be created on-the-fly if they don't exist.
-----
 |
Description |
Adds option to choose dl directory and to keep pkgs after install
|

Download |
Filename |
ppm_mochi-2.pet |
Filesize |
27.59 KB |
Downloaded |
498 Time(s) |
Description |
|
Filesize |
43.3 KB |
Viewed |
967 Time(s) |

|
Last edited by MochiMoppel on Wed 17 Dec 2014, 05:44; edited 5 times in total
|
Back to top
|
|
 |
mavrothal

Joined: 24 Aug 2009 Posts: 3108
|
Posted: Tue 25 Nov 2014, 03:28 Post subject:
Re: How to force PPM to download packages into any directory Subject description: A simple solution for PPM and Sfs Manager |
|
MochiMoppel wrote: |
Solution (example)
Step 1: Open editor and create new document
Step 2: Add line dir_prefix = /mnt/home/downloads <= adapt path. No quotation marks!
Step 3: Save as /root/.wgetrc
What happens
Pushing the "Install" or the "Download-only" button in PPM will save packages directly to the defined directory.
PPM doesn't like that and responds with funny messages: "Error, failed to download XXX.pet", followed by an equally phony "Finished. The packages have been downloaded to /root". Ignore them. Tip: If you have a choice between an "Install" and a "Download-only" button, always push the "Install" button. This prevents the second message. In no case will packages be installed. |
The problem that I see with the wgetrc approach is that changes wget behavior globally so if someone uses i outside ppm the packages will still be downloaded in the predefined directory.
The patches below use the $dir_prefix variable defined in the /root/.packages/download_path file that looks like this
Code: | dir_prefix=/mnt/home/downloads |
and work fine either to download only or to install the pet without any errors (tested in slacko6)
If the /root/.packages/download_path does not exist ppm still works as usual.
Here are the patches.
Code: | --- a/usr/local/petget/downloadpkgs.sh 2014-03-09 22:10:29.000000000 +0200
+++ b/usr/local/petget/downloadpkgs.sh 2014-11-25 10:25:25.740018392 +0200
@@ -39,6 +39,7 @@
. /root/.packages/DISTRO_PKGS_SPECS #
. /root/.packages/DISTRO_PET_REPOS #has PET_REPOS, PACKAGELISTS_PET_ORDER
. /root/.packages/DISTRO_COMPAT_REPOS #v431 has REPOS_DISTRO_COMPAT
+[ -f /root/.packages/download_path ] && . /root/.packages/download_path || dir_prefix=/root
echo -n "" > /tmp/petget-installed-pkgs-log
@@ -237,17 +238,17 @@
download_file ${DOWNLOADFROM}/${ONEFILE}
if [ $? -ne 0 ];then #101116
DLPKG="`basename $ONEFILE`"
- [ -f $DLPKG ] && rm -f $DLPKG
+ [ -f /$dir_prefix/$DLPKG ] && rm -f /$dir_prefix/$DLPKG
fi
unset DL_F_CALLED_FROM
fi
sync
DLPKG="`basename $ONEFILE`"
- if [ -f $DLPKG -a "$DLPKG" != "" ];then
+ if [ -f $dir_prefix/$DLPKG -a "$DLPKG" != "" ];then
if [ "$PASSEDPARAM" = "DOWNLOADONLY" ];then
- /usr/local/petget/verifypkg.sh /root/$DLPKG
+ /usr/local/petget/verifypkg.sh $dir_prefix/$DLPKG
else
- /usr/local/petget/installpkg.sh /root/$DLPKG
+ /usr/local/petget/installpkg.sh $dir_prefix/$DLPKG
#...appends pkgname and category to /tmp/petget-installed-pkgs-log if successful.
fi
if [ $? -ne 0 ];then
@@ -264,7 +265,7 @@
FAILCNT=`expr $FAILCNT + 1` #101118
fi
#already removed, but take precautions...
- [ "$PASSEDPARAM" != "DOWNLOADONLY" ] && rm -f /root/$DLPKG 2>/dev/null
+ [ "$PASSEDPARAM" != "DOWNLOADONLY" ] && rm -f $dir_prefix/$DLPKG 2>/dev/null
else
export FAIL_DIALOG="<window title=\"$(gettext 'Puppy Package Manager')\" icon-name=\"gtk-about\">
<vbox>
@@ -290,7 +291,7 @@
export DL_DIALOG="<window title=\"$(gettext 'Puppy Package Manager')\" icon-name=\"gtk-about\">
<vbox>
<pixmap><input file>/usr/local/lib/X11/pixmaps/ok.xpm</input></pixmap>
- <text><label>$(gettext 'Finished. The packages have been downloaded to') /root $(gettext 'directory.')</label></text>
+ <text><label>$(gettext 'Finished. The packages have been downloaded to') $dir_prefix $(gettext 'directory.')</label></text>
<hbox>
<button ok></button>
</hbox>
|
and
Code: | --- a/usr/sbin/download_file 2014-06-18 09:26:56.000000000 +0300
+++ b/usr/sbin/download_file 2014-11-25 10:31:02.013358584 +0200
@@ -38,6 +38,7 @@
FILENAME="`basename "$@"`"
URLDIR="`dirname "$@"`" #121019
. /etc/rc.d/PUPSTATE
+[ -f /root/.packages/download_path ] && . /root/.packages/download_path || dir_prefix=/root
#121019 ***TODO***
#note: in future maybe make this into a gtkdialog window, with a button to launch web browser...
@@ -113,6 +114,7 @@
#101117 check enough free space...
#FREEK=`df -k | grep ' /$' | tr -s ' ' | cut -f 4 -d ' '`
#no, need to know free space in whatever is current dir...
+cd ${dir_prefix}
PWD="`pwd`"
FREEblocks=`stat -f --format=%a ${PWD}`
BLOCKsize=`stat -f --format=%S ${PWD}`
|
Now all we need is a dialog in /usr/local/petget/configure.sh, say in the miscellaneous tab, to allow user to define $dir_prefix easily
_________________ == Here is how to solve your Linux problems fast ==
|
Back to top
|
|
 |
MochiMoppel

Joined: 26 Jan 2011 Posts: 2084 Location: Japan
|
Posted: Tue 25 Nov 2014, 07:14 Post subject:
Re: How to force PPM to download packages into any directory Subject description: A simple solution for PPM and Sfs Manager |
|
mavrothal wrote: | The problem that I see with the wgetrc approach is that changes wget behavior globally so if someone uses i outside ppm the packages will still be downloaded in the predefined directory. | Could even be an advantage. Users who use the wget command in a terminal or in scripts usually define an output directory with the -P switch, so they are not affected by .wgetrc. If they don't define anything and leave the decision to wget (= current situation), results can become unpredictable. Another nice feature of the wgetrc approach: The download directory appears in the header of the wget output, so the user gets this useful piece of information everytime he/she uses the command.
I see the aproach as a quick and easy work around. A proper solution needs to dig deeper
Quote: | The patches below use the $dir_prefix variable defined in the /root/.packages/download_path file that looks like this
Code: | dir_prefix=/mnt/home/downloads |
and work fine either to download only or to install the pet without any errors (tested in slacko6)
If the /root/.packages/download_path does not exist ppm still works as usual. |
I assume that it would only work as usual as long as a .wgetrc file doesn't set a different path. Priorities are .wgetrc -> download_path -> /root
I think it would be cleaner and rock solid if $dir_prefix (defined in download_path or wherever) would be passed by wget with -P option. This would have highest priority and can't be changed anymore by any other command or variable.
|
Back to top
|
|
 |
mavrothal

Joined: 24 Aug 2009 Posts: 3108
|
Posted: Tue 25 Nov 2014, 08:05 Post subject:
Re: How to force PPM to download packages into any directory Subject description: A simple solution for PPM and Sfs Manager |
|
MochiMoppel wrote: |
I think it would be cleaner and rock solid if $dir_prefix (defined in download_path or wherever) would be passed by wget with -P option. |
OK here it is
Code: | --- a/usr/sbin/download_file 2014-06-18 09:26:56.000000000 +0300
+++ b/usr/sbin/download_file 2014-11-25 14:01:46.593596287 +0200
@@ -38,6 +38,7 @@
FILENAME="`basename "$@"`"
URLDIR="`dirname "$@"`" #121019
. /etc/rc.d/PUPSTATE
+[ -f /root/.packages/download_path ] && . /root/.packages/download_path || dir_prefix=/root
#121019 ***TODO***
#note: in future maybe make this into a gtkdialog window, with a button to launch web browser...
@@ -113,6 +114,7 @@
#101117 check enough free space...
#FREEK=`df -k | grep ' /$' | tr -s ' ' | cut -f 4 -d ' '`
#no, need to know free space in whatever is current dir...
+cd ${dir_prefix}
PWD="`pwd`"
FREEblocks=`stat -f --format=%a ${PWD}`
BLOCKsize=`stat -f --format=%S ${PWD}`
@@ -204,7 +206,7 @@
rxvt -geometry 130x10+0+0 -bg "$BG" -fg "$FG" -title "$(gettext 'Downloading file:') ${URLSPEC}" -e tail -f /tmp/download_file_spider.log2 & #120908 restored.
PID1=$!
#-t 5 means retry 5 times, -w 5 means wait 5 seconds between retries...
- wget -4 ${CONTPARAM} -t 5 -w 5 "${URLSPEC}" > /tmp/download_file_spider.log2 2>&1
+ wget -4 ${CONTPARAM} -t 5 -w 5 -P $dir_prefix "${URLSPEC}" > /tmp/download_file_spider.log2 2>&1
if [ $? -ne 0 ];then
Xdialog --wmclass "gtkdialog2" --title "$(gettext 'Puppy File Downloader')" --screen-center --cr-wrap --ok-label "$(gettext 'TRY AGAIN')" --cancel-label "$(gettext 'GIVE UP')" --icon "/usr/local/lib/X11/pixmaps/error.xpm" --yesno "$(gettext 'Download failed, see log top-left of screen.
Do you want to try again, or give up?')" 0 0
|
About this gtkdialog modification to configure.sh I can not help. The gtkdialog rewrite of configure.sh appears too finicky for my abilities.( )
Maybe one of the resident gtkdialog experts will add a frame so the user can define the path of the download directory and then echo "dir_suffix=$path" into /root/.packages/download_path
_________________ == Here is how to solve your Linux problems fast ==
|
Back to top
|
|
 |
mavrothal

Joined: 24 Aug 2009 Posts: 3108
|
Posted: Tue 25 Nov 2014, 11:41 Post subject:
Re: How to force PPM to download packages into any directory Subject description: A simple solution for PPM and Sfs Manager |
|
mavrothal wrote: | About this gtkdialog modification to configure.sh I can not help. |
Oh well I lied
Here is the patches, the customary picture showing the download folder dialog in the configure window and a pet that incorporates the 3 patches above (and latter 3 more) and will add in PPM the option to define where to download pets that you "download only" and the option to also keep the installed pets (see pic below)
Is tested in Slacko-6 beta, and Tahr-6.O CE
Also works in Precise-5.x, Slacko-5.x and even Lucid 5.2.8(!) though the "download only" option does not exist in these older pups. It can be added as described here. The "save installed pets" option does not need any additional modifications in these older pups.
Please test as hard as you can so it may eventually go to woof for future puppies
The following files were changed
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)
Edit: v2 also informs for the current download file
Edit 2: v3 accepts folder names with spaces - Broken
Edit 3: v 4 will correctly work when names of the folders have spaces - oops never made it through
Edit 4: v 5 accepts pathnames with spaces and provides the option to save the installed pets
Edit 5: v 6 will not break other apps that may use the download_file script
Edit 6: v 7 "final" I hope
Edit 7: v 8 checks that the download folder really exists. Also works fine in older pupps
Edit 8: v 9 Bug fix for v8 (v7 was OK). Thx rg66 and greengeek.
 |
Description |
Adds the option to define a pet download directory and also have the option to save installed pets. Can be used with older pupps too
|

Download |
Filename |
ppm_down_dir-9.pet |
Filesize |
24.56 KB |
Downloaded |
636 Time(s) |
Description |
Patches to add this functionality to ppm (for developers). Older pup compatibility (non svg icons), not included.
|

Download |
Filename |
ppm_downdir_patches-9.tar.gz |
Filesize |
20 KB |
Downloaded |
408 Time(s) |
Description |
|
Filesize |
26.51 KB |
Viewed |
1537 Time(s) |

|
_________________ == Here is how to solve your Linux problems fast ==
Last edited by mavrothal on Tue 02 Dec 2014, 04:46; edited 27 times in total
|
Back to top
|
|
 |
MochiMoppel

Joined: 26 Jan 2011 Posts: 2084 Location: Japan
|
Posted: Wed 26 Nov 2014, 01:34 Post subject:
Re: How to force PPM to download packages into any directory Subject description: A simple solution for PPM and Sfs Manager |
|
You've opened Pandora's box. Good luck
mavrothal wrote: | ...will add in PPM the option to define where to download pets (either to keep or transiently during installation). | Works as advertised in Slacko 5.9.3 .... and triggers the next request: An option to keep downloads after install. I remember that I've done it once and that it wasn't too hard, but of course can be shelved as long as there is no demand.
You need to use quotation marks for the variable in /root/.packages/download_path and also when using the variable in the scripts, otherwise download paths containing spaces don't work.
More general thought: I never understood why configure.sh saves settings to /var/local/petget/ . Seems wrong to me. Now that even /root/Startup moved to /root/.config I think it's time to create and use a /root/.config/petget
And this is where download_path should go, not to /root/.packages/
|
Back to top
|
|
 |
mavrothal

Joined: 24 Aug 2009 Posts: 3108
|
Posted: Wed 26 Nov 2014, 02:50 Post subject:
Re: How to force PPM to download packages into any directory Subject description: A simple solution for PPM and Sfs Manager |
|
MochiMoppel wrote: | An option to keep downloads after install. I remember that I've done it once and that it wasn't too hard, but of course can be shelved as long as there is no demand. |
I do not thing there is "demand" for any of these. Is just fun
Maybe in v4
MochiMoppel wrote: | You need to use quotation marks for the variable in /root/.packages/download_path and also when using the variable in the scripts, otherwise download paths containing spaces don't work. |
Done in version 3 above
_________________ == Here is how to solve your Linux problems fast ==
|
Back to top
|
|
 |
MochiMoppel

Joined: 26 Jan 2011 Posts: 2084 Location: Japan
|
Posted: Wed 26 Nov 2014, 05:44 Post subject:
|
|
Sorry for getting into nitpicking mode, but I stumbled on something that made me scratch my head for half an hour.
The "Finished. Packages have been downloaded" gtkdialog in downloadpkgs.sh. I don't know if you misplaced the quotes or if this was intentional. Anyway, my suggestion:
Code: | <text><label>$(gettext 'Finished. The packages have been downloaded to') "${dir_prefix}" $(gettext ' directory.')</label></text> |
In your and my version the line breaks after the first forward slash, which looks odd. Unfortunately gtkdialog regards the slash as a word boundary, just like a space. I found no way to insert a linefeed before the slash without breaking the label text. Is there any way? I finally settled for 2 text widgets, my second suggestion. IMHO this produces the most readable dialog:
Code: | <text><label>$(gettext 'Finished. The packages have been downloaded to')</label></text>
<text><label>"${dir_prefix}" $(gettext ' directory.')</label></text> |
Here all 3 version:
Description |
|
Filesize |
25.15 KB |
Viewed |
1472 Time(s) |

|
|
Back to top
|
|
 |
mavrothal

Joined: 24 Aug 2009 Posts: 3108
|
Posted: Wed 26 Nov 2014, 06:59 Post subject:
|
|
MochiMoppel wrote: | Sorry for getting into nitpicking mode, but I stumbled on something that made me scratch my head for half an hour.
The "Finished. Packages have been downloaded" gtkdialog in downloadpkgs.sh. I don't know if you misplaced the quotes or if this was intentional. : |
Is intentional to show exactly the folder because without quotes if you name your folder "pets folder" then will look like
"The packages have been downloaded to pets folder folder"
BTW version 3 will fail to install when the path has spaces (download is OK).
Version 4 above is OK
_________________ == Here is how to solve your Linux problems fast ==
|
Back to top
|
|
 |
MochiMoppel

Joined: 26 Jan 2011 Posts: 2084 Location: Japan
|
Posted: Wed 26 Nov 2014, 07:27 Post subject:
|
|
mavrothal wrote: | Is intentional to show exactly the folder because without quotes if you name your folder "pets folder" then will look like
"The packages have been downloaded to pets folder folder" | That's OK. What I meant with misplaced is the placement in the code. If you use
Code: | downloaded to "') ${dir_prefix} $(gettext '" | doesn't this mean that the quotes become part of the gettext argument and therefore will require a change of .mo files?
I thought that this would be easier:
Code: | downloaded to ') \"${dir_prefix}\" $(gettext ' |
BTW: No version 4 link You linked the patches twice
.
Last edited by MochiMoppel on Wed 26 Nov 2014, 10:40; edited 1 time in total
|
Back to top
|
|
 |
mavrothal

Joined: 24 Aug 2009 Posts: 3108
|
Posted: Wed 26 Nov 2014, 10:29 Post subject:
|
|
MochiMoppel wrote: |
BTW: No version 4 link You linked the patches twice  |
But version 5 now also gives the option to save installed pets
PS If I know will be that messy...
_________________ == Here is how to solve your Linux problems fast ==
|
Back to top
|
|
 |
bigpup

Joined: 11 Oct 2009 Posts: 13981 Location: S.C. USA
|
Posted: Wed 26 Nov 2014, 13:41 Post subject:
|
|
mavrothal,
Thanks for doing this!
Tried it in Tahrpup 6.0
Selecting a download location works for me.
I am selecting /mnt/home
After restarting PPM as requested in the config window.
However,
It only works if I also have the "Save installed pets too" checked.
If "Save installed pets" is not checked it goes back to /root.
When selecting a package in PPM I am selecting to download only.
Description |
After selecting /mnt/home (selecting save installed pets too) and restart PPM |
Filesize |
22.41 KB |
Viewed |
1368 Time(s) |

|
Description |
After selecting /mnt/home (Not selecting save installed pets too) and restart PPM |
Filesize |
22.08 KB |
Viewed |
1390 Time(s) |

|
_________________ 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
YaPI(any iso installer)
|
Back to top
|
|
 |
mavrothal

Joined: 24 Aug 2009 Posts: 3108
|
Posted: Wed 26 Nov 2014, 14:38 Post subject:
|
|
bigpup wrote: |
However,
It only works if I also have the "Save installed pets too" checked.
|
Yes, I realized that. Is corrected in version 6.
Also previous version could break other apps depended on download_file (ie sfsget). Version 6 should be OK.
_________________ == Here is how to solve your Linux problems fast ==
|
Back to top
|
|
 |
MochiMoppel

Joined: 26 Jan 2011 Posts: 2084 Location: Japan
|
Posted: Thu 27 Nov 2014, 02:07 Post subject:
|
|
mavrothal wrote: | Also previous version could break other apps depended on download_file (ie sfsget). Version 6 should be OK. | I have problems with version 6. It adds dir_prefix for ALL applications, which may not be desirable. It overrides dir_prefix set in .wgetrc, which makes the option for Sfs manager described in my initial post impossible. Logic should be
- if app sets dir_prefix (as now ppm), use it (= use -P switch)
- id app doesn't, let wget check if it's set in .wgetrc, otherwise use $PWD
I propose, that in download_file you revert most of your new changes and add an if statement for wget command. This retains former behaviour for all applications except ppm.:
Quote: | if [ "$DL_F_CALLED_FROM" = "ppm" ];then #see /usr/local/petget/downloadpkgs.sh
# Add option choose savefolder
#~ [ -f /root/.packages/download_path ] && \
#~ dir_prefix="$(grep dir_prefix /root/.packages/download_path | cut -f 2 -d '=')" \
#~ || dir_prefix=/root
PPM_NO_URL_MSG="
$(gettext "NOTE:")
$(gettext "It may be that the local package database needs to be updated. In some cases, the packages in the online package repository change, so you may be trying to download a package that no longer exists. One way to check this is to go to the URL with your web browser:")
${URLDIR}
$(gettext "If the URL is working and the repository has a later package, cancel the current operation. In the Puppy Package Manager main window, click the 'Configure' button, then the 'Update now' button -- this will update the local database. Be warned though, for some large repositories this process may take awhile.")"
#~ else
#~ dir_prefix=$(pwd)
fi
.
.
.
#~ cd "${dir_prefix}"
PWD="`pwd`"
.
.
.
if [ "$dir_prefix" ]; then
wget -4 ${CONTPARAM} -t 5 -w 5 -P "${dir_prefix}" "${URLSPEC}" > /tmp/download_file_spider.log2 2>&1
else
wget -4 ${CONTPARAM} -t 5 -w 5 "${URLSPEC}" > /tmp/download_file_spider.log2 2>&1
fi |
There is no need to define dir_prefix again in download_file as is was already defined in downloadpkgs.sh (download_file is called from downloadpkgs.sh). You only need to export:
Quote: | if [ -f /root/.packages/download_path ]; then
export dir_prefix="$(grep dir_prefix /root/.packages/download_path | cut -f 2 -d '=')"
SAVEFLAG=$(grep true /root/.packages/download_path)
else
export dir_prefix=/root
fi |
Let's hope it works
|
Back to top
|
|
 |
bigpup

Joined: 11 Oct 2009 Posts: 13981 Location: S.C. USA
|
Posted: Thu 27 Nov 2014, 02:17 Post subject:
|
|
Tahrpup 6.0
Version 6 seems to be working OK.
No problems so far using it.
Thanks
Seems version 6 is your sweet spot in developing additional features for Puppy
Edit:
Well, maybe that sweet spot is going to change to version 7 for this one.
_________________ 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
YaPI(any iso installer)
|
Back to top
|
|
 |
|
Page 1 of 6 [85 Posts] |
Goto page: 1, 2, 3, 4, 5, 6 Next |
|
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
|