summaryrefslogtreecommitdiff
path: root/src/core/libs/lib-pacman.sh
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-11-04 15:51:07 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-11-04 15:51:07 +0100
commit935a051308257c0b43d410ae38be625eb1a095b3 (patch)
tree30bb2b1c355bc9430bfc2f0e9df6c5cdecc040c3 /src/core/libs/lib-pacman.sh
parentec2dfe9effdb47d9eb26bc11e4ad0d56d3060412 (diff)
oops.. runtime != target. fixes for yaourt and pacman
Diffstat (limited to 'src/core/libs/lib-pacman.sh')
-rw-r--r--src/core/libs/lib-pacman.sh32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/core/libs/lib-pacman.sh b/src/core/libs/lib-pacman.sh
index f7ee244..ab63540 100644
--- a/src/core/libs/lib-pacman.sh
+++ b/src/core/libs/lib-pacman.sh
@@ -76,9 +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
- target_add_pacman_repo ${repo} 'Include = /etc/pacman.d/mirrorlist'
+ add_pacman_repo target ${repo} 'Include = /etc/pacman.d/mirrorlist'
else
- target_add_pacman_repo ${repo} "Server = ${serverurl}"
+ add_pacman_repo target ${repo} "Server = ${serverurl}"
fi
done
# Set up the necessary directories for pacman use
@@ -91,21 +91,29 @@ done
}
-target_list_pacman_repos ()
+# $1 target/runtime
+list_pacman_repos ()
{
- grep '\[.*\]' /tmp/pacman.conf | grep -v options | sed 's/[//' | sed 's/]//'
+ [ "$1" != runtime -a "$1" != target ] && die_error "list_pacman_repos needs target/runtime argument"
+ [ "$1" = target ] && conf=/tmp/pacman.conf
+ [ "$1" = runtime ] && conf=/etc/pacman.conf
+ grep '\[.*\]' $conf | grep -v options | sed 's/[//' | sed 's/]//'
}
-# $1 repo name
-# $2 string
-target_add_pacman_repo ()
+# $1 target/runtime
+# $2 repo name
+# $3 string
+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}
+ [ "$1" != runtime -a "$1" != target ] && die_error "add_pacman_repo needs target/runtime argument"
+ [ -z "$3" ] && die_error "target_add_repo needs \$2 repo-name and \$3 string (eg Server = ...)"
+ [ "$1" = target ] && conf=/tmp/pacman.conf
+ [ "$1" = runtime ] && conf=/etc/pacman.conf
+ cat << EOF >> $conf
+
+[${2}]
+${3}
EOF
}