diff --git a/bin/buildpkg.in b/bin/buildpkg.in index 981c4cb..9dbef3a 100644 --- a/bin/buildpkg.in +++ b/bin/buildpkg.in @@ -53,6 +53,7 @@ display_settings(){ msg2 "work_dir: ${work_dir}" msg2 "sets_dir_pkg: ${sets_dir_pkg}" msg2 "cache_dir_pkg: ${cache_dir_pkg}" + msg2 "build_mirror: ${build_mirror}/${branch}" # msg2 "pacman_conf: ${pacman_conf}" # msg2 "makepkg_conf: ${makepkg_conf}" # msg2 "mirrors_conf: ${mirrors_conf}" @@ -163,7 +164,7 @@ pacman_conf="${PKGDATADIR}/pacman-${pacman_conf_arch}.conf" makepkg_conf="${PKGDATADIR}/makepkg-${arch}.conf" mirrors_conf="${PKGDATADIR}/pacman-mirrors-${branch}.conf" -mkchroot_args+=(-L -C ${pacman_conf} -M ${makepkg_conf} -S ${mirrors_conf}) +mkchroot_args+=(-L -C ${pacman_conf} -M ${makepkg_conf} -S ${mirrors_conf} -B "${build_mirror}/${branch}") mkchrootpkg_args+=(-r ${work_dir}) diff --git a/bin/chroot-run.in b/bin/chroot-run.in index 8efe98e..986e683 100644 --- a/bin/chroot-run.in +++ b/bin/chroot-run.in @@ -30,14 +30,15 @@ usage() { echo ' -r Bind mountargs ro' echo ' -w Bind mountargs rw' echo ' List format [src1:target1,...,srcN:targetN]' - echo ' -L Use fast mirrorlist for pkgbuilding' +# echo ' -L Use fast mirrorlist for pkgbuilding' + echo ' -B Use custom build mirror' echo ' -h This message' exit 1 } orig_argv=("$@") -while getopts 'hLC:M:S:c:r:w:' arg; do +while getopts 'hBC:M:S:c:r:w:' arg; do case "$arg" in C) pac_conf="$OPTARG" ;; M) makepkg_conf="$OPTARG" ;; @@ -45,7 +46,8 @@ while getopts 'hLC:M:S:c:r:w:' arg; do c) cache_dir="$OPTARG" ;; r) mountargs_ro="$OPTARG" ;; w) mountargs_rw="$OPTARG" ;; - L) build_locales=true ;; +# L) build_locales=true ;; + B) build_mirror="$OPTARG" ;; h|?) usage ;; *) error "invalid argument '$arg'"; usage ;; esac @@ -73,14 +75,18 @@ copy_hostconf () { [[ -n $makepkg_conf ]] && cp $makepkg_conf "$1/etc/makepkg.conf" [[ -n $mirrors_conf ]] && cp ${mirrors_conf} "$1/etc/pacman-mirrors.conf" - if ${build_locales};then - local host_mirror=$(pacman -Sddp community/manjaro-tools 2>/dev/null | sed -E "s#(.*/)(.*/)community/.*#\1branch/\$repo/\$arch#") - [[ $host_mirror == *file://* ]] && host_mirror_path=$(echo "$host_mirror" | sed -r 's#file://(/.*)/\$repo/os/\$arch#\1#g') - - local branch=$(cat "$1/etc/pacman-mirrors.conf" | grep '^Branch=' | sed 's/Branch=\s*//g') - - host_mirror=$(echo "$host_mirror" | sed -E "s#/branch/#/${branch}/#") - echo "Server = $host_mirror" > "$1/etc/pacman.d/mirrorlist" +# if ${build_locales};then +# local host_mirror=$(pacman -Sddp community/manjaro-tools 2>/dev/null | sed -E "s#(.*/)(.*/)community/.*#\1branch/\$repo/\$arch#") +# [[ $host_mirror == *file://* ]] && host_mirror_path=$(echo "$host_mirror" | sed -r 's#file://(/.*)/\$repo/os/\$arch#\1#g') +# +# local branch=$(cat "$1/etc/pacman-mirrors.conf" | grep '^Branch=' | sed 's/Branch=\s*//g') +# +# host_mirror=$(echo "$host_mirror" | sed -E "s#/branch/#/${branch}/#") +# echo "Server = $host_mirror" > "$1/etc/pacman.d/mirrorlist" + if [[ -n ${build_mirror} ]];then +# source $1/etc/pacman-mirrors.conf + build_mirror=${build_mirror}'/$repo/$arch' + echo "Server = ${build_mirror}" > "$1/etc/pacman.d/mirrorlist" else source $1/etc/pacman-mirrors.conf sed -e "s|/stable|/${Branch}|g" -i "$1/etc/pacman.d/mirrorlist" diff --git a/bin/mkchroot.in b/bin/mkchroot.in index af9c70b..adc5041 100644 --- a/bin/mkchroot.in +++ b/bin/mkchroot.in @@ -25,19 +25,21 @@ usage() { echo ' -S Location of a pacman-mirrors config file' echo ' -c Set pacman cache' echo ' -L Use build locale.gen en/de' + echo ' -B Use custom build mirror' echo ' -h This message' exit 1 } orig_argv=("$@") -while getopts 'hLC:M:S:c:' arg; do +while getopts 'hLC:M:S:c:B:' arg; do case "$arg" in C) pac_conf="$OPTARG" ;; M) makepkg_conf="$OPTARG" ;; S) mirrors_conf="$OPTARG" ;; c) cache_dir="$OPTARG" ;; - L) build_locales=true; bl_args+=(-L) ;; + L) build_locales=true ;; + B) build_mirror="$OPTARG" ;; h|?) usage ;; *) error "invalid argument '$arg'"; usage ;; esac @@ -90,7 +92,7 @@ exec chroot-run \ ${pac_conf:+-C "$pac_conf"} \ ${makepkg_conf:+-M "$makepkg_conf"} \ ${mirrors_conf:+-S "$mirrors_conf"} \ + ${build_mirror:+-B "$build_mirror"} \ ${cache_dir:+-c "$cache_dir"} \ - ${bl_args[*]} \ "$working_dir" locale-gen diff --git a/conf/manjaro-tools.conf b/conf/manjaro-tools.conf index 0accd80..bdc5491 100644 --- a/conf/manjaro-tools.conf +++ b/conf/manjaro-tools.conf @@ -24,6 +24,9 @@ # default pkg buildset; name without .set extension # buildset_pkg=default +# custom build mirror server +# build_mirror=http://mirror.netzspielplatz.de/manjaro/packages + ############# eudev specific ############# # This is only useful if you compile packages against eudev diff --git a/lib/util.sh b/lib/util.sh index 177f008..5ca1063 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -213,6 +213,12 @@ load_config(){ buildset_pkg='default' fi + if [[ -n ${build_mirror} ]];then + build_mirror=${build_mirror} + else + build_mirror='http://mirror.netzspielplatz.de/manjaro/packages' + fi + if [[ -n ${blacklist_trigger[@]} ]];then blacklist_trigger=${blacklist_trigger[@]} else