| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
function yum.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='';; |
|---|
| 34 |
--can-fail) can_fail=true;; |
|---|
| 35 |
*) break;; |
|---|
| 36 |
esac |
|---|
| 37 |
shift |
|---|
| 38 |
done |
|---|
| 39 |
"$_VYUM" "$name" -- -y install $flags $* || $can_fail |
|---|
| 40 |
done |
|---|
| 41 |
} |
|---|
| 42 |
|
|---|
| 43 |
function yum.initVariables |
|---|
| 44 |
{ |
|---|
| 45 |
findDir YUMREPOSDEFAULT \ |
|---|
| 46 |
"$__CONFDIR/.distributions/$DISTRIBUTION/yum.repos.d" \ |
|---|
| 47 |
"$__DISTRIBDIR/$DISTRIBUTION/yum.repos.d" \ |
|---|
| 48 |
'' |
|---|
| 49 |
} |
|---|
| 50 |
|
|---|
| 51 |
function yum.__substituteConf |
|---|
| 52 |
{ |
|---|
| 53 |
local f=$1 |
|---|
| 54 |
local prefix=$2 |
|---|
| 55 |
|
|---|
| 56 |
if test -e "$f"; then |
|---|
| 57 |
$_SED -e "s!@YUMETCDIR@!$prefix$PKGCFGDIR/yum/etc!g; |
|---|
| 58 |
s!@YUMCACHEDIR@!$prefix$PKGCFGDIR/yum/cache!g; |
|---|
| 59 |
s!@YUMLIBDIR@!$prefix$PKGCFGDIR/yum/lib!g; |
|---|
| 60 |
s!@YUMLOGDIR@!$prefix$PKGCFGDIR/yum!g; |
|---|
| 61 |
s!@YUMLOCKDIR@!$prefix$PKGCFGDIR/yum!g; |
|---|
| 62 |
" "$f" >"$f.tmp" |
|---|
| 63 |
$_CMP -s "$f" "$f.tmp" || $_CAT "$f.tmp" >"$f" |
|---|
| 64 |
$_RM -f "$f.tmp" |
|---|
| 65 |
fi |
|---|
| 66 |
} |
|---|
| 67 |
|
|---|
| 68 |
function yum.initFilesystem |
|---|
| 69 |
{ |
|---|
| 70 |
mkdir -p "$PKGCFGDIR"/yum/{etc,cache,lib} |
|---|
| 71 |
|
|---|
| 72 |
populateDirectory "$PKGCFGDIR/yum/etc" \ |
|---|
| 73 |
"$__DISTRIBDIR/defaults/yum" \ |
|---|
| 74 |
"$__DISTRIBDIR/$DISTRIBUTION/yum" \ |
|---|
| 75 |
"$__CONFDIR/.distributions/$DISTRIBUTION/yum" |
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
|
|---|
| 79 |
local f0="$PKGCFGDIR"/yum/etc/yum.conf |
|---|
| 80 |
local f1="$PKGCFGDIR"/yum/etc/yum-hack.conf |
|---|
| 81 |
cp -a "$f0" "$f1" |
|---|
| 82 |
|
|---|
| 83 |
yum.__substituteConf "$f0" 'hostfs://' |
|---|
| 84 |
yum.__substituteConf "$f1" '/../../../../../../../../../../../../' |
|---|
| 85 |
|
|---|
| 86 |
test -z "$YUMREPOSDEFAULT" -o -e "$PKGCFGDIR/yum/etc/yum.repos.d" || \ |
|---|
| 87 |
$_LN_S "$YUMREPOSDEFAULT" "$PKGCFGDIR/yum/etc/yum.repos.d" |
|---|
| 88 |
} |
|---|