thanx for that.
at the moment i`ve used this to do the rpm stuff: http://cekirdek.uludag.org.tr/~meren/php_rpm/
i`m using that to get all the stuff out of the rpm files.
PHP5 is now also quite good at parsing XML, so playing with repodata
shouldn't be hard either.
i`m not sure if it would be wise (for me) to try and improve the existing repodata structure.. also it`s just to big for what it provides.. and i want to do all the stuff my way first before i improve other things.
And i think i found a way to bypass rpm`s off way of checking for version numbers.
imagine you have:
a = 1001001
b = 1002001
1.1b2 = 1.1[1002001]2 == right for rpm`s version check? (i think it is)
1.b2 = 1.[1002001] == right for rpm`s version check? (i think it is)
in this case 1.1b2 ranks higher than 1.b2(rare that it even exists but well.. you gotta count it in)
Now what am i doing?
quite simple. version stuff can`t handle anything different than numbers so i need to convert
alphabetic things to numbers and it MUST start other than 0 and and other than 0 otherwise
RPM will is gonna play tricks with me.
if this is possible it can be even as fast as the current measured speed (0.001 second)
and why? well.. i just need to recalculate all versions in a php/c/c++ and put it in another
table or column (column would be best in this case). than i can just change the query slightly
and it`s checking on rpm compatible version numbers ^_^
now for another rpm version number question.
imagine the following 2 versions:
0.2.2
1.0.3
with rpm will the versions get (because it`s striping zerro`s):
2.2
1.3
??
or or is it just striping out zerro`s when there is more than 1 zerro?
i think it won`t change the initial versions in this case.
or when the length is moer than 1 character (i didn`t had a
change to look over the rpmlib coding)
some more info on the versions like how they are calculated
and in which case would be helpfull.. or a link to the file
that i need to look through
2007/4/11, Matthias Saou <thias@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>:
Mark wrote :
> you can say that (last part) again... it could take a long while till it`s
> done.. considering that i just know what pointers are in c++ and besides the
> pointers i know a few other basics but nothing interesting enough to be able
> to make this stuff in c++ and that`s the exact reason why i`m first making
> it in php.
Then you definitely want to start by coding a PHP module in C which
would wrap around rpmlib. You could then map rpm files to objects in PHP
to get all the info you need from the rpm files (requires and provides
as well as file lists for instance) and obviously create useful
functions, of which the first one could be to compare versions... and
would be 100% accurate since it would be using rpm's internal version
comparison.
PHP5 is now also quite good at parsing XML, so playing with repodata
shouldn't be hard either.
Good luck! :-)
Matthias
--
Clean custom Red Hat Linux rpm packages : http://freshrpms.net/
Fedora Core release 6 (Zod) - Linux kernel 2.6.20-1.2943.fc6
Load : 0.59 0.57 0.55
--
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list
-- fedora-devel-list mailing list fedora-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/fedora-devel-list