| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
function apt.installBasePackages |
|---|
| 19 |
{ |
|---|
| 20 |
local name="$1" |
|---|
| 21 |
local dir="$2" |
|---|
| 22 |
|
|---|
| 23 |
test "$dir" != / || return 0 |
|---|
| 24 |
for filelist in "$dir"/*; do |
|---|
| 25 |
isRegularFile "$filelist" || continue |
|---|
| 26 |
local idx=0 |
|---|
| 27 |
local can_fail=false |
|---|
| 28 |
local flags= |
|---|
| 29 |
|
|---|
| 30 |
set -- $(<$filelist) |
|---|
| 31 |
while test "$#" -gt 0; do |
|---|
| 32 |
case "$1" in |
|---|
| 33 |
--reinstall) flags='--reinstall';; |
|---|
| 34 |
--can-fail) can_fail=true;; |
|---|
| 35 |
*) break;; |
|---|
| 36 |
esac |
|---|
| 37 |
shift |
|---|
| 38 |
done |
|---|
| 39 |
"$_VAPT_GET" "$name" -- install -y $flags $* || $can_fail |
|---|
| 40 |
done |
|---|
| 41 |
} |
|---|
| 42 |
|
|---|
| 43 |
function apt.initVariables |
|---|
| 44 |
{ |
|---|
| 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" \ |
|---|
| 50 |
'' |
|---|
| 51 |
|
|---|
| 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" \ |
|---|
| 58 |
'' |
|---|
| 59 |
} |
|---|
| 60 |
|
|---|
| 61 |
function apt.initFilesystem |
|---|
| 62 |
{ |
|---|
| 63 |
mkdir -p "$PKGCFGDIR"/apt/{etc/sources.list.d,etc/vendors.list.d,etc/apt.conf.d,archives/partial,cache,state/lists/partial} |
|---|
| 64 |
|
|---|
| 65 |
populateDirectory "$PKGCFGDIR/apt/etc" \ |
|---|
| 66 |
"$__DISTRIBDIR/defaults/apt" \ |
|---|
| 67 |
"$__DISTRIBDIR/$DISTRIBUTION/apt" \ |
|---|
| 68 |
"$__CONFDIR/.distributions/$DISTRIBUTION/apt" |
|---|
| 69 |
|
|---|
| 70 |
local f="$PKGCFGDIR"/apt/etc/apt.conf |
|---|
| 71 |
if test -e "$f"; then |
|---|
| 72 |
$_SED -e "s!@APTETCDIR@!$PKGCFGDIR/apt/etc!g" "$f" >"$f.tmp" |
|---|
| 73 |
$_CMP -s "$f" "$f.tmp" || $_CAT "$f.tmp" >"$f" |
|---|
| 74 |
$_RM -f "$f.tmp" |
|---|
| 75 |
fi |
|---|
| 76 |
|
|---|
| 77 |
test -z "$APTCONFDEFAULT" || \ |
|---|
| 78 |
$_LN_S "$APTCONFDEFAULT" "$PKGCFGDIR"/apt/etc/apt.conf.d/default.conf |
|---|
| 79 |
|
|---|
| 80 |
test -z "$APTVENDORDEFAULT" || \ |
|---|
| 81 |
$_LN_S "$APTVENDORDEFAULT" "$PKGCFGDIR"/apt/etc/vendors.list.d/default.conf |
|---|
| 82 |
} |
|---|