PPM: How to download packages into any directory

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#21 Post by mavrothal »

bigpup wrote: MochiMoppel,
You could help if you edited the first post to show that a pet is available to add this feature to PPM.
This actually may not be a bad idea :wink:
Also "force" in the title sounds scary :D :P
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#22 Post by bigpup »

Tahrpup 6.0

Installed the version 7 pet.

PPM seems to be working OK.

The download directory seems to be staying selected.

For me, seems all the bugs are fixed as to how PPM is working.

Thanks!
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 :shock:
YaPI(any iso installer)

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#23 Post by mavrothal »

bigpup wrote:PPM seems to be working OK.
It works OK with me too but this is only tested on a frugal install on a linux partition I guess.
What about a USB install or on a VFAT partition or saving into whole partition (pupmode 6 and 7) or full install or a multisession DVD or ...?
PPM behaves differently depending on the install method so if anyone tests the ppm_down_dir-7.pet in any of these modes, please report.

Another concern might be when install fails in the middle because say a broken connection, a power failure or something else, how is PPM recovering (looks OK in pupmode 12 and halved downloads here but not tested in other scenarios).

In short some "real life" testing would be nice. :wink:
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
Griot
Posts: 131
Joined: Fri 12 Sep 2014, 18:10
Location: Serbia

#24 Post by Griot »

Here's a noob report. Precise 5.72 PAE, frugal on ext3/HDD.
V.7 doesn't work for me. Cannot configure PPM. It just blinks after I click on configure button. Before v.7 install I followed THIS GUIDE to enable 'Download only' button.
With the little help from our devs :roll: ,
I'm looking forward to using this useful feature.
Thanx Puppians!

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#25 Post by mavrothal »

Griot wrote:Here's a noob report. Precise 5.72 PAE, frugal on ext3/HDD.
V.7 doesn't work for me. Cannot configure PPM. It just blinks after I click on configure button. Before v.7 install I followed THIS GUIDE to enable 'Download only' button.
Which "Precise 5.72 PAE" is that?
I used this 5.7.2 and works just file with the only exception that instead of a folder button it has an OK button. (see pic)
To correct this change line 185 of /usr/local/petget/configure.sh as shown

Code: Select all

--- a/configure.sh	2014-11-27 11:27:55.000000000 +0200
+++ b/configure.sh	2014-11-29 15:41:56.000000000 +0200
@@ -182,7 +182,7 @@
           <text width-request="100"><label>$(gettext 'New directory')</label></text>
           <entry accept="folder" width-request="200"><variable>SAVEPATH</variable></entry>
           <button>
-           "`/usr/lib/gtkdialog/xml_button-icon open`"
+           <input file stock="gtk-open"></input>
            <action type="fileselect">SAVEPATH</action>
           </button>
          </hbox>
The download only modification does not affect its behavior. I actually made it in my precise version and works just fine (pic).

You may have additional changes in your system?...
Try starting ppm from the terminal (type "ppm" ) and see if it spits any errors when you press the configure button.
Attachments
Presice_ppm.png
Precise 5.7.2 with the ppm_down_dir-7.pet installed
(38.08 KiB) Downloaded 250 times
Presice_download_only.png
Precise: &quot;Download only&quot; to a user defined folder
(13.62 KiB) Downloaded 259 times
Last edited by mavrothal on Sat 29 Nov 2014, 13:48, edited 1 time in total.
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
Griot
Posts: 131
Joined: Fri 12 Sep 2014, 18:10
Location: Serbia

#26 Post by Griot »

Yep, same 5.72. here. Yes, there's an error:

Code: Select all

** (gtkdialog:29350): ERROR **: gtkdialog: Error in line 73, near token '</default>': syntax error
AFAIK no system changes lately. :?:
Thanx for helping, again. ;)

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#27 Post by mavrothal »

Griot wrote:Yep, same 5.72. here. Yes, there's an error:

Code: Select all

** (gtkdialog:29350): ERROR **: gtkdialog: Error in line 73, near token '</default>': syntax error
AFAIK no system changes lately. :?:
Thanx for helping, again. ;)
Sorry I can not reproduce this error.
Some other change should be there. See if this also happens if you boot with pfix=ram and then install the original ppm_down_dir-7.pet
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
Griot
Posts: 131
Joined: Fri 12 Sep 2014, 18:10
Location: Serbia

#28 Post by Griot »

Ok, my mistake. Compared to your code, my looks exactly the same
with exception of this path in said line: /usr/lib/gtkdialog/
There's no 'gtkdialog' dir. It's /usr/lib/gtk-2.0/ with 2 sub-dirs '2.10.0' and 'modules'.
No error in pfix=ram mode after installing v.7.pet. :shock:

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#29 Post by mavrothal »

In spite previous statements :roll: there is a version 8 of the ppm_down_dir pet.
The major addition is that it now checks if the specified download folder exists and if not defaults to /root.
This is in case where the path is mistyped or the folder deleted at a latter point.

It also looks (and works) properly in older pups that do not have the svg gtkdialog icons
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

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

#30 Post by greengeek »

I don't seem to be having any success with this at all. I have just installed the v8 pet and I do not get prompted for download location. My puppy is based on Slacko 5.6 but has some weird modifications (so could be my fault...). I also have MochiMoppels previous "download only" mod installed (via remaster so I can't easily uninstall it for testing).

Anime gif via SFRs T.A.S:

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#31 Post by mavrothal »

greengeek wrote:I don't seem to be having any success with this at all. I have just installed the v8 pet and I do not get prompted for download location. My puppy is based on Slacko 5.6 but has some weird modifications (so could be my fault...). I also have MochiMoppels previous "download only" mod installed (via remaster so I can't easily uninstall it for testing).

Anime gif via SFRs T.A.S:
I can not tell from the animation but did you go to PPM>> configure >> miscellaneous to setup your download folder/ keep-pet option?
Th option id not going to come up automatically every time you install/download something. You have to set it up.
If you did what

Code: Select all

cat /root/.packages/download_path
says?
Any errors when you start ppm from terminal?
Last edited by mavrothal on Sat 29 Nov 2014, 22:48, edited 1 time in total.
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#32 Post by Puppus Dogfellow »

haven't tried version 8, but 7 works in precise 5.7.1/.2 and 5.5. even adds something that prevents the (re)installation of previously installed pets.

nice.

User avatar
rg66
Posts: 1158
Joined: Mon 23 Jul 2012, 05:53
Location: Vancouver, BC Canada / Entebbe, Uganda Africa!?!

#33 Post by rg66 »

If you click ok when the entry box is empty it gives the "The '$SAVEPATH' download folder you specified does not exist" error. There was also a few typos in the error message. This seems to fix it:

Code: Select all

--- /root/Downloads/ppm_down_dir-8/usr/local/petget/configure.sh	2014-11-29 18:31:31.000000000 +0300
+++ /usr/local/petget/configure.sh	2014-11-30 20:16:48.849875463 +0300
@@ -228,9 +228,10 @@
 
 # handle savepath
 SAVEPATH="`echo -n "$RETPARAMS" | grep 'SAVEPATH' | cut -f 2 -d '"'`"
+[ "$SAVEPATH" = "" ] && SAVEPATH=$dir_prefix
 [ -d "$SAVEPATH" ] && echo dir_prefix=\'$SAVEPATH\' > /root/.packages/download_path \
- || xmessage  -bg red -center "`gettext \"The '$SAVEPATH' download folder you specified does not exist. 
-Pleae creat it and try again \"`"
+ || xmessage  -bg red -center "`gettext \"The '$SAVEPATH' download folder you specified does not exist
+or the partition it's on is not mounted. Please try again \"`"
 # option to save installed pets
 SAVE_PETS="`echo -n "$RETPARAMS" | grep '^varSAVE_PETS' | grep -oE 'true|false'`"
 sed -i -e "2d" /root/.packages/download_path
Last edited by rg66 on Mon 01 Dec 2014, 07:28, edited 1 time in total.
X-slacko-5b1 - X-tahr-2.0 - X-precise-2.4
[url=http://smokey01.com/rg66/]X-series repo[/url]

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#34 Post by mavrothal »

rg66 wrote:If you click ok when the entry box is empty it gives the "The '$SAVEPATH' download folder you specified does not exist" error. There was also a few typos in the error message. This seems to fix it:
Good catch.
Will be fixed in v9 though I'll give it a day before I upload, in case something else come up.

Regarding typos is the major reason I was avoiding the terminal for many years :oops:
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

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

#35 Post by greengeek »

mavrothal wrote: did you go to PPM>> configure >> miscellaneous to setup your download folder/ keep-pet option?
Thanks for the tip - no I had not done that
If you did what

Code: Select all

cat /root/.packages/download_path
says?
Now that I have set it up to use /opt it says:

Code: Select all

# cat /root/.packages/download_path
dir_prefix='/opt'
save_pets='true'# 
However, I still have a problem. The package seems to download successfully, but it still appears in /root (not /opt as i asked) and gives two messages. One message says

Code: Select all

error, failed to download xpr-1.0.4-1486-1.txz
and after I click on that error another dialog comes up saying

Code: Select all

Finished. The packages have been downloaded to "/opt" directory
You can see here the package appears in /root (does not appear in /opt)

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#36 Post by mavrothal »

greengeek wrote: However, I still have a problem. The package seems to download successfully, but it still appears in /root (not /opt as i asked) and gives two messages. One message says

Code: Select all

error, failed to download xpr-1.0.4-1486-1.txz
and after I click on that error another dialog comes up saying

Code: Select all

Finished. The packages have been downloaded to "/opt" directory
:oops:
Another typo... :oops:
Is missing a dot at line 50 of /usr/local/petget/configure.sh.
should be

Code: Select all

 . /root/.packages/download_path
Version 9 should fix this as well as the one above reported by rg66.
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

Leon
Posts: 265
Joined: Wed 22 Jun 2005, 21:33

#37 Post by Leon »

mavrothal wrote:Version 9 should fix this as well as the one above reported by rg66.
Very useful feature.

It works well in Dpup Wheezy 3528.

Thank you.

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#38 Post by bigpup »

Test of Puppy full install operation..

Tahrpup 6.0
Full install to HD partition

Installed version 9

PPM seems to be working OK.

Tried download-only and save installed pets too options.
All downloaded to the directory I had set for downloads.
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 :shock:
YaPI(any iso installer)

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#39 Post by bigpup »

MochiMoppel,

You still here :?:
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 :shock:
YaPI(any iso installer)

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

#40 Post by MochiMoppel »

Updated initial post.
Added a second solution. It keeps PPM fully functional yet allows a different download directory.
mavrothal wrote:PPM is such a convoluted mess
I couldn't agree more. I see a lot of duplicated and redundant code, which makes maintenance so much "fun". Let's make sure that it doesn't become more convoluted. The main problem I see is that there is no one who feels responsible to clean up this stuff. There isn't even a home for it in the forum. I'm not aware of a main PPM thread in the software forum. This would be the place to publish pets, discuss new features, argue about code details. I welcome and appreciate your efforts to push PPM development forward, but I think it deserves a more prominent place than an odd MochiMoppel HOWTO thread.

Back to topic: I took a deep breath, looked at the PPM code again and think that I found the problem of the current PPM. There are two hard coded references to /root which even now make no sense and should be removed and there is one in the "Finished downloads" dialog that should be replaced with $PWD. That's basically all to make PPM accept any download path.

If this is really true - and all my tests so far indicate that it is - then our new pet can be greatly simplified.
The key is the correct setting of the working directory (PWD): Has to be done only once with a "cd <path>" statement. Once this is done (and it should really be done only once), everything else falls in place and works, because that's the way PPM was designed. I know, I scoffed at it a bit, but I see the benefits:
- No need to add the path to the package's file name, i.e. no need to add ${dir_prefix}. On the contrary: Paths must not be added
- Without paths, no need to worry about spaces in their names
- No need either to change /usr/sbin/download_file
- Automatic fall back to /root in case of trouble

Let's concentrate on the fun stuff: building a nice GUI :wink:

Post Reply