1 # $Id: vserver-build.functions.apt,v 1.8 2005/04/16 21:20:45 ensc Exp $ --*- sh -*--
3 # Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; version 2 of the License.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 function apt.installBasePackages
23 test "$dir" != / || return 0
24 for filelist in "$dir"/*; do
25 isRegularFile "$filelist" || continue
31 while test "$#" -gt 0; do
33 --reinstall) flags='--reinstall';;
34 --can-fail) can_fail=true;;
39 "$_VAPT_GET" "$name" -- install -y $flags $* || $can_fail
43 function apt.initVariables
45 findFile APTCONFDEFAULT \
46 "$__CONFDIR/.distributions/$DISTRIBUTION/apt.conf" \
47 "$__CONFDIR/.defaults/apps/pkgmgmt/apt.conf" \
48 "$__DISTRIBDIR/$DISTRIBUTION/apt.conf" \
49 "$__DISTRIBDIR/defaults/apt.conf" \
52 findFile APTVENDORDEFAULT \
53 "$__CONFDIR/.distributions/$DISTRIBUTION/vendor.conf" \
54 "$__CONFDIR/.defaults/apps/pkgmgmt/vendor.conf" \
55 /etc/apt/vendors.list \
56 "$__DISTRIBDIR/$DISTRIBUTION/vendor.conf" \
57 "$__DISTRIBDIR/defaults/vendor.conf" \
61 function apt.initFilesystem
63 mkdir -p "$PKGCFGDIR"/apt/{etc/sources.list.d,etc/vendors.list.d,etc/apt.conf.d,archives/partial,cache,state/lists/partial}
65 populateDirectory "$PKGCFGDIR/apt/etc" \
66 "$__DISTRIBDIR/defaults/apt" \
67 "$__DISTRIBDIR/$DISTRIBUTION/apt" \
68 "$__CONFDIR/.distributions/$DISTRIBUTION/apt"
70 local f="$PKGCFGDIR"/apt/etc/apt.conf
72 $_SED -e "s!@APTETCDIR@!$PKGCFGDIR/apt/etc!g" "$f" >"$f.tmp"
73 $_CMP -s "$f" "$f.tmp" || $_CAT "$f.tmp" >"$f"
77 test -z "$APTCONFDEFAULT" || \
78 $_LN_S "$APTCONFDEFAULT" "$PKGCFGDIR"/apt/etc/apt.conf.d/default.conf
80 test -z "$APTVENDORDEFAULT" || \
81 $_LN_S "$APTVENDORDEFAULT" "$PKGCFGDIR"/apt/etc/vendors.list.d/default.conf