@nitram: There's one teeency flaw with dependency assumptions we've encountered.
Let's say we have a web development box which under most distros we would install LAMP.
For CentOS (for example) the apps list would be:
apache2 php5 mysql mysql-server and a few other odds and ends.
I mistakenly took the same approach with TC
apache2 php5 mysql-client mysql and again, a few other oddities.
What I didn't know is that php5 claims MySQL as being a dependency. You could imagine my surprise when I used a script for general installation (tce-load -wi $app_list) and then later removed php5 as it wasn't needed for THAT specific project, but MySQL was needed... come to find out my SQL server disappeared!
Imagine looking at extensions based on their download: If you tce-load a given app such as php5 you could call this the "parent" extension and all dependencies listed within the file.tcz.dep as children. With the PHP-MySQL scenario, one or more of the children are also parents in some instances. There's a ton of legitimate examples which would likely fall into this category.
What we have on the white-board in the not so distant future is a separate file (similar to onboot.lst) which flags files which are specifically requested in tce-load where if you specifically request a file, it's considered a parent, thus when removing an extension, if a dependency is found within this new file, it's left alone - along with any of ITS dependencies. This requires a little bit of a rewrite of tce-load so once finished and perfected we'll be submitting it here for consideration to be implemented into the core.
As for a clean slate as you noted, we already have a method which is relatively tried and tested which helps with this kind of maintenance. We have our own TCL mirror in-house so it will be more convenient (and faster) when we're using it, but even "live" it should be a good alternative assuming any updates which have been made to the live repository are functional.
1) Create a static file somewhere (we persist /opt, so that's where most of our functions like this are placed) such as /opt/.extensions and within this file list all of the extensions you want to have "always installed" and maintained. I'm going to use the basic TinyCore approach for the example:
/opt/.extensionsXvesa
Xprogs
flwm_topside
wbar
2) Create a small script to run the show
/opt/extensions.sh (chmod +x)
#!/bin/sh
exts=`cat /opt/.extensions`
for ext in $exts
do
ext=${ext/.tcz/} # Remove the .tcz extension if it's in the item
if [ ! -d /tmp/tcloop/$ext ]; then
# The extension isn't installed and/or loaded #
echo "Installing extension [$ext]"
su -c "tce-load -wi $ext" tc
fi
done
There are a few assumptions involved here, such as networking is up and running, the machine itself HAS internet or network access by the time it runs AND that the extension(s) listed were intended for install-and-boot.
When ever you need to clean out the closet, simply delete tcedir/optional, onboot.lst and on-demand if it's used, then reboot. If you don't want to reboot, also empty the /usr/local/tce.installed directory, kill all post-boot processes and
then run the script. Rebooting is the cleanest method, though, as many times apps create files/directories elsewhere which may no longer be in their default state. We're working on this problem, too (where in the end we'll be able to call a "reformat" program which basically takes the machine back to a clean boot without the need for rebooting, which should be about 98% efficient as there might be a small amount of memory loss from less-than-efficient programs which had been running previously and didn't die gracefully.)