When there are many ways to place & build the tree, there will be more ways it can fail. The complexity to cope with all the details becomes unmanageable as your mail shows.
If you can't quickly diagnose what is going on in the scripts, it shows that the complexity has gotten out of hand. The problem is that the src tree placement is not accomodated, so the approach you are using is unsupported. We cannot accomodate everything. We should not strive to accomodate everything. Time and time again we see such striving stands directly opposed to attempts at improving security. Since 2003 I have been trying to REDUCE the number of crazy ways people can build the tree. I believe people should bend themselves to approximately 2 methods of building, and all other methods should be unsupported, removed, and quite frankly they should error out immediately upon build start. It is simply unsustainable to keep accomodating 'choice'.
