From 3a534be9934ddad3f03916d39e2d0e64128d5cf5 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 3 Jun 2013 14:41:27 +0900 Subject: [PATCH] add reflect_mirrorlist --- bashrc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bashrc b/bashrc index 428d94c..5fa705f 100755 --- a/bashrc +++ b/bashrc @@ -234,6 +234,18 @@ null type pacmatic && { export PACMAN="pacmatic" } +_pacman_update_mirrorlist_with_reflector(){ + ml=/etc/pacman.d/mirrorlist + cmd="$(expr "$(grep reflector $ml)" : '# With: *\(.*\)')" + if test -z "$cmd" + then + cmd="reflector --verbose -l 5 --sort rate --save /etc/pacman.d/mirrorlist" + fi + sudo $cmd +} +null type reflector && test -f /etc/pacman.d/mirrorlist && \ + alias reflect_mirrorlist=_pacman_update_mirrorlist_with_reflector + null type apt-get && { alias aupgrade="sudo apt-get autoremove --yes && \ sudo apt-get update --yes && sudo apt-get upgrade --yes"