From 6d1c3d1083e74e9eae99ad304977401feccb88c8 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Tue, 4 Nov 2008 15:18:41 +0100 Subject: we now have function to list pacman repos and add them on the target --- src/core/libs/lib-pacman.sh | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'src/core') diff --git a/src/core/libs/lib-pacman.sh b/src/core/libs/lib-pacman.sh index 9b37bb0..f7ee244 100644 --- a/src/core/libs/lib-pacman.sh +++ b/src/core/libs/lib-pacman.sh @@ -76,17 +76,9 @@ do #TODO: this is a VERY, VERY dirty hack. we fall back to ftp for any non-core repo because we only have core on the CD. also user maybe didn't pick a mirror yet if [ "$repo" != core ] then - cat << EOF >> /tmp/pacman.conf - -[${repo}] -Include = /etc/pacman.d/mirrorlist -EOF + target_add_pacman_repo ${repo} 'Include = /etc/pacman.d/mirrorlist' else - cat << EOF >> /tmp/pacman.conf - -[${repo}] -Server = ${serverurl} -EOF + target_add_pacman_repo ${repo} "Server = ${serverurl}" fi done # Set up the necessary directories for pacman use @@ -99,6 +91,25 @@ done } +target_list_pacman_repos () +{ + grep '\[.*\]' /tmp/pacman.conf | grep -v options | sed 's/[//' | sed 's/]//' +} + + +# $1 repo name +# $2 string +target_add_pacman_repo () +{ + [ -z "$2" ] && die_error "target_add_repo needs \$1 repo-name and \$2 string (eg Server = ...)" + cat << EOF >> /tmp/pacman.conf + +[${1}] +${2} +EOF +} + + # taken from quickinst. TODO: figure this one out pacman_what_is_this_for () { -- cgit v1.2.3-54-g00ecf