Wednesday, January 16, 2008

Clean up the directory Structure using Bundles

When you use the package management system (as described above), you also open up the possibility of changing the directory structure to something decent.

At the moment, its something like:

/bin/app1
/bin/app2
/usr/local/bin/guiapp1
/lib/libapp1
/lib/libapp2
/lib/guilib
/share/man/app1
/share/man/app2
/usr/local/share/man/guiapp1
/usr/local/share/lib/somethingrelatedtoguiapp1butdoesn'tsayit

Thats great. Now please, pick up guiapp1 and drop it on another computer. Thats right, you cant easily because its components are scattered all over the harddisk. So you need to look for them. Fantastic job. I have a better idea, how about:


/core/programs/app1.app/bin/app1
/core/programs/app1.app/man/app1
/core/libraries/app1.lib/libapp1


/core/programs/app2.app/bin/app2
/core/programs/app2.app/man/app2
/core/libraries/app2.lib/libapp2




All files installed by app1 and app2 are now in either /core/programs/app.app or /core/libraries/app.lib We are treating these are core system files, so these are ones which can now be easily duplicated, but could not be easily moved. In many cases, its easier to keep console related apps in their same location, but hide them away. Portable gui apps are more important, so below is an example of this:

/libraries/guilib.library/guilib


/programs/guiapp.app/bin/guiapp1
/programs/guiapp.app/man/guiapp1
/programs/guiapp.app/lib/somethingrelatedtoguiapp1butdoesn'tsayit

To run the program, you just need to click guiapp.app, and boom, the computer will work out where the binaries and parts are.

And, you can now drag and drop the guilib.library onto another computer, and drag and drop guiapp1.app to another computer. Easier.

In fact, you could even avoid needing to drag guilib.library by statically compiling it, or including it in guiapp.app, and then automatically copying it to the libraries location on the first load of the program, in case any other programs need it. Uses up more memory, but means that people no longer need to worry about the harddisk structure

No comments: