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

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
tombh
Posts: 422
Joined: Fri 12 Jan 2007, 12:27
Location: Bristol, UK
Contact:

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

#1 Post 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.
Attachments
petch-0.3.pet
(1.77 KiB) Downloaded 2043 times
Last edited by tombh on Tue 16 Sep 2008, 13:40, edited 6 times in total.
[url=http://www.tombh.co.uk/colour_memories/contribute.php]Colour-Memories Database[/url]

User avatar
trapster
Posts: 2117
Joined: Mon 28 Nov 2005, 23:14
Location: Maine, USA
Contact:

#2 Post 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 
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog

Caneri
Posts: 1513
Joined: Tue 04 Sep 2007, 13:23
Location: Canada

#3 Post 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
[color=darkred][i]Be not afraid to grow slowly, only be afraid of standing still.[/i]
Chinese Proverb[/color]

User avatar
tombh
Posts: 422
Joined: Fri 12 Jan 2007, 12:27
Location: Bristol, UK
Contact:

#4 Post 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.
[url=http://www.tombh.co.uk/colour_memories/contribute.php]Colour-Memories Database[/url]

Caneri
Posts: 1513
Joined: Tue 04 Sep 2007, 13:23
Location: Canada

#5 Post 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
Attachments
fetch.tar.gz
(5.86 KiB) Downloaded 1065 times
[color=darkred][i]Be not afraid to grow slowly, only be afraid of standing still.[/i]
Chinese Proverb[/color]

User avatar
tombh
Posts: 422
Joined: Fri 12 Jan 2007, 12:27
Location: Bristol, UK
Contact:

#6 Post by tombh »

Hey thanks Eric :) Fixed now -- let me know if it works now...
[url=http://www.tombh.co.uk/colour_memories/contribute.php]Colour-Memories Database[/url]

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#7 Post by HairyWill »

nice one tomh
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

Caneri
Posts: 1513
Joined: Tue 04 Sep 2007, 13:23
Location: Canada

#8 Post 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
[color=darkred][i]Be not afraid to grow slowly, only be afraid of standing still.[/i]
Chinese Proverb[/color]

User avatar
tombh
Posts: 422
Joined: Fri 12 Jan 2007, 12:27
Location: Bristol, UK
Contact:

#9 Post 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 :)
[url=http://www.tombh.co.uk/colour_memories/contribute.php]Colour-Memories Database[/url]

User avatar
tombh
Posts: 422
Joined: Fri 12 Jan 2007, 12:27
Location: Bristol, UK
Contact:

#10 Post by tombh »

Petch updated to version 0.3
[url=http://www.tombh.co.uk/colour_memories/contribute.php]Colour-Memories Database[/url]

Caneri
Posts: 1513
Joined: Tue 04 Sep 2007, 13:23
Location: Canada

#11 Post by Caneri »

Hooray!!
Petch provides pets perfectly....woof woof

Eric
Attachments
Petch-0.3.jpg
(44.77 KiB) Downloaded 4532 times
[color=darkred][i]Be not afraid to grow slowly, only be afraid of standing still.[/i]
Chinese Proverb[/color]

ndujoe1
Posts: 851
Joined: Mon 05 Dec 2005, 01:06

Petch-0.2.pet

#12 Post by ndujoe1 »

Another example of the ingenuity of Puppy user to fashion and extend the useful nature of Puppy Linux. Nice work

Caneri
Posts: 1513
Joined: Tue 04 Sep 2007, 13:23
Location: Canada

#13 Post 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
[color=darkred][i]Be not afraid to grow slowly, only be afraid of standing still.[/i]
Chinese Proverb[/color]

User avatar
tombh
Posts: 422
Joined: Fri 12 Jan 2007, 12:27
Location: Bristol, UK
Contact:

#14 Post 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!
[url=http://www.tombh.co.uk/colour_memories/contribute.php]Colour-Memories Database[/url]

Caneri
Posts: 1513
Joined: Tue 04 Sep 2007, 13:23
Location: Canada

#15 Post 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
Attachments
Petch-petch.jpg
(7.33 KiB) Downloaded 4637 times
[color=darkred][i]Be not afraid to grow slowly, only be afraid of standing still.[/i]
Chinese Proverb[/color]

Caneri
Posts: 1513
Joined: Tue 04 Sep 2007, 13:23
Location: Canada

#16 Post 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
[color=darkred][i]Be not afraid to grow slowly, only be afraid of standing still.[/i]
Chinese Proverb[/color]

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#17 Post 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
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
tombh
Posts: 422
Joined: Fri 12 Jan 2007, 12:27
Location: Bristol, UK
Contact:

#18 Post 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.
[url=http://www.tombh.co.uk/colour_memories/contribute.php]Colour-Memories Database[/url]

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#19 Post 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.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
cb88
Posts: 1165
Joined: Mon 29 Jan 2007, 03:12
Location: USA
Contact:

#20 Post by cb88 »

thanks tombh this is a great development
Taking Puppy Linux to the limit of perfection. meanwhile try "puppy pfix=duct_tape" kernel parem eater.
X86: Sager NP6110 3630QM 16GB ram, Tyan Thunder 2 2x 300Mhz
Sun: SS2 , LX , SS5 , SS10 , SS20 ,Ultra 1, Ultra 10 , T2000
Mac: Platinum Plus, SE/30

Post Reply