You are not logged in.
Pages: 1
hello, I've written a bunch of Python programs that may be of interest for you, I'm too lazy/stupid to name them so I just call them "lazy-", here we go...
PKGBUILDs
arch + gentoo + initng + python = enlisy
Offline
looks like someone has been lazy
Offline
Offline
hello, I've written a bunch of Python programs that may be of interest for you, I'm too lazy/stupid to name them so I just call them "lazy-", here we go...
Out of curiosity, why 'lazy-' instead of 'stupid-'? :-D
No wonder you haven't been posting much... too much coding!
Dusty
Offline
python festival?
First thing I thought was a bunch of nerdy programmers sitting around in the woods, talking about why they think python rules, playing music, eating smores, complaining about the poor wireless reception, and making "compile smores" and "make CC=burn -f wood" and other obscure "snake" jokes (silly python people and their love of snakes--almost as bad as silly ruby people and their love of jewelry).
turns out it was just xerxes.
:shock:
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
hello again,
you can consider all the code as BSDL license so feel free to do what you want with it,
I've been coding on lazy-pac/libpypac today and added support for "reason" and uninstallations of dependencies,
I just installed gedit and that took in 16 packages and then i hit "remove" and all 16 was taken off,
Now I only need to finish off libpysrc, I'm a little clueless on how to run the PKGBUILD from Python...
arch + gentoo + initng + python = enlisy
Offline
this is an old thread,
you can find PKGBUILDs here instead,
http://xerxes2.1go.dk/python/python_sta … ogram.html
arch + gentoo + initng + python = enlisy
Offline
Now I only need to finish off libpysrc, I'm a little clueless on how to run the PKGBUILD from Python...
Still having trouble? It might be fun to poke around in the code. I think a python implementation of pacman would be cool. I don't think the vm overhead of python would cause too many problems, and it would make testing new features for the C implementation of pacman very easy. A good prototype tool.
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
you can fix libpysrc if you want cactus, it's working pretty nice but it's not a complete clone of makepkg yet, I'm not very fond of bash so makepkg is a little bit messy for me,
also one other thing, I can't find a way to extract "mtime" on the ftp servers for the package databases,
apeiro grabs it through some "ftplib" like "yyyymmddhhmmss" and saves it as .lastupdate so you don't have to sync the mirrors if they havn't been updated since last syncing,
example, "20050425134523" , dunno if that's possible in pythons ftplib,
arch + gentoo + initng + python = enlisy
Offline
I think so..
from ftplib import FTP
ftp = FTP('ftp.archlinux.org') # connect to host, default port
ftp.login() # user anonymous, passwd anonymous@
ftp.retrlines('modtime %s' % filepath)
or something l like that should work..it would return the time in the following format, I think..
current.db.tar.gz 04/26/2005 16:09:32 GMT
havent tested it, though..
Might need to add a callback to store the string result, or use a different command..like
ftp.sendcmd()
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
Offline
if that works cactus I'll be your bitch for a month,
I'll be back...
*xerxes starts up vim and starts coding*
arch + gentoo + initng + python = enlisy
Offline
Offline
I get "unknown command" on that cactus, but I think you'll find it later,
I've been reading the whole ftp standards today but I can't find these little tweaks in there,
arch + gentoo + initng + python = enlisy
Offline
bow down and worship me.
from ftplib import FTP
ftp = FTP('ftp.archlinux.org')
ftp.login()
filepath="current/os/i686/"
ftp.cwd(filepath)
timestamp=ftp.sendcmd('MDTM current.db.tar.gz')
print timestamp
All it took was a little ethereal packet sniffing to determine the corrent ftp protocol command to send.
and the output...
(eliott@tungsten temp)$ python2.4 test.py
213 20050426160932
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
you're the new arch network champion cactus!!!!!!!!!!!!!!!!!!!!!!
works like a dream, new versions are uploaded, 8)
I knew you should do it,
it doesn't took that long either, phrak is taking the time isn't he...
arch + gentoo + initng + python = enlisy
Offline
it doesn't took that long either, phrak is taking the time isn't he...
heh..yeah. I bet he was using a stopwatch, and writing incremental time units on a whiteboard somewhere. :twisted:
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
Now I only need to finish off libpysrc, I'm a little clueless on how to run the PKGBUILD from Python...
If you want to use the bash version of makepkg, and simply have libpysrc be a wrapper for it, I don't think it would be too hard.
Two possibilities I can think of offhand: go to the dir in question, spawn a bash shell, and have it do all the work. Just have libpysrc pass appropriate args, and return std output and error to the python script for display.
The other possibility would be to have lipysrc do it all by hand, basically mimicing the functionality of makepkg, but in python...
It looks like you have started down the road of solution #2, but solution #1 might be easier...
what do you think? I can help with either one if you want...
EDIT: xerxes..I shortened up your exist_check function in libpysrc to 7 lines..10 if you count the comments..
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
woohooo..
this is what I did this evening..
It took me bloody forever to figure out how to read the stdoutput and stderr from a spawned process, without it blocking until all the output was done..silly python.
Finally got it figured out..
The diff is against libpysrc.py-0.1.8. It contains a much shorter find function, and a "passthrough" function.
The passthrough does what its name suggests. It passes through a directory to work in, and a set of flags to makepkg. The output is snagged as soon as it occurs, and simply printed out in this case. It would be easy to send that text somewhere else though...
Here is the magic goodness
Note: I use tabs, so convert tabs to spaces first if you are an evil space user... :twisted:
heh..and here is a screenshot.
The test script just had the following:
passthrough("/home/build/bwbar","-of")
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
cactus, one goal I had with libpypac/libpysrc was that they should _NOT_ depend on pacman/makepkg,
it should be a complete standalone implementation of ABS,
arch + gentoo + initng + python = enlisy
Offline
ok, I take very accurate time... I did it all in my head... and according to me, it took cactus:
162 days, 17 hours, 4 minutes, and 39 seconds
Offline
cactus, one goal I had with libpypac/libpysrc was that they should _NOT_ depend on pacman/makepkg,
it should be a complete standalone implementation of ABS,
I kind of figured. Just remove the passthrough function then. I think the directory find implementation might be useful..
With that in mind, I will see what else I can scratch together to assist in the code.
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
I must admit that it makes sense to pipe makepkg but it should be possible to make a complete clone,
I've fixed a few things in libpysrc-0.1.9 and also added support for building without md5sum, I'll take a look on your patch later tonight, I'm going for a run in the park now so maybe I feel to lazy afterwards,
I've just used lazy-pac to run an update with gcc, glibc and a few other things and then I installed rxvt-unicode from source and everything seems to work so it should be closing in on first stable version 0.2.0 8)
arch + gentoo + initng + python = enlisy
Offline
I updated my diff to be against 0.1.9, and removed the passthrough function, even though it was cool and took me a while..
EDIT: It looks like you are just building packages as root. You might want to spawn a subprocess that assumes permissions of a user, and then builds under fakeroot.
Maybe have the user specified in some pypac config file or something...
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
I added your patch cactus, I remember now when I wrote that function that there is probably some better way to do it,
if I understood correctly your function didn't look first in /var/abs/local so I let that stay in the function,
it looks and is much better now! 8)
about this fakeroot stuff I don't have a clue, i'm building as root at the moment and I guess I always used makepkg as root also,
is that not good?
arch + gentoo + initng + python = enlisy
Offline
Pages: 1