From 477e3f76f0a9afe8bc6077ab02baa0471588594e Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Tue, 4 Nov 2008 14:10:01 +0100 Subject: allow passing of which repos we want as argument --- src/core/libs/lib-pacman.sh | 13 ++++++++++--- 1 file 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" -- cgit v1.2.3-54-g00ecf