diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2008-11-04 15:18:41 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2008-11-04 15:18:41 +0100 |
commit | 6d1c3d1083e74e9eae99ad304977401feccb88c8 (patch) | |
tree | 7ff3693e2cfad6ae54900e1277987d94e81d34e9 | |
parent | 255d0df3c1e3c7bacb709f4ce2a25fa55bb73d8f (diff) |
we now have function to list pacman repos and add them on the target
-rw-r--r-- | src/core/libs/lib-pacman.sh | 31 |
1 files changed, 21 insertions, 10 deletions
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 () { |