Perhaps another "feature" needed is a template editor. Rather than having to create the path in templates-custom, copy over the template, etc, it would be a relatively simple matter to create a perl script to automate this.
/sbin/e-smith/modify-template templatepath This script could present a list of the available template fragments, from which the user would select one, and then load the fragment into vi or pico. After editing, if the saved file is different than the original, the fragment would automatically be placed into templates-custom. Exit logic could either return to the prompt, or return to the fragment list. The editor would of course need to check for existing custom templates -- basically the same logic that goes into selecting files for template expansion. Edit the custom template if it exists, else load the default and save to custom. Also display any new fragments from custom. For editing a specific fragment, a special syntax for templatepath: templatepath:fragmentname Or an alternate syntax: /modify-template -f fragmentname templatepath Another option would be to provide a grep filter in the editor: ./modify-template -s "searchstring" templatepath This would present a list of only those fragments containing the specified searchstring. Note that the -f option would not apply here. Lastly, some options to check what type a template (or fragment) is, and to restore a template (or fragment) to the default state. Display all fragments (or the specified fragment) and indicate if it is the default or custom: ./modify-template -t [-f fragmentname] templatepath Delete the specified template or fragment: ./modify-template -d [-f fragmentname] templatepath Some more search options. A -a to search all fragments in a directory, and a -r to search recusively: ./modify-template -a -r -s "searchstring" pathname Note that pathname in this case would be interpreted relative to /etc/e-smith/templates. Oh, and I suppose an option to create a new template: ./modify-template -n fragmentname templatepath And one to "copy" one from an existing fragment: ./modify-template -c sourcepath:fragment targetpath:fragment This modify-template editor interface would eliminate the primary need for comments in the output (ie, finding the fragment that generates the output) and would simplify the process of editing fragments (not really necessary to understand the templates / templates-custom structure.) Comments? Scott -- Please report bugs to [EMAIL PROTECTED] Please mail [EMAIL PROTECTED] (only) to discuss security issues Support for registered customers and partners to [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Archives by mail and http://www.mail-archive.com/devinfo%40lists.e-smith.org