use $(LIBENSCVECTOR) instead of libensc_vector.a
[util-vserver.git] / util-vserver / scripts / vserver-build.functions.apt
index 3d9e3af..eee55ed 100644 (file)
@@ -15,7 +15,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-function installBasePackages
+function apt.installBasePackages
 {
     local name="$1"
     local dir="$2"
@@ -40,24 +40,43 @@ function installBasePackages
     done
 }
 
-function initVariablesApt
+function apt.initVariables
 {
-    :
+    findFile APTCONFDEFAULT \
+       "$__CONFDIR/.distributions/$DISTRIBUTION/apt.conf" \
+       "$__CONFDIR/.defaults/apps/pkgmgmt/apt.conf" \
+       "$__DISTRIBDIR/$DISTRIBUTION/apt.conf" \
+       "$__DISTRIBDIR/defaults/apt.conf" \
+       ''
+
+    findFile APTVENDORDEFAULT \
+       "$__CONFDIR/.distributions/$DISTRIBUTION/vendor.conf" \
+       "$__CONFDIR/.defaults/apps/pkgmgmt/vendor.conf" \
+       /etc/apt/vendors.list \
+       "$__DISTRIBDIR/$DISTRIBUTION/vendor.conf" \
+       "$__DISTRIBDIR/defaults/vendor.conf" \
+       ''
 }
 
-function initFilesystemApt
+function apt.initFilesystem
 {
-    mkdir -p "$PKGCFGDIR"/apt/{etc,archives/partial,cache,state/lists/partial}
+    mkdir -p "$PKGCFGDIR"/apt/{etc/sources.list.d,etc/vendors.list.d,etc/apt.conf.d,archives/partial,cache,state/lists/partial}
     
     populateDirectory "$PKGCFGDIR/apt/etc" \
-       "$DISTRIBDIR/defaults/apt" \
-       "$DISTRIBDIR/$DISTRIBUTION/apt" \
-       "$CONFDIR/.distributions/$DISTRIBUTION/apt"
+       "$__DISTRIBDIR/defaults/apt" \
+       "$__DISTRIBDIR/$DISTRIBUTION/apt" \
+       "$__CONFDIR/.distributions/$DISTRIBUTION/apt"
 
     local f="$PKGCFGDIR"/apt/etc/apt.conf
     if test -e "$f"; then
-       sed -e "s!@APTETCDIR@!$PKGCFGDIR/apt/etc!g" "$f" >"$f.tmp"
-       cmp -s "$f" "$f.tmp" || cat "$f.tmp" >"$f"
-       rm -f "$f.tmp"
+       $_SED -e "s!@APTETCDIR@!$PKGCFGDIR/apt/etc!g" "$f" >"$f.tmp"
+       $_CMP -s "$f" "$f.tmp" || $_CAT "$f.tmp" >"$f"
+       $_RM -f "$f.tmp"
     fi
+
+    test -z "$APTCONFDEFAULT" || \
+       $_LN_S "$APTCONFDEFAULT"   "$PKGCFGDIR"/apt/etc/apt.conf.d/default.conf
+
+    test -z "$APTVENDORDEFAULT" || \
+       $_LN_S "$APTVENDORDEFAULT" "$PKGCFGDIR"/apt/etc/vendors.list.d/default.conf
 }