PPM: Download packages, but don't install

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

PPM: Download packages, but don't install

#1 Post by MochiMoppel »

In recent puppies the Puppy Package Manager (PPM) does not allow to download packages without installing them. If you are lucky the Puppy Package Manager: preinstall dialog contains an Examine dependencies button, which, when clicked, provides an option to download the package, but for packages without missing dependencies this button will not be shown, instead it’s either Install or Cancel. After clicking on Install and choosing a server the PPM will download, install and delete (!) the selected package.

Below patch adds the missing Download-only button.At least it does it for me in Slacko5.6. Should also work in Precise:

1) Open file /usr/local/petget/installpreview.sh with a text editor and find keyword ${DEPBUTTON} (just to make sure that you are editing the right section of code.):

${DEPBUTTON}
<button>
<label>Install ${TREE1}${ONLYMSG}</label>
<action>echo \"${TREE1}\" > /tmp/petget_installpreview_pkgname</action>
<action type=\"exit\">BUTTON_INSTALL</action>
</button>
<button cancel></button>


2) Add 4 lines to the code:

${DEPBUTTON}
<button>
<label>Install ${TREE1}${ONLYMSG}</label>
<action>echo \"${TREE1}\" > /tmp/petget_installpreview_pkgname</action>
<action type=\"exit\">BUTTON_INSTALL</action>
</button>
<button>
<label>Download-only</label>
<action type=\"exit\">BUTTON_PKGS_DOWNLOADONLY</action>
</button>

<button cancel></button>


3) A few lines later find

if [ "$EXIT" != "BUTTON_INSTALL" -a "$EXIT" != "BUTTON_EXAMINE_DEPS" ];then

4) Change the code (everything on one line!) to

if [ "$EXIT" != "BUTTON_INSTALL" -a "$EXIT" != "BUTTON_EXAMINE_DEPS" -a "$EXIT" != "BUTTON_PKGS_DOWNLOADONLY" ];then

That's it. Packages will be downloaded to /root, a message window will appear after the download. The behavior of the Install option will not be affected (packages will be deleted after installation)

Image

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

#2 Post by mavrothal »

Thanks.
Is now in woof for the puppies to come :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
Moat
Posts: 955
Joined: Tue 16 Jul 2013, 06:04
Location: Mid-mitten

#3 Post by Moat »

Works perfectly in Precise 5.7.1 retro. Brilliant little tweak, Mochi - thanks!! 8)

Bob
Attachments
image-1.jpg
MochiMoppel's script tweak applied - results
(64.11 KiB) Downloaded 1985 times

sheldonisaac
Posts: 902
Joined: Mon 22 Jun 2009, 01:36
Location: Philadelphia, PA

Re: PPM: Download packages, but don't install

#4 Post by sheldonisaac »

MochiMoppel, may I ask for some help, please?
In my Lucid Puppy 5.2.8.6 (by rerwin), I did find the first place, and edited according to your instructions:
<hbox>
${DEPBUTTON}
<button>
<label>Install ${TREE1}${ONLYMSG}</label>
<action>echo \"${TREE1}\" > /tmp/petget_installpreview_pkgname</action>
<action type=\"exit\">BUTTON_INSTALL</action>
</button>

<button>
<label>Download-only</label>
<action type=\"exit\">BUTTON_PKGS_DOWNLOADONLY</action>
</button>

<button cancel></button>
</hbox>
</vbox>
</window>
"
However, couldn't find the exact
A few lines later find

if [ "$EXIT" != "BUTTON_INSTALL" -a "$EXIT" != "BUTTON_EXAMINE_DEPS" ];then
There is

Code: Select all

RETPARAMS="`gtkdialog3 --center --program=PREVIEW_DIALOG`"

eval "$RETPARAMS"
[ "$EXIT" != "BUTTON_INSTALL" -a "$EXIT" != "BUTTON_EXAMINE_DEPS" ] && exit

#DB_ENTRY has the database entry of the main package that we want to install.
#DB_FILE has the name of the database file that has the main entry, ex: Packages-slackware-12.2-slacky

if [ "$EXIT" = "BUTTON_EXAMINE_DEPS" ];then
 /usr/local/petget/dependencies.sh
 [ $? -ne 0 ] && exec /usr/local/petget/installpreview.sh #reenter.
 #returns with /tmp/petget_missing_dbentries-* has the database entries of missing deps.
 #the '*' on the end is the repo-file name, ex: Packages-slackware-12.2-slacky
 

Shall I (somehow?) paste or attach the entire file?

Or is it OK now?

Thank you,
Sheldon
Dell E6410: BusterPup, BionicPup64, Xenial, etc
Intel DQ35JOE, Dell Vostro 430
Dell Inspiron, Acer Aspire One, EeePC 1018P

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

#5 Post by MochiMoppel »

Lucid uses a slightly different syntax. This should work (haven't tested though):
eval "$RETPARAMS"
[ "$EXIT" != "BUTTON_INSTALL" -a "$EXIT" != "BUTTON_EXAMINE_DEPS"
-a "$EXIT" != "BUTTON_PKGS_DOWNLOADONLY" ] && exit

User avatar
neerajkolte
Posts: 516
Joined: Mon 10 Feb 2014, 07:05
Location: Pune, India.

#6 Post by neerajkolte »

Just bookmarking for future reference.
Thanks.
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson

“We tend to overestimate the effect of a technology in the short run and underestimate the effect in the long run.â€￾
- Amara’s Law.

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

#7 Post by greengeek »

If you end up with a download of a whole bunch of debs and want to assemble them into a single package ready for install or sfs build there is a good suggestion here:
http://ns1.murga-projects.com/puppy/vie ... ef1#760502
.

B.K. Johnson
Posts: 807
Joined: Mon 12 Oct 2009, 17:11

PPM: Download packages, but don't install

#8 Post by B.K. Johnson »

Retracted

B.K. Johnson

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

#9 Post by bigpup »

Any chance this could be modified to also ask where to download?
Give you the ability to choose the download only location?
At present it downloads to /root
Would be a good feature if you could choose the location.
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

#10 Post by MochiMoppel »

bigpup wrote:Any chance this could be modified to also ask where to download?
Does someone need this? Could well be a solution without a problem :lol:
So far I've seen only one fellow asking for it, but even he lost interest. At least in theory it could be a solution for users who run out of personal storage space. Downloading to /root, even temporarily, can freeze the system :twisted:

User avatar
drongo
Posts: 374
Joined: Sat 10 Dec 2005, 23:35
Location: UK

I'm not ungrateful honestly! Maybe forgetful

#11 Post by drongo »

I was the original poster on this topic.

I'm very grateful to MochiMoppel for producing this. I was going to thank you after testing it out on my system, but I took a couple of weeks to do so and forgot to say that it worked.

I occasionally use Puppies on machines in a lab which are not connected to the outside world and being able to add things like etherape is extremely useful to me.

Even after ten (?) years using Puppy I am still rather stunned that a simple request for a workaround can result in core functionality being added to the build system in a matter of hours or days.

Thanks to mavrothal as well.

The behaviour of the community of developers here is incredible.

Thanks again.

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

#12 Post by bigpup »

MochiMoppel wrote:
bigpup wrote:Any chance this could be modified to also ask where to download?
Does someone need this? Could well be a solution without a problem :lol:
So far I've seen only one fellow asking for it, but even he lost interest. At least in theory it could be a solution for users who run out of personal storage space. Downloading to /root, even temporarily, can freeze the system :twisted:
Ok, now you have two people asking for this :shock: :lol:

I always make a download directory to put stuff I download.
Would be nice if I could choose that directory.

Do you like a internet browser to just download or do you like to choose the download location?
I like to choose the location.
PPM should also offer that option.

Something like this would be a really nice feature. :D 8)
Attachments
capture13965.png
(8.21 KiB) Downloaded 1068 times
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
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#13 Post by greengeek »

I also would be keen to have the ability to specify the download location.
Mochi - have you seen this other thread here?
(Boof asks about controlling download location (as well as PPM source)

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

#14 Post by bigpup »

MochiMoppel,

That is 3 people. :shock: :lol:

You would probably like to have this option too. :wink:

Come on, You know you would :lol:
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

#15 Post by MochiMoppel »

greengeek wrote:Mochi - have you seen this other thread here?
Yes, but I got the impression that he is looking for something else. Downloading packages - not neccessarily from PPM - into a "local repository" or something. Couldn't make much sense of it.
bigpup wrote:You would probably like to have this option too.
I have it already - but I don't like it :lol: . I developed a solution together with the download-only button, but eventually decided to publish only the button hack. While the button was easy ( PPM has already download-only procedures in place, only the button was missing), the download location is hard coded in various places (PPM involves at least 5 files) and makes a fix ugly. PPM code is already ugly enough, so I didn't want to contribute to the mess :wink:

As a small consolation for the impressive crowd of 3 potential customers I can offer a completely different solution, which is stunningly simple and doesn't require to edit any of the PPM files. I think I'll make it a separate thread as it is not restricted to PPM.
Still need to do some testing ... Puppy 4.2 anyone? :lol:

Here it is. Have fun!

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

#16 Post by mavrothal »

greengeek wrote:I also would be keen to have the ability to specify the download location.
Here is a pet that adds this functionality to PPM.
== [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] ==

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#17 Post by slavvo67 »

The manual changes work like a charm in Barry's Quirky Unicorn.

Thanks Mochi,

Slavvo67

Post Reply