Page 1 of 4

Petch-0.3.pet -- CLI Puppy repository search and install

Posted: Sat 13 Sep 2008, 14:11
by tombh
I wrote this little script in Perl. When run like so,

Code: Select all

fetch some_package_name
it searches packages from puppylinux.ca, dotpups.de and ibiblio. It then generates a list of matches and asks you which one you want to download, then it asks you whether you want to install it.

There was talk some time ago about creating a more formalised and rigorous package management system. This is not really an attempt to go down that path, it's just a quick script that makes use of all the existing search code and precedents that MU (PSI), prit and I have developed over time at dotpups.de, puppylinux.ca and puppylinux.org. But hopefully this is a taster of what a complete package management tool might be like.

At the moment it just searches for pets, unlike the proper web-based searches at puppylinux.org and puppylinux.ca (which are BTW pretty much exactly the same now).

Also, if you didn't know, there is a now a feed of the latest packages that arrive at pupplinux.ca. Eric, the admin there, also mirrors some other servers, so the feed is a good general indicator of new packages.

All feedback is kindly welcomed.

Change log:
0.2:
* Changed name from Fetch to Petch
* Sent colour codes manually rather than using the Term::ANSI module as the module is not available in all Puppies.
0.3:
* Removed Switch module dependency. Petch now exclusively makes use of internal Perl functions. So hopefully it will work on *all* versions of Puppy now.

Posted: Sat 13 Sep 2008, 16:33
by trapster
Very nice, very simple.
I typed in fetch conky and away it went.
It found two choices.
Cool!!
Because I save files outside of my pup_save, possible to have choice on where to save?

Maybe the title of this post should be CLI .pet installer (?).

Now...."unfetch" (or fetch -u some.pet)would be nice to uninstall???????

Also, FYI

Code: Select all

Fetch
A Macintosh program by Jim Matthews for transferring files using File Transfer Protocol (FTP). Fetch requires a Mac 512KE, System 4.1, and either KSP 1.03 or MacTCP.
Current version: 2.1.2.
Fetch is Copyright 1992, Trustees of Dartmouth College.
(ftp://ftp.Dartmouth.edu/pub/mac/Fetch_2.1.2.sit.hqx). (ftp://src.doc.ic.ac.uk/computing/systems/mac/info-mac/comm/tcp).
(1994-11-30)
The Free On-line Dictionary of Computing, © 1993-2007 Denis Howe 

Posted: Sat 13 Sep 2008, 16:55
by Caneri
Ok...I'll bite. What perl.pet/module do I need in Dingo and which one for v3.01.

This will be helpful for us less than guru guys/gals..lol

Best,
Eric

Posted: Sat 13 Sep 2008, 17:17
by tombh
@trapster: Great, glad you like and glad it works :) It downloads the pet to where ever you run the script from so you can control the destination like that. Well I guess 'unfetching' is already handled by petget isn't it, though not through the command line I suspect. Does the existing Mac Fetch app mean I can't use the name? Hey! I'll call it Petch! Sounds weird but not only does it begin with a "P", like all Puppy apps should, but it has the word "pet" in it too!

@Caneri: Oh, does it not work "out of the box" for you? I thought Perl already comes with Puppy.

Posted: Sat 13 Sep 2008, 20:46
by Caneri
Hi Tom,

After looking deeper perl is here on Dingo Alpha 5

I attached the error I get for you to see.

Best,
Eric

Posted: Mon 15 Sep 2008, 08:07
by tombh
Hey thanks Eric :) Fixed now -- let me know if it works now...

Posted: Mon 15 Sep 2008, 11:04
by HairyWill
nice one tomh

Posted: Mon 15 Sep 2008, 12:16
by Caneri
Hi Tom,

Sorry to be a pain but now petch fails for me at line 11

It can't locate Switch.pm in @INC

Is it just dingo alpha5, as I'll move up soon to final or the beta.

Best,
Eric

Posted: Mon 15 Sep 2008, 12:23
by tombh
Doh! Right, basically I can't use any external Perl modules then! Not to worry, the modules are just a way of making coding shorter, easier and less time-consuming, so I'll just have to code my own "Switch" routine, or provide the pet with the switch module, which is probably bad practice.

Hey ho, I'll get the new version up soon then...

Thanks Eric :)

Posted: Tue 16 Sep 2008, 10:21
by tombh
Petch updated to version 0.3

Posted: Tue 16 Sep 2008, 11:43
by Caneri
Hooray!!
Petch provides pets perfectly....woof woof

Eric

Petch-0.2.pet

Posted: Tue 16 Sep 2008, 13:23
by ndujoe1
Another example of the ingenuity of Puppy user to fashion and extend the useful nature of Puppy Linux. Nice work

Posted: Tue 16 Sep 2008, 13:24
by Caneri
Hi Tom,

Well after looking at Petch for a bit this morning I think this is one of those little programs that should be in all releases from now on.

This is very handy..Well Done!!

Best,
Eric

Posted: Tue 16 Sep 2008, 13:39
by tombh
I'd love it if Barry put it in 4.1 -- I've never had anything in Puppy before!

If Barry's tempted, I'm happy to declare Petch non-beta and well it's only 1.7k!

Posted: Tue 16 Sep 2008, 14:06
by Caneri
There's one thing that needs to be fixed. Petch can't find Petch...lol..or is this the chicken and egg thing ;-)

Best,
Eric

Posted: Tue 16 Sep 2008, 16:28
by Caneri
Hi Tom,

I wonder if adding puppyfiles.ca to the search in Petch would be helpful as well.

MU mirrors his dotpups.de there and if he is down then puppyfiles.ca is available. There are instructions on how to use puppyfiles.ca on the front page there from MU.

I'm not sure if there is a package list for puppyflies.ca though, but there must be as PSI can use it...Maybe Mark can answer that one.

Best,
Eric

Posted: Tue 16 Sep 2008, 17:37
by MU
these folders have dotpups.txt, also in small .bz2 format:
http://puppyfiles.ca/dotpupsde/dotpups/
http://puppyfiles.ca/dotpupsde/puppy3/dotpups/

I just see, this one has none yet, I will add it this week:
http://puppyfiles.ca/dotpupsde/puppy4/dotpups/

Mark

Posted: Thu 18 Sep 2008, 11:45
by tombh
@ndujoe1: Didn't see yer post there before, thanks!

@Eric: Where should Petch live on .ca then? Puppyfiles.ca is already included, that's what I really mean when I say dotpups.de as I assumed that the former is a mirror of the latter.

@MU: Thanks, I already had http://puppyfiles.ca/dotpupsde/dotpups/ but not
http://puppyfiles.ca/dotpupsde/puppy3/dotpups/ so I added it.

Posted: Thu 18 Sep 2008, 16:27
by Pizzasgood
Cool. This would be even better if we set up that attachment list, because then it could grab stuff from the forum too. What would be ideal in that respect is just a single .php page that ran an sql query for all .pet, .pup, etc. files (so we don't get things like conky.jpg screenshots).

I happen to have a (disabled) phpBB forum on my site, so I'll see about throwing something like that together this weekend. If I can get something more or less working on my end I can email it to John and see if he'll upload it to the server.

Posted: Thu 18 Sep 2008, 17:00
by cb88
thanks tombh this is a great development