HI everyone.
At the last distro-constuctor meeting I took the AI to look into and
prototype a framework for finalization.
Requirements would be:
- Flexibility to call any kind of shell script with arguments.
Different people prefer different shells. Different situations may call
for different shells too.
- Register multiple scripts in some order, and have them called in order
of registration (as exit handlers are called by atexit(3C)). This will
accommodate, for example, executing one or more scripts which massage
files for a particular distribution, and then executes a last script for
creating a particular kind of medium (such as a CD or USB image) from
some base format medium (such as a netinstall image).
- Logging of stdout and stderr to choosable files for debugging purposes.
My vision is that the distro-constructor can read a configuration file
at startup time, and set up the finalization based on it. When the time
comes, it can call a function to execute all finalization.
I currently have a prototype which not only accommodates any kind of
shell, but is flexible enough to be able to call a C program or other
executable with arguments, or invoke a python function with arguments.
I have tested it by calling a ksh script, a csh script, a C program and
two python functions. Currently it is about 200 lines of python code.
I am still working on getting rerouting of stdout and stderr to work.
(This email is late as I wanted to say it was done, but...)
Food for discussion at tomorrow's meeting.
Thanks,
Jack