Add a way to associate a distribution with a default template.
authorDaniel Hokka Zakrisson <daniel@hozac.com>
Sun, 24 Jun 2007 22:04:22 +0000 (22:04 +0000)
committerDaniel Hokka Zakrisson <daniel@hozac.com>
Sun, 24 Jun 2007 22:04:22 +0000 (22:04 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2554 94cd875c-1c1d-0410-91d2-eb244daf1a30

doc/configuration.xml
scripts/vserver-build.template

index 9134178..8db75d1 100644 (file)
@@ -412,6 +412,11 @@ this distribution.
         </description>
       </link>
     </collection>
+    <link name="template">
+      <description>
+Symlink to the default template for this distribution.
+      </description>
+    </link>
   </collection>
   
   <!-- Vserver configuration -->
index dc5d1c0..27616cb 100644 (file)
@@ -48,6 +48,13 @@ done
 
 getDistribution '' 1
 
+for d in "$__CONFDIR/.distributions/$DISTRIBUTION" \
+       "$__DISTRIBDIR/$DISTRIBUTION"; do
+    if test -r "$d/template"; then
+       TEMPLATE=( "$d/template" "${TEMPLATE[@]}" )
+    fi
+done
+
 base.init
 test -z "$use_pkgmgmt" || pkgmgmt.initVariables