Jonathan R wrote:
> I want to do a package manager where it handles a variety of package
> types, deb, rpm, source, bin. Secondly, it should ask on packages like
> Firefox for example, where to install it. Perhaps in the users home
> directory, perhaps in /usr/… maybe some place else that the user
> wants. It should also ask if the user wants the application or service
> to run in a chroot environment. Ofcourse there should be a
> setting/option to go with defaults.
>
> The package manager should be able to read the spec file of the deb or
> rpm and satisfy the requirements. It should not cause conflicts due to
> deb or rpm packages.
>
> I’d like to do this in python.
>
> Comments, tips, suggestions?
(1) Read all the articles you can find about similar projects, as has
been suggested.
(2) Read the code of the existing package managers, especially those
written in python. Get to understand what they do, and how they do it.
Also, you’ll get an idea of what they can’t do.
(3) Write a list of features that you want your package manager to have
and prioritise them (to get an implementation order)
(4) Starting with one of the existing package managers that you feel is
closest to what you want and/or best written and easiest to understand,
try to add the next feature on your list, preferably by borrowing and
adapting code from the other programs. Repeat a couple of times to get a
feel for the process.
(5) Pick the feature you think will be most difficult and work out what
you will have to do to implement it. This may cause you to rework
existing code.
(6) Repeat 4 & 5 until you feel you understand the whole problem. That
includes any major features that you want to implement later.
(7) Sit down and think about what your final program will look like.
Face up to all major issues. Be prepared to throw away all the code you
have written up to now and start again (it probably won’t be that bad,
but you must keep the option).
(8) Now you can draw up a plan. Especially work out how you can test
your program. Write your definitive list of features and descriptions of
how it will work.
(9) Make all the test data and any test programs that you will need.
(10) Now implement your package manager properly. Test it as you go, and
add more test data as you realize what you forgot before.
Cheers, Dave