diff --git a/Makefile b/Makefile index fa3beea3ce1f6885fd0fafc8950e398d8a186df6..1f6b1fbc029e3bb0017d946d43c9c1c9cfe3cee3 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,7 @@ CONFIGFILES = \ makepkg-i686.conf \ makepkg-x86_64.conf \ pacman-default.conf \ + pacman-mirrors.conf \ pacman-multilib.conf MANJAROBUILD_LINKS = \ diff --git a/mkmanjaroroot.in b/mkmanjaroroot.in index 7c66395591dc7e730536c9c01d4fc47b46983c2e..f4b0c25cb4ceb0ba2b90faffc84b4c150ce06b97 100644 --- a/mkmanjaroroot.in +++ b/mkmanjaroroot.in @@ -28,6 +28,7 @@ usage() { echo ' -u Update the chroot via pacman' echo ' -C <file> Location of a pacman config file' echo ' -M <file> Location of a makepkg config file' + echo ' -S <file> Location of a pacman-mirrors config file' echo ' -n Do not copy config files into the chroot' echo ' -c <dir> Set pacman cache' echo ' -b <branch> Set repository branch' @@ -35,7 +36,7 @@ usage() { exit 1 } -while getopts 'r:ufnhC:M:c:b:' arg; do +while getopts 'r:ufnhC:M:S:c:b:' arg; do case "${arg}" in r) RUN="$OPTARG" ;; u) RUN='pacman -Syu --noconfirm' ;; @@ -44,6 +45,7 @@ while getopts 'r:ufnhC:M:c:b:' arg; do n) NOCOPY='y' ;; c) cache_dir="$OPTARG" ;; b) branch="$OPTARG" ;; + S) mirrors_conf="$OPTARG" ;; h|?) usage ;; *) error "invalid argument '${arg}'"; usage ;; esac @@ -109,6 +111,11 @@ copy_hostconf () { cp ${makepkg_conf} ${working_dir}/etc/makepkg.conf fi + if [[ -n $mirrors_conf && $NOCOPY = 'n' ]]; then + cp ${mirrors_conf} ${working_dir}/etc/pacman-mirrors.conf + sed -i -e "s|^.*Branch=.*|Branch=${branch}|" ${working_dir}/etc/pacman-mirrors.conf + fi + sed -r "s|^#?\\s*CacheDir.+|CacheDir = $(echo -n ${cache_dirs[@]})|g" -i ${working_dir}/etc/pacman.conf } diff --git a/pacman-default.conf b/pacman-default.conf index 45fe03dc969b4804e430d9e35d0b6d5e2ab9520d..8932d824b0ac3d0fec9fba94195bd1083375bda3 100644 --- a/pacman-default.conf +++ b/pacman-default.conf @@ -69,18 +69,12 @@ LocalFileSigLevel = Optional # repo name header and Include lines. You can add preferred servers immediately # after the header, and they will be used before the default mirrors. -#[testing] -#Include = /etc/pacman.d/mirrorlist - [core] Include = /etc/pacman.d/mirrorlist [extra] Include = /etc/pacman.d/mirrorlist -#[community-testing] -#Include = /etc/pacman.d/mirrorlist - [community] Include = /etc/pacman.d/mirrorlist diff --git a/pacman-mirrors.conf b/pacman-mirrors.conf new file mode 100644 index 0000000000000000000000000000000000000000..86a5545b9b2268a3081f9d8724dad908ca03b7d0 --- /dev/null +++ b/pacman-mirrors.conf @@ -0,0 +1,21 @@ +## +## /etc/pacman-mirrors.conf +## + +## Branch Pacman should use (stable, testing, unstable) +Branch=stable + +## Generation method +## 1) rank - rank mirrors depending on their access time +## 2) random - randomly generate the output mirrorlist +Method=rank + +## Specify to use only mirrors from a specific country +## Disabled by default +# OnlyCountry=Germany + +## Input mirrorlist directory +MirrorlistsDir="/etc/pacman.d/mirrors" + +## Output mirrorlist +OutputMirrorlist="/etc/pacman.d/mirrorlist" diff --git a/pacman-multilib.conf b/pacman-multilib.conf index a6511e0ac0f9222bf7197876eb1aaa57dd5cfa2d..167adc44101efbd3aa2441d5eb1d286aad5fa947 100644 --- a/pacman-multilib.conf +++ b/pacman-multilib.conf @@ -69,27 +69,18 @@ LocalFileSigLevel = Optional # repo name header and Include lines. You can add preferred servers immediately # after the header, and they will be used before the default mirrors. -#[testing] -#Include = /etc/pacman.d/mirrorlist - [core] Include = /etc/pacman.d/mirrorlist [extra] Include = /etc/pacman.d/mirrorlist -#[community-testing] -#Include = /etc/pacman.d/mirrorlist - [community] Include = /etc/pacman.d/mirrorlist # If you want to run 32 bit applications on your x86_64 system, # enable the multilib repositories as required here. -#[multilib-testing] -#Include = /etc/pacman.d/mirrorlist - [multilib] Include = /etc/pacman.d/mirrorlist