mirror of
https://github.com/endeavouros-team/eos-bash-shared.git
synced 2026-06-13 01:34:36 +00:00
[eos-bash-shared] small performance improvement
This commit is contained in:
@@ -50,7 +50,7 @@ yad_ChangeDisplayResolution() {
|
||||
local b_refresh=10 # button "Set and stay" clicked
|
||||
local b_exit=252 # (X) clicked in the upper right corner
|
||||
|
||||
readarray -t resosarr <<< $(echo "$resos")
|
||||
readarray -t resosarr < <(echo "$resos")
|
||||
|
||||
if [ -n "$reso" ] ; then
|
||||
if [ -n "$(echo "$resos" | grep "$reso")" ] ; then
|
||||
|
||||
+2
-2
@@ -64,10 +64,10 @@ CheckYourArchMirrorlist() {
|
||||
# get working mirrors from the Arch mirrorlist page
|
||||
all_working_mirrors=$(curl --fail -Lsm 30 "$url") || DIE "failed to fetch available mirrors (curl code $?)"
|
||||
[ "$all_working_mirrors" ] || DIE "-> archlinux.org/mirrorlist failed"
|
||||
readarray -t all_working_mirrors <<< $(echo "$all_working_mirrors" | tail -n +7 | grep "^#Server = " | awk '{print $NF}')
|
||||
readarray -t all_working_mirrors < <(echo "$all_working_mirrors" | tail -n +7 | grep "^#Server = " | awk '{print $NF}')
|
||||
|
||||
# get mirrors from local mirrorlist
|
||||
readarray -t local_mirrors <<< $(grep -n "^[ \t]*Server[ \t]*=[ \t]*" $aml | sed 's|[ \t]*Server[ \t]*=[ \t]*||')
|
||||
readarray -t local_mirrors < <(grep -n "^[ \t]*Server[ \t]*=[ \t]*" $aml | sed 's|[ \t]*Server[ \t]*=[ \t]*||')
|
||||
|
||||
for lm in "${local_mirrors[@]}" ; do
|
||||
if printf "%s\n" "${all_working_mirrors[@]}" | grep "${lm#*:}" >/dev/null ; then
|
||||
|
||||
@@ -114,7 +114,7 @@ Main() {
|
||||
CheckValueYesNo "$separator" "--separator"
|
||||
|
||||
if [ ${#pkgnames} -eq 0 ] ; then
|
||||
readarray -t pkgnames <<< $(AsPlainUserIfElevated $helper -Quq) # assumes 'pacman -Sy' was just executed
|
||||
readarray -t pkgnames < <(AsPlainUserIfElevated $helper -Quq) # assumes 'pacman -Sy' was just executed
|
||||
[ ${#pkgnames} -eq 0 ] && return
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user