summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-11-04 14:10:01 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-11-04 14:10:01 +0100
commit477e3f76f0a9afe8bc6077ab02baa0471588594e (patch)
tree2f8cca81b2bea2d7671782cc1da5cae0a7da2f56
parent3b222c68832d3495d4b04eff404324ebe843b803 (diff)
allow passing of which repos we want as argument
-rw-r--r--src/core/libs/lib-pacman.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/core/libs/lib-pacman.sh b/src/core/libs/lib-pacman.sh
index 36750b0..c50416b 100644
--- a/src/core/libs/lib-pacman.sh
+++ b/src/core/libs/lib-pacman.sh
@@ -56,22 +56,29 @@ target_write_pacman_conf ()
# target_prepare_pacman() taken from setup. modified a bit
# configures pacman and syncs for the first time on destination system
#
-# params: none
+# $@ repositories to enable (optional. default: core)
# returns: 1 on error
target_prepare_pacman() {
[ "$var_PKG_SOURCE_TYPE" = "cd" ] && local serverurl="${var_FILE_URL}"
[ "$var_PKG_SOURCE_TYPE" = "ftp" ] && local serverurl="${var_SYNC_URL}"
+ [ -z "$1" ] && repos=core
+ [ -n "$1" ] && repos="$@"
# Setup a pacman.conf in /tmp
cat << EOF > /tmp/pacman.conf
[options]
CacheDir = ${var_TARGET_DIR}/var/cache/pacman/pkg
CacheDir = /src/core/pkg
+EOF
+
+for repo in $repos
+do
+ cat << EOF >> /tmp/pacman.conf
-[core]
+[${repo}]
Server = ${serverurl}
EOF
-
+done
# Set up the necessary directories for pacman use
[ ! -d "${var_TARGET_DIR}/var/cache/pacman/pkg" ] && mkdir -m 755 -p "${var_TARGET_DIR}/var/cache/pacman/pkg"
[ ! -d "${var_TARGET_DIR}/var/lib/pacman" ] && mkdir -m 755 -p "${var_TARGET_DIR}/var/lib/pacman"