From 257fa362aec29f1f9151d8800c6b74ede2ccfa63 Mon Sep 17 00:00:00 2001 From: whoisYoges Date: Sun, 17 Jul 2022 18:30:13 +0545 Subject: [PATCH] Added rankmirrors as package, updated live os release name and more --- base/Packages-Root | 1 + base/root-overlay/etc/lsb-release | 3 + base/root-overlay/usr/local/bin/rankmirrors | 242 -------------------- base/root-overlay/usr/local/config/issue | 1 + 4 files changed, 5 insertions(+), 242 deletions(-) create mode 100644 base/root-overlay/etc/lsb-release delete mode 100755 base/root-overlay/usr/local/bin/rankmirrors create mode 100644 base/root-overlay/usr/local/config/issue diff --git a/base/Packages-Root b/base/Packages-Root index c14541f..2f08b71 100644 --- a/base/Packages-Root +++ b/base/Packages-Root @@ -9,4 +9,5 @@ e2fsprogs xfsprogs f2fs-tools metis-sideload +rankmirrors artix-live-@initsys@ \ No newline at end of file diff --git a/base/root-overlay/etc/lsb-release b/base/root-overlay/etc/lsb-release new file mode 100644 index 0000000..0abd5cb --- /dev/null +++ b/base/root-overlay/etc/lsb-release @@ -0,0 +1,3 @@ +DISTRIB_ID="Metis" +DISTRIB_RELEASE="rolling" +DISTRIB_DESCRIPTION="Metis Linux" \ No newline at end of file diff --git a/base/root-overlay/usr/local/bin/rankmirrors b/base/root-overlay/usr/local/bin/rankmirrors deleted file mode 100755 index 0ac9f08..0000000 --- a/base/root-overlay/usr/local/bin/rankmirrors +++ /dev/null @@ -1,242 +0,0 @@ -#!/bin/bash -# -# rankmirrors - read a list of mirrors from a file and rank them by speed -# Generated from rankmirrors.sh.in; do not edit by hand. -# -# Copyright (c) 2009 Matthew Bruenig -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# traps interrupt key to spit out pre-interrupt info -trap finaloutput INT - -declare -r myname='rankmirrors' -declare -r myver='1.5.3' - -usage() { - echo "${myname} v${myver}" - echo - echo "Ranks pacman mirrors by their connection and opening speed. Pacman mirror" - echo "files are located in /etc/pacman.d/. It can also rank one mirror if the URL is" - echo "provided." - echo - echo "Usage: ${myname} [options] MIRRORFILE | URL" - echo - echo "Options:" - echo " --version show program's version number and exit" - echo " -h, --help show this help message and exit" - echo " -n NUM number of servers to output, 0 for all" - echo " -m, --max-time NUM specify a ranking operation timeout, can be decimal number" - echo " -t, --times only output mirrors and their response times" - echo " -u, --url test a specific URL" - echo " -v, --verbose be verbose in output" - echo " -r, --repo specify a repository name instead of guessing" - exit 0 -} - -version() { - echo "${myname} (pacman) ${myver}" - echo "Copyright (c) 2009 Matthew Bruenig ." - echo - echo "This is free software; see the source for copying conditions." - echo "There is NO WARRANTY, to the extent permitted by law." - exit 0 -} - -err() { - echo "$1" >&2 - exit 1 -} - -# gettime fetchurl (e.g gettime http://foo.com/system/os/i686/system.db.tar.gz) -# returns the fetching time, or timeout, or unreachable -gettime() { - IFS=' ' output=( $(curl -s -m $MAX_TIME -w "%{time_total} %{http_code}" "$1" -o/dev/null) ) - (( $? == 28 )) && echo timeout && return - (( ${output[1]} >= 400 || ! ${output[1]} )) && echo unreachable && return - echo "${output[0]}" -} - -# getfetchurl serverurl (e.g. getturl http://foo.com/system/os/i686) -# if $repo is in the line, then assumes system -# if $arch is in the line, then assumes $(uname -m) -# returns a fetchurl (e.g. http://foo.com/system/os/i686/system.db.tar.gz) -ARCH="$(uname -m)" -getfetchurl() { - local strippedurl="${1%/}" - - local replacedurl="${strippedurl//'$arch'/$ARCH}" - if [[ ! $TARGETREPO ]]; then - replacedurl="${replacedurl//'$repo'/system}" - local tmp="${replacedurl%/*}" - tmp="${tmp%/*}" - - local reponame="${tmp##*/}" - else - replacedurl="${replacedurl//'$repo'/$TARGETREPO}" - local reponame="$TARGETREPO" - fi - - if [[ -z $reponame || $reponame = $replacedurl ]]; then - echo "fail" - else - local fetchurl="${replacedurl}/$reponame.db" - echo "$fetchurl" - fi -} - -# This exists to remove the need for a separate interrupt function -finaloutput() { - IFS=$'\n' read -r -d '' -a sortedarray < \ - <(printf '%s\n' "${timesarray[@]}" | LC_COLLATE=C sort) - - # Final output for mirrorfile - numiterator="0" - if [[ $TIMESONLY ]]; then - echo - echo " Servers sorted by time (seconds):" - for line in "${sortedarray[@]}"; do - echo "${line#* } : ${line% *}" - ((numiterator++)) - (( NUM && numiterator >= NUM )) && break - done - else - for line in "${sortedarray[@]}"; do - echo "Server = ${line#* }" - ((numiterator++)) - (( NUM && numiterator >= NUM )) && break - done - fi - exit 0 -} - - -# Argument parsing -[[ $1 ]] || usage -while [[ $1 ]]; do - if [[ ${1:0:2} = -- ]]; then - case "${1:2}" in - help) usage ;; - version) version ;; - max-time) - [[ $2 ]] || err "Must specify number."; - MAX_TIME="$2" - shift 2;; - times) TIMESONLY=1 ; shift ;; - verbose) VERBOSE=1 ; shift ;; - url) - CHECKURL=1; - [[ $2 ]] || err "Must specify URL."; - URL="$2"; - shift 2;; - repo) - [[ $2 ]] || err "Must specify repository name."; - TARGETREPO="$2"; - shift 2;; - *) err "'$1' is an invalid argument." - esac - elif [[ ${1:0:1} = - ]]; then - - if [[ ! ${1:1:1} ]]; then - [[ -t 0 ]] && err "Stdin is empty." - IFS=$'\n' linearray=( $(