Joined: July 2004
||Posted: Oct. 07 2007,13:13
I'd say this is probably the best solution overall, of those that I've heard. I use something similar to this in one or two extensions that want certain personal configuration files in the user's home directory. Rather than include these files in user.tar.gz, they are installed to the application directory, and the application is run from a wrapper script. The wrapper checks for the existence of the needed files/directories, and copies/creates them only if necessary before running the application. This method allows you to store an original file that can be used in the event of a configuration mishap, it allows the same behavior if you happen to run the program as a different user, and allows you to indiscriminately delete all directories in a package without causing application failure. The drawback, of course, is that it requires the use of a wrapper script.
|I've been using "touch /var/locks/placeholder"|
Using wrappers is a fairly common practice even outside of DSL, though. Apps such as Firefox that are intended to be essentially self-contained will often use wrappers to prepare the environment to run the app, just as we do for many uci and tar.gz mydsl packages.