Skip to content

Commit

Permalink
[eos-rankmirrors] fixed the missing parts in the output of option '--…
Browse files Browse the repository at this point in the history
…help'
  • Loading branch information
manuel-192 committed Jan 16, 2025
1 parent b46a5aa commit 8e54f38
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
4 changes: 2 additions & 2 deletions eos-rankmirrors/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maintainer: EndeavourOS <[email protected]>

pkgname=eos-rankmirrors
pkgver=24.9.2
pkgver=25
pkgrel=1
pkgdesc="EndeavourOS mirror ranking tool"
arch=('any')
Expand All @@ -22,7 +22,7 @@ source=(
$url/${pkgname}.conf
$url/${pkgname}.disabled
)
sha512sums=('c6de535c92e3b74f957065fc9d2c386fb03c54800d0821231c67132ffca035d10c0456ac70da2357b0ca4ad1f21d5fad0fdef9dda50352a3583e30fdfdc8a41c'
sha512sums=('2f73f9f1b0057fbf2356c02926921fc81d15e5b3d0956171e9f99101462c952e57a5e01f922c2af7afb594443e21e4fde6b30617b7e41f4447f9eadab5fecdd6'
'e945c073d46abf35d9cf9042c7906bf9a1bad73760e0f06fb42c59227cf0ef1e3ea9ceeb9dc3b2185b0a37711e7b698dd28565be62e21a7bddb5f3b4a2daeee4'
'fc3113a20559ec58ffff2cacae8069ce5c83ad826f0054488315d024cb874a92ae9240fe4630bd9da647ee2cbf0e93dd22259190c703f26d21bf0b8481686a4c'
'f01f6267f624992febfec29c76f2de1c503693086ade5783e2b9cbef359f5155bf6df520ff06299193c842aef2a05cac5078977ee0dabf55cff66f44aec6e44a'
Expand Down
39 changes: 20 additions & 19 deletions eos-rankmirrors/eos-rankmirrors
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ SortMirrors() {
RankPerAge() {
# latest_ml : in # servers not commented!
# result : out
local repo=endeavouros
local arch=$(eos_GetArch)
local mirror m m2
local marr
local sortopts=""
Expand Down Expand Up @@ -262,8 +260,7 @@ FetchLatestMirrorlist() {

if [ "$use_local_mirrorlist" = "yes" ] ; then
# Use file /etc/pacman.d/endeavouros-mirrorlist. Remove potential ranking results first.
sed -e '/^# Results of mirror ranking at /,$d' -e 's|^#[ ]*Server = |Server = |' \
/etc/pacman.d/endeavouros-mirrorlist > $latest_ml
sed -e '/^# Results of mirror ranking at /,$d' -e 's|^#[ ]*Server = |Server = |' $emlpath > $latest_ml
CheckMirrorlist "$latest_ml"
return
fi
Expand Down Expand Up @@ -512,13 +509,13 @@ DumpOptions() {

Usage() {
cat <<EOF
$progname is meant for creating a new file that can be used as file
/etc/pacman.d/endavouros-mirrorlist
after ranking the mirrors.
Purpose: $progname is meant for creating a new file that can be used as file
$emlpath
after ranking the mirrors.
Note 1: The Arch mirrorlist file /etc/pacman.d/mirrorlist will not be updated with this app.
Note 2: This app potentially creates file /etc/pacman.d/endavouros-mirrorlist.pacnew which needs to merged.
Note 3: File $conf can contain many more settings and options, explained in the file.
Note 1: The Arch mirrorlist file /etc/pacman.d/mirrorlist will not be updated with this app.
Note 2: This app potentially creates file $emlpath.pacnew which needs to merged.
Note 3: File $conf can contain many more settings and options, explained in the file.
Usage: $progname [options]
Expand Down Expand Up @@ -558,12 +555,12 @@ Options:
eos-rankmirrors --prefer='https://endeavour.remi.lu/repo/$repo/$arch'
--show-orig-list
Add the original mirror list into /etc/pacman.d/endeavouros-mirrorlist.
Add the original mirror list into $emlpath.
Supported values: "yes" or "no".
Default: $show_original_list_default.
--show-rank-info
Show the ranking data in /etc/pacman.d/endeavouros-mirrorlist.
Show the ranking data in $emlpath.
Supported values: "yes" or "no".
Default: $show_ranking_info_default.
Expand Down Expand Up @@ -660,11 +657,22 @@ Main()

local -r progname=${0##*/} # eos-rankmirrors

source /usr/share/endeavouros/scripts/eos-script-lib-yad --limit-icons || return 1
export -f eos_GetArch

local -r sort_default=age # age or rate
local -r timeout_default=30 # in seconds
local -r show_original_list_default=no # yes or no
local -r show_ranking_info_default=yes # yes or no

local -r pkgname=endeavouros-mirrorlist
local -r mlfolder=/etc/pacman.d
local eos=$mlfolder/$pkgname
local -r repo=endeavouros
local -r arch=$(eos_GetArch)
local -r conf=/etc/$progname.conf
local -r emlpath=/etc/pacman.d/endeavouros-mirrorlist

# Don't do anything time consuming before dumping options.
local arg
for arg in "$@" ; do
Expand All @@ -675,8 +683,6 @@ Main()
esac
done

local -r pkgname=endeavouros-mirrorlist
local -r mlfolder=/etc/pacman.d
local -r rank_signature="ranked by $progname" # enables checking $rank_signature

local -r RED=$'\e[0;91m' # starts this foreground text color
Expand All @@ -688,7 +694,6 @@ Main()

local CMD_OPTIONS=()

local eos=$mlfolder/$pkgname
local new=""
local latest_ml=""
local delete_at_end=()
Expand All @@ -714,10 +719,6 @@ Main()
DIE "no local $eos found, please install package '$pkgname'."
fi

source /usr/share/endeavouros/scripts/eos-script-lib-yad --limit-icons || return 1
export -f eos_GetArch

local -r conf=/etc/$progname.conf
source $conf || DIE "Config file $conf does not exist!"
ALWAYS_FIRST_EOS_MIRRORS=${ALWAYS_FIRST_EOS_MIRRORS//[,|]/ }

Expand Down

0 comments on commit 8e54f38

Please sign in to comment.