mirror of
https://github.com/endeavouros-team/PKGBUILDS.git
synced 2026-07-29 05:35:23 +00:00
[fetch-iso] little layout fixes
This commit is contained in:
+3
-3
@@ -7,7 +7,7 @@
|
||||
pkgname=fetch-iso
|
||||
pkgdesc="A special helper tool for the EndeavourOS ISO testers"
|
||||
url="https://github.com/endeavouros-team/PKGBUILDS/raw/master/$pkgname"
|
||||
pkgver=26.7
|
||||
pkgver=26.7.1
|
||||
pkgrel=1
|
||||
|
||||
arch=('any')
|
||||
@@ -23,10 +23,10 @@ source=(
|
||||
"$url/$pkgname.completion"
|
||||
"$url/$pkgname-show-all-info"
|
||||
)
|
||||
sha512sums=('2213918a83e58118967d70119b29d3df2f92f8a20a6ac297833655a80a392973ca9f57ef4b12d3d13b082da2cc97c1a2a034795d1d806c34614876fe5dbdf1b5'
|
||||
sha512sums=('dcbe66aa55318497ad1bb8dea0057d423b74071fd073fb65cca3f25cc442781d2efcc424bc6707c74633cf77316e1eaff14eed1996181a38b3c745896926da6e'
|
||||
'5b2897dc51353b33446ddefdae6d312b36da825ac505418aea535eacaeef568b1f024db171668878ed499e532bc0dc654d35633a8a9fe6c77e25b43e7288cfca'
|
||||
'd99fa711c27f4101dbe982ad69b383fe4dc4ebcb96c838155e0750d34f72a37d9586adf095963b13aa265a3cec3d211000e999da8ac1abd3076128b66d0776d6'
|
||||
'0aaa060a26f5d5e227cbfff5b4d8653467bb1eea8c5a30c3d889f301c6d7160ef88701ebc66d40d9ad72ab562ddd761c77b7c097f42806dbc935f355d372f95e')
|
||||
'5349b129f5adc6a8b362910e1a61fa019b1f396b20717873d95da1e1b6a466af61791f001f2b66984aac8d4ba55b8cd2395e03e3457609b0ce06b6aeec726685')
|
||||
# backup=(etc/skel/$pkgname.conf)
|
||||
|
||||
package() {
|
||||
|
||||
+3
-3
@@ -100,7 +100,7 @@ AskConfigValues() {
|
||||
AskValue "Remote base dir URL" URLBASE ""
|
||||
AskValue "Remote account" ACCOUNT ""
|
||||
AskValue "Remote password" PASSWORD ""
|
||||
AskValue "Local download folder$dl" TARGETDIR "$dldir"
|
||||
AskValue "Local download folder$dl" TARGETDIR "${dldir/$HOME/\~}"
|
||||
AskValue "Downloader app (wget)" APP "wget"
|
||||
|
||||
printf "%s\n" "${values[@]}" > "$configfile"
|
||||
@@ -164,7 +164,7 @@ Options() {
|
||||
case "$1" in
|
||||
"") ;;
|
||||
*.iso.tar.gz | *.iso | *.iso.${sumtype}*)
|
||||
echo2 "Download folder: $TARGETDIR"
|
||||
echo2 "Download folder: ${TARGETDIR/$HOME/\~}"
|
||||
FetchIsoFile "$1"
|
||||
exit
|
||||
;;
|
||||
@@ -252,7 +252,7 @@ Main() {
|
||||
"Other keys: Ctrl-E = Edit config file"
|
||||
" Ctrl-H = Help"
|
||||
"Config file: $configfile2"
|
||||
"Download folder: $TARGETDIR"
|
||||
"Download folder: ${TARGETDIR/$HOME/\~}"
|
||||
"Fetching app: $getter"
|
||||
"Tip: Names with trailing '/' are folders, navigate to them if needed."
|
||||
)
|
||||
|
||||
@@ -48,25 +48,51 @@ Main() {
|
||||
echo "$data" > /tmp/foo
|
||||
|
||||
# directories
|
||||
local dirs=() tmp=() tmp2
|
||||
|
||||
echo "/ (site's root dir)"
|
||||
local dirs=() tmp=()
|
||||
readarray -t tmp < <(echo "$data" | grep 'alt="\[DIR\]"' | sed -E -e "s|.*\"indexcolname\"><a href=\"([^\"]+)\".*\"indexcollastmod\">([^<]+)<.*|\1$sep\2|g" -e 's|[ ]*$||' | grep -Pv "^\.|^archive/")
|
||||
tmp2="$(echo "$data" | grep 'alt="\[DIR\]"')"
|
||||
|
||||
# extract "name" and "last-modification-time":
|
||||
tmp2="$(echo "$tmp2" | sed -E -e "s|.*\"indexcolname\"><a href=\"([^\"]+)\".*\"indexcollastmod\">([^<]+)<.*|\1$sep\2|g" -e 's|[ ]*$||')"
|
||||
|
||||
# remove file/dir names:
|
||||
# 1) starting with dot (".")
|
||||
# 2) "archive/"
|
||||
tmp2="$(echo "$tmp2" | grep -Pv "^\.|^archive/")"
|
||||
|
||||
readarray -t tmp < <(echo "$tmp2")
|
||||
|
||||
[ "${tmp[0]}" ] && dirs+=("${tmp[@]}")
|
||||
count=${#dirs[@]}
|
||||
for ((ix=0; ix<count; ix++)) ; do
|
||||
echo "${dirs[$ix]}" # >&2 # TODO: out to stdin
|
||||
done | Sorter
|
||||
if [ "$count" -gt 0 ] ; then
|
||||
for ((ix=0; ix<count; ix++)) ; do
|
||||
echo "${dirs[$ix]}"
|
||||
done | PrettyPrint # output info about directories
|
||||
fi
|
||||
|
||||
# files
|
||||
readarray -t files < <(echo "$data" | grep 'alt="\[ \]"' | sed -E -e 's|.*"indexcolname"><a href="([^"]+)".*|\1|g')
|
||||
readarray -t dates < <(echo "$data" | grep 'alt="\[ \]"' | sed -E -e 's|.*"indexcollastmod">[ ]*([^<]+)<.*|\1|g' -e 's|[ ]*$||')
|
||||
readarray -t sizes < <(echo "$data" | grep 'alt="\[ \]"' | sed -E -e 's|.*"indexcolsize">[ ]*([^<]+)<.*|\1|g' -e 's|[ ]*$||')
|
||||
local unit sz
|
||||
data="$(echo "$data" | grep 'alt="\[ \]"')"
|
||||
readarray -t files < <(echo "$data" | sed -E -e 's|.*"indexcolname"><a href="([^"]+)".*|\1|g')
|
||||
readarray -t dates < <(echo "$data" | sed -E -e 's|.*"indexcollastmod">[ ]*([^<]+)<.*|\1|g' -e 's|[ ]*$||')
|
||||
readarray -t sizes < <(echo "$data" | sed -E -e 's|.*"indexcolsize">[ ]*([^<]+)<.*|\1|g' -e 's|[ ]*$||')
|
||||
count=${#files[@]}
|
||||
for ((ix=0; ix<count; ix++)) ; do
|
||||
echo "${files[$ix]}$sep${dates[$ix]}$sep${sizes[$ix]}"
|
||||
done | Sorter
|
||||
if [ "$count" -gt 0 ] ; then
|
||||
for ((ix=0; ix<count; ix++)) ; do
|
||||
sz="${sizes[$ix]}"
|
||||
unit="${sz: -1}"
|
||||
if true ; then
|
||||
case "$unit" in
|
||||
G | M | K) sz="${sz:: -1} ${unit}B" ;;
|
||||
[0-9]) sz+=" B" ;;
|
||||
esac
|
||||
fi
|
||||
echo "${files[$ix]}$sep${dates[$ix]}$sep$sz"
|
||||
done | PrettyPrint # output info about files
|
||||
fi
|
||||
}
|
||||
|
||||
Sorter() { column -t -s"$sep" | sort -k2 -k3 ; }
|
||||
PrettyPrint() { column -t -s"$sep" | sort -k2 -k3 ; }
|
||||
|
||||
Main "$@"
|
||||
|
||||
Reference in New Issue
Block a user