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

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#31 Post by Pizzasgood »

Maybe one thing to consider could be saving the output as a stand alone file
Yes, I was thinking about doing that too. I probably would have already, but I had planed to do the bulk of the work on Sunday afternoon. After fiddling with my network settings around noon I had to wait a while before being able to access the campus network, so I thought I'd play a quick game of Nethack. Wound up being anything but quick. Five hours or so later I finally died, after accumulating a score six times higher than my previous high score. What ultimately led to my demise was accidentally reading a scroll of Destroy Armor, which ruined my +4 robe, thus slashing my defenses and killing my ability to use magic. :( Then the day was nearly over.

I'll clean stuff up and set it to output a file tonight, add some formatting to the fancy view, and add a third mode to output the data from the fancy view in a more usable form in case we ever want to set up something like that attachment->repo thing we talked about earlier. Then I'll upload it all to my website so you can play with it and make sure it works.
[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
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#32 Post by Pizzasgood »

Test forum with info typed when I wasn't half sleeping over here:
http://www.browserloadofcoolness.com/pu ... ic.php?t=3

Needs testing and examination before I email it to John.

Notice that the ?view parameter has been renamed ?mode.

This version is also CLI compatible. It can take the mode as a normal parameter, so that it can be used with Cron properly.

Added an option to output to a file. Disabled by default when viewed through the web, but enabled (and always enabled) when run from CLI.

Go ahead and upload as much as you want over there to test it. I'm gonna delete it all when we get done so spam away.

Let me know if there's anything you think needs tweaking. Preferably over here.

Now I go to enjoy sleep time. 'night.
[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
tombh
Posts: 422
Joined: Fri 12 Jan 2007, 12:27
Location: Bristol, UK
Contact:

#33 Post by tombh »

@lluamco:
When you see this
[ 1] - puppylinux.ca | puppyfiles | cups-1.1.23-1.pet (1606782)
this file is exactly the same on dotpups.de.
That's true. And yes, MU is still in the process of making package lists for all his directories.

@pizzasgood: Well, it all looks fantastic. I uploaded a new attachment (petch-0.3.pet as it happens), copied the package list over to puppylinux.org and now

Code: Select all

petch petch
returns
# petch petch
searching ...

SOURCE | DIRECTORY | FILENAME (size)
[ 1] - browserloadofcoolness.com | | petch_03.pet (1811)
[ 2] - puppylinux.ca | tpp | petch-0.3.pet (1811)
Please type the number of the package you would like to fetch:
Obviously I'll tidy up the formatting -- browserloadofcoolness,com breaks the nice neat columns! Also maybe you could put something useful in that second path entry bit, maybe the thread title or the contributors forum name? That info would fit into the DIRECTORY field.

So what about the HTML fancy view? I imagine the list is going to be gigantomungous (ie long) on the murga forum. Perhaps too long to show on a single page -- i,e. endless page-loading? Maybe the HTML view should require an extra search query argument to filter things down a bit? I guess the XML view is fine as it's not for human eyes.

I wouldn't be surprised though that some unforeseen shenanigans arise once plugged in here at the murga forum, maybe keep it low key for a couple of days testing?

On an aside, one day there will only be petget right? It'll contain petch's code and other goodies that have accumulated over the years in the forum. And we'll take repository organisation and searching into account when re-coding dir2pet, therefore asking who put the pet together, what version of Puppy is it for, and so on. Basically I mean, one day, we're all gonna get together and come up with a complete package management solution, aren't we? Yes :)
[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

#34 Post by Pizzasgood »

Doh, I should have though about that. Yes, there are several thousand packages on this forum. That would be a long nasty list. In that case, I think I had better just split this thing in two. Have one to create the basic view and XML, and a separate one to do the fancy. Then it can have pagination and searching without worrying about affecting the stability and complexity of the other two modes, which should almost never need modification.

I'll split it out on Tuesday probably, then email the basic/xml version to John and see if he'll add it. I'll probably advise him to set it up so people can't trigger an update over the web to avoid the potential for attacks. I'll work on the fancy view when I get time. I have a largish project for my "Computer Arch and OS" class that I need to start working on this week.

(I'm visiting my grandma and grandpa this weekend, so no working this weekend other than my combinatorics homework, which I finished earlier today).



I'll also change that second field to the user name before I split them.




Yes, I think long-term it would be good to set up a more descriptive repository system and have petch-like functionality built into PetGet.
[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
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#35 Post by Béèm »

Just discovered this handy little program.
I tried to trick it by issuing.

Code: Select all

petch *
but I got nicely

Code: Select all

[95] - puppylinux.ca | puppyfiles     | gxmessage-2.6.2.pet (15660)
[96] - puppylinux.ca | puppyfiles     | hardinfo-0.4.2.2.pet (256334)
[97] - puppylinux.ca | puppyfiles     | hexedit-1.2.10.pet (62522)
[98] - puppylinux.ca | puppyfiles     | hv3-20070702.pet (579579)
[99] - puppylinux.ca | puppyfiles     | ical-2.3.1patched.pet (161002)
100 results reached, no more results will be shown.
Please type the number of the package you would like to fetch: ^C
# 
Somebody made the remark that it would be nice to be able to indicate a save to directory, but there is no need for this.
Just open rxvt and go to the folder where you want the package to be downloaded and retrieve it.

Also a remark was made that an uninstall should be nice, but there is no need for it either as petch calls the regular puppy package manager and you can uninstall with it.

Just one thing, when a package is retrieved again, there is no checking if exists already. It's simply overwritten.
Not a disaster for small packages but a waist of time and bandwidth for large downloads. Specially when one is on a dial-up connection.
So here is room for improvement.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

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

#36 Post by tombh »

Thanks Béèm, I'll make sure it checks for an existing copy if the petched file in future versions.
[url=http://www.tombh.co.uk/colour_memories/contribute.php]Colour-Memories Database[/url]

smil99
Posts: 174
Joined: Sat 18 Aug 2007, 22:12

Petch looks promising for puppy

#37 Post by smil99 »

Petch looks promising for puppy. However it would be nice if it can also check dependencies and give the option to also install them in addition to the program of interest.

You may check slitaz install package - http://www.slitaz.org/en/


Cheers.

maddox
Posts: 454
Joined: Fri 28 Sep 2007, 20:37
Location: sometimes in France

#38 Post by maddox »

Hi, tombh,
just a little feedback ...
petch-0.3 pet (5 oct 21:25 french time / puppy 4.1rc-retro live-cd)

- you need to check the nber of files (sources) available and limit the selection (positive nber) to the nber of files found. (info below)

petch *
[ 1] - puppylinux.ca | puppyfiles | 915resolution-0.5.3-static.pet (19206)
[ 2] - puppylinux.ca | puppyfiles | 915resolution-0.5.2.pet (6104)
[ 3] - puppylinux.ca | puppyfiles | 915resolution-0.5.3-static.pet (19181)
[ 4] - ibiblio | pet_packages-2 | 915resolution-0.5.2.pet (6.0K)
[ 5] - ibiblio | pet_packages-4 | 915resolution-0.5.3-static.pet (19K)
[ 6] - ibiblio | pet_packages-3 | 915resolution-0.5.3-static.pet (19K)

- using zero (0) as a choice, petch exits normally (an easy exit)
- using a letter (a, c, x, !, # ) petch exits normally
- using minus one (-1) to minus six (-6) as a choice, petch really connects and downloads a package on the list !
-1 ... #http://puppylinux.ca/puppyfiles/pet_pac ... static.pet
-2 ... #http://distro.ibiblio.org/pub/linux/dis ... static.pet
- using minus seven (-7), petch does it's thin air thing.
- using plus seven (7) as a choice (over the limits), ok, downloading... done (thin air)
- thin air thing : be really dumb and choose to install ...

find: warning: you have specified the -mount option after a non-option argument -type, but options are not positional (-mount affects tests specified before it as well as those specified after it). Please specify options before other arguments.

cp: cannot stat `/root/.fvwm95rc': No such file or directory
cp: cannot stat `/tmp/fvwm95rcBACKUP': No such file or directory
/sbin/petget: line 197: 13042 Terminated yaf-splash -font "8x16" -outline 0 -margin 4 -bg orange -text "PETget package manager
Updating menu, please wait..."
rm: cannot remove directory `./'
/sbin/petget: line 287: 19672 Terminated yaf-splash -font "8x16" -outline 0 -margin 4 -bg orange -text "PETget package manager
Checking dependencies, please wait..."

Success ! (package thin air has been installed)

Great idea tombh, hope this helps , keep going .. ;)
.

moron
Posts: 22
Joined: Mon 06 Oct 2008, 17:08

#39 Post by moron »

oh, does this mean the pupster doesnt update itself then,

i wuz jus gonna try it

but if youve only jus got a pkg manager i think i'll go on lookin

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

#40 Post by trapster »

moron wrote:
oh, does this mean the pupster doesnt update itself then
No....neither will it turn your computer on as you're pulling in the driveway. Nor will it cook breakfast for you. It might clean your house for you but I haven't asked that question in the forum yet.

Good luck going on looking.
trapster
Maine, USA

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

moron
Posts: 22
Joined: Mon 06 Oct 2008, 17:08

#41 Post by moron »

holey smoley trapster

wuznt expectin nun o dat neever

jus lookin fer a better os dan windas

carnt be dat hard?

praps i shud get a mac

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#42 Post by Béèm »

moron wrote:praps i shud get a mac
Yes, do that.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

moron
Posts: 22
Joined: Mon 06 Oct 2008, 17:08

#43 Post by moron »

happy lot arntya - not

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

#44 Post by Caneri »

Hi People,

You are being baited..let the moron rest in peace..we've seen this before.

@moron...what's your alias..you've been here before to be..well..a moron...as usual, learn to spell and goodbye. I would hope the mods delete this one as it's the same as the other one...sheesh

Eric
[color=darkred][i]Be not afraid to grow slowly, only be afraid of standing still.[/i]
Chinese Proverb[/color]

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#45 Post by Béèm »

You're right, Eric.
The saying is: don't feed the trolls, they will die then. 8)
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

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

#46 Post by Caneri »

Hi Beem,

This thread is important..so let's cut the crap and use it well.

Eric
[color=darkred][i]Be not afraid to grow slowly, only be afraid of standing still.[/i]
Chinese Proverb[/color]

KF6SNJ
Posts: 674
Joined: Tue 19 Jun 2007, 05:29
Location: Distressed States of Amerika
Contact:

#47 Post by KF6SNJ »

Impressive. I may have use this in my reworking of ChurchPup. I think this is a great add on. Awesome work! Bravo Zulu.
The only windows I have are those on my home.

User avatar
puppyluvr
Posts: 3470
Joined: Sun 06 Jan 2008, 23:14
Location: Chickasha Oklahoma
Contact:

#48 Post by puppyluvr »

:D This is just what Ive been talking about. This is great..
.............Speechless..........
This is a must have..Absolutely...
Works great in 301.
Tip: Remember to capitalize...

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

#49 Post by tombh »

@maddox: nice work! I'll definitely take that into consideration.
@KF6SNJ: Thanks :)
@puppyluvr: And more Thanks :D
[url=http://www.tombh.co.uk/colour_memories/contribute.php]Colour-Memories Database[/url]

User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#50 Post by Aitch »

hi tombh

count me in too, hope Barry gives this seeeerious consideration for including in Puppy

Just the kind of small smart prog future puppy & its development needs IMHO - excellent

Can you have a look here, and see if there's anything you can do?

http://www.murga-linux.com/puppy/viewtopic.php?t=34137

Seems like bumptop/& a certain nameless os's tabletop demo [bumptop copy?] from a few years ago - big stretch, but that sort of links with 3D compiz, yes?

Aitch

Post Reply