From b058db7f1147d9a8c1390da84794cfa8b3711f13 Mon Sep 17 00:00:00 2001 From: zen0bit Date: Mon, 29 Apr 2024 12:03:59 +0200 Subject: [PATCH 01/17] Leave dashes from os_info (except short info) --- quickget | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/quickget b/quickget index 8217c3b..38d6207 100755 --- a/quickget +++ b/quickget @@ -40,7 +40,7 @@ function os_info() { SIMPLE_NAME="${1}" case ${SIMPLE_NAME} in #name) INFO="PrettyName|BasedOf|Credentials|Homepage|Info";; - alma) INFO="Alma Linux|Fedora,RedHat|-|https://almalinux.org/|Community owned and governed, forever-free enterprise Linux distribution, focused on long-term stability, providing a robust production-grade platform. AlmaLinux OS is binary compatible with RHEL®.";; + alma) INFO="Alma Linux|Fedora RedHat|-|https://almalinux.org/|Community owned and governed, forever-free enterprise Linux distribution, focused on long-term stability, providing a robust production-grade platform. AlmaLinux OS is binary compatible with RHEL®.";; alpine) INFO="Alpine Linux|Independent|-|https://alpinelinux.org/|Security-oriented, lightweight Linux distribution based on musl libc and busybox.";; android) INFO="Android x86|Independent|-|https://www.android-x86.org/|Port Android Open Source Project to x86 platform.";; antix) INFO="Antix|Debian|-|https://antixlinux.com/|Fast, lightweight and easy to install systemd-free linux live CD distribution based on Debian Stable for Intel-AMD x86 compatible systems.";; @@ -50,13 +50,13 @@ function os_info() { artixlinux) INFO="Artix Linux|Arch|-|https://artixlinux.org/|The Art of Linux. Simple. Fast. Systemd-free.";; athenaos) INFO="Athena OS|Arch|-|https://athenaos.org/|Offer a different experience than the most used pentesting distributions by providing only tools that fit with the user needs and improving the access to hacking resources and learning materials.";; batocera) INFO="Batocera|Independent|-|https://batocera.org/|Retro-gaming distribution with the aim of turning any computer/nano computer into a gaming console during a game or permanently.";; - bazzite) INFO="Bazzite|Fedora,SteamOS|-|https://github.com/ublue-os/bazzite/|Container native gaming and a ready-to-game SteamOS like.";; + bazzite) INFO="Bazzite|Fedora SteamOS|-|https://github.com/ublue-os/bazzite/|Container native gaming and a ready-to-game SteamOS like.";; biglinux) INFO="BigLinux|unknown|-|https://www.biglinux.com.br/|Is the right choice if you want to have an easy and enriching experience with Linux. It has been perfected over more than 19 years, following our motto: 'In search of the perfect system'.";; blendos) INFO="BlendOS|Arch|-|https://blendos.co/|A seamless blend of all Linux distributions. Allows you to have an immutable, atomic and declarative Arch Linux system, with application support from several Linux distributions & Android.";; - bodhi) INFO="Bodhi|Debian,Ubuntu|-|https://www.bodhilinux.com/|Lightweight distribution featuring the fast & fully customizable Moksha Desktop.";; + bodhi) INFO="Bodhi|Debian Ubuntu|-|https://www.bodhilinux.com/|Lightweight distribution featuring the fast & fully customizable Moksha Desktop.";; bunsenlabs) INFO="BunsenLabs|Debian|-|https://www.bunsenlabs.org/|Light-weight and easily customizable Openbox desktop. The project is a community continuation of CrunchBang Linux.";; cachyos) INFO="CachyOS|Arch|-|https://cachyos.org/|Designed to deliver lightning-fast speeds and stability, ensuring a smooth and enjoyable computing experience every time you use it.";; - centos-stream) INFO="CentOS Stream|Fedora,RedHat|-|https://www.centos.org/centos-stream/|Continuously delivered distro that tracks just ahead of Red Hat Enterprise Linux (RHEL) development, positioned as a midstream between Fedora Linux and RHEL.";; + centos-stream) INFO="CentOS Stream|Fedora RedHat|-|https://www.centos.org/centos-stream/|Continuously delivered distro that tracks just ahead of Red Hat Enterprise Linux (RHEL) development, positioned as a midstream between Fedora Linux and RHEL.";; chimeralinux) INFO="Chimera Linux|Independent|anon:chimera root:chimera|https://chimera-linux.org/|Modern, general-purpose non-GNU Linux distribution.";; crunchbang++) INFO="#!++|Debian|-|https://www.crunchbangplusplus.org/|The classic minimal crunchbang feel, now with debian 12 bookworm.";; debian) INFO="Debian|Independent|-|https://www.debian.org/|Complete Free Operating System with perfect level of ease of use and stability.";; @@ -65,7 +65,7 @@ function os_info() { dragonflybsd) INFO="DragonFlyBSD|FreeBSD|-|https://www.dragonflybsd.org/|Provides an opportunity for the BSD base to grow in an entirely different direction from the one taken in the FreeBSD, NetBSD, and OpenBSD series.";; easyos) INFO="EasyOS|Independent|-|https://easyos.org/|Experimental distribution designed from scratch to support containers.";; edubuntu) INFO="Edubuntu|Ubuntu|-|https://www.edubuntu.org/|Stable, secure and privacy concious option for schools.";; - elementary) INFO="elementary OS|Debian,Ubuntu|-|https://elementary.io/|Thoughtful, capable, and ethical replacement for Windows and macOS.";; + elementary) INFO="elementary OS|Debian Ubuntu|-|https://elementary.io/|Thoughtful, capable, and ethical replacement for Windows and macOS.";; endeavouros) INFO="EndeavourOS|Arch|-|https://endeavouros.com/|Provides an Arch experience without the hassle of installing it manually for both x86_64 and ARM systems.";; endless) INFO="Endless OS|Debian|-|https://www.endlessos.org/os|Completely Free, User-Friendly Operating System Packed with Educational Tools, Games, and More.";; fedora) INFO="Fedora|Independent|-|https://www.fedoraproject.org/|Innovative platform for hardware, clouds, and containers, built with love by you.";; @@ -77,18 +77,18 @@ function os_info() { gnomeos) INFO="GNOME OS|Independent|-|https://os.gnome.org/|Alpha nightly bleeding edge distro of GNOME";; guix) INFO="Guix|Independent|-|https://guix.gnu.org/|Distribution of the GNU operating system developed by the GNU Project—which respects the freedom of computer users.";; haiku) INFO="Haiku|Independent|-|https://www.haiku-os.org/|Specifically targets personal computing. Inspired by the BeOS, Haiku is fast, simple to use, easy to learn and yet very powerful.";; - holoiso) INFO="SteamOS HoloISO|Arch,SteamOS|-|https://github.com/HoloISO/holoiso|Bring the Steam Decks SteamOS Holo redistribution and provide a close-to-official SteamOS experience.";; + holoiso) INFO="SteamOS HoloISO|Arch SteamOS|-|https://github.com/HoloISO/holoiso|Bring the Steam Decks SteamOS Holo redistribution and provide a close-to-official SteamOS experience.";; kali) INFO="Kali|Debian|-|https://www.kali.org/|The most advanced Penetration Testing Distribution.";; - kdeneon) INFO="KDE Neon|Debian,Ubuntu|-|https://neon.kde.org/|Latest and greatest of KDE community software packaged on a rock-solid base.";; + kdeneon) INFO="KDE Neon|Debian Ubuntu|-|https://neon.kde.org/|Latest and greatest of KDE community software packaged on a rock-solid base.";; kolibrios) INFO="KolibriOS|Independent|-|http://kolibrios.org/en/|Tiny yet incredibly powerful and fast operating system.";; kubuntu) INFO="Kubuntu|Ubuntu|-|https://kubuntu.org/|Free, complete, and open-source alternative to Microsoft Windows and Mac OS X which contains everything you need to work, play, or share.";; - linuxlite) INFO="Linux Lite|Debian,Ubuntu|-|https://www.linuxliteos.com/|Your first simple, fast and free stop in the world of Linux.";; - linuxmint) INFO="Linux Mint|Debian,Ubuntu|-|https://linuxmint.com/|Designed to work out of the box and comes fully equipped with the apps most people need.";; + linuxlite) INFO="Linux Lite|Debian Ubuntu|-|https://www.linuxliteos.com/|Your first simple, fast and free stop in the world of Linux.";; + linuxmint) INFO="Linux Mint|Debian Ubuntu|-|https://linuxmint.com/|Designed to work out of the box and comes fully equipped with the apps most people need.";; lmde) INFO="Linux Mint Debian Edition|Debian|-|https://www.linuxmint.com/download_lmde.php|Aims to be as similar as possible to Linux Mint, but without using Ubuntu. The package base is provided by Debian instead.";; lubuntu) INFO="Lubuntu|Ubuntu|-|https://lubuntu.me/|Complete Operating System that ships the essential apps and services for daily use: office applications, PDF reader, image editor, music and video players, etc. Using lightwave lxde/lxqt.";; mageia) INFO="Mageia|Independent|-|https://www.mageia.org/|Stable, secure operating system for desktop & server.";; manjaro) INFO="Manjaro|Arch|-|https://manjaro.org/|Versatile, free, and open-source Linux operating system designed with a strong focus on safeguarding user privacy and offering extensive control over hardware.";; - mxlinux) INFO="MX Linux|Debian,Antix|-|https://mxlinux.org/|Designed to combine elegant and efficient desktops with high stability and solid performance.";; + mxlinux) INFO="MX Linux|Debian Antix|-|https://mxlinux.org/|Designed to combine elegant and efficient desktops with high stability and solid performance.";; netboot) INFO="netboot.xyz|iPXE|-|https://netboot.xyz/|Your favorite operating systems in one place.";; netbsd) INFO="NetBSD|Independent|-|https://www.netbsd.org/|Free, fast, secure, and highly portable Unix-like Open Source operating system. It is available for a wide range of platforms, from large-scale servers and powerful desktop systems to handheld and embedded devices.";; nitrux) INFO="Nitrux|Debian|-|https://nxos.org/|Powered by Debian, KDE Plasma and Frameworks, and AppImages.";; @@ -96,11 +96,11 @@ function os_info() { nwg-shell) INFO="nwg-shell|Arch|nwg:nwg|https://nwg-piotr.github.io/nwg-shell/|Arch Linux ISO with nwg-shell for sway and Hyprland";; macos) INFO="macOS|proprietary|-|https://www.apple.com/macos/|Work and play on your Mac are even more powerful. Elevate your presence on video calls. Access information in all-new ways. Boost gaming performance. And discover even more ways to personalize your Mac.";; openbsd) INFO="OpenBSD|Independent|-|https://www.openbsd.org/|FREE, multi-platform 4.4BSD-based UNIX-like operating system. Our efforts emphasize portability, standardization, correctness, proactive security and integrated cryptography.";; - openindiana) INFO="OpenIndiana|Solaris,OpenSolaris|-|https://www.openindiana.org/|Community supported illumos-based operating system.";; + openindiana) INFO="OpenIndiana|Solaris OpenSolaris|-|https://www.openindiana.org/|Community supported illumos-based operating system.";; opensuse) INFO="openSUSE|Independent|-|https://www.opensuse.org/|The makers choice for sysadmins, developers and desktop users.";; oraclelinux) INFO="Oracle Linux|RedHat|-|https://www.oracle.com/linux/|Linux with everything required to deploy, optimize, and manage applications on-premises, in the cloud, and at the edge.";; parrotsec) INFO="Parrot Security|Debian|parrot:parrot|https://www.parrotsec.org/|Provides a huge arsenal of tools, utilities and libraries that IT and security professionals can use to test and assess the security of their assets in a reliable, compliant and reproducible way.";; - peppermint) INFO="PeppermintOS|Debian,Devuan|-|https://peppermintos.com/|Provides a user with the opportunity to build the system that best fits their needs. While at the same time providing a functioning OS with minimum hassle out of the box.";; + peppermint) INFO="PeppermintOS|Debian Devuan|-|https://peppermintos.com/|Provides a user with the opportunity to build the system that best fits their needs. While at the same time providing a functioning OS with minimum hassle out of the box.";; popos) INFO="Pop!_OS|Ubuntu|-|https://pop.system76.com/|Operating system for STEM and creative professionals who use their computer as a tool to discover and create.";; porteus) INFO="Porteus|Slackware|-|http://www.porteus.org/|Complete linux operating system that is optimized to run from CD, USB flash drive, hard drive, or other bootable storage media.";; primtux) INFO="PrimTux|Ubuntu|-|https://primtux.fr/|A complete and customizable GNU/Linux operating system intended for primary school students and suitable even for older hardware.";; @@ -118,10 +118,10 @@ function os_info() { spirallinux) INFO="SpiralLinux|Debian|-|https://spirallinux.github.io/|Selection of Linux spins built from Debian GNU/Linux, with a focus on simplicity and out-of-the-box usability across all the major desktop environments.";; tails) INFO="Tails|Debian|-|https://tails.net/|Portable operating system that protects against surveillance and censorship.";; tinycore) INFO="Tiny Core Linux|Independent|-|http://www.tinycorelinux.net/|Highly modular based system with community build extensions.";; - trisquel) INFO="Trisquel|Debian,Ubuntu|-|https://trisquel.info/|Fully free operating system for home users, small enterprises and educational centers.";; + trisquel) INFO="Trisquel|Debian Ubuntu|-|https://trisquel.info/|Fully free operating system for home users, small enterprises and educational centers.";; truenas-core) INFO="TrueNAS Core|FreeBSD|-|https://www.truenas.com/truenas-core/|World’s most popular storage OS because it gives you the power to build your own professional-grade storage system to use in a variety of data-intensive applications without any software costs.";; truenas-scale) INFO="TrueNAS Scale|Debian|-|https://www.truenas.com/truenas-scale/|Open Source Hyperconverged Infrastructure (HCI) solution. In addition to powerful scale-out storage capabilities, SCALE adds Linux Containers and VMs (KVM) so apps run closer to data.";; - tuxedo-os) INFO="Tuxedo OS|Ubuntu|-|https://www.tuxedocomputers.com/en/|KDE Ubuntu LTS designed to go with their Linux hardware.";; + tuxedoos) INFO="Tuxedo OS|Ubuntu|-|https://www.tuxedocomputers.com/en/|KDE Ubuntu LTS designed to go with their Linux hardware.";; ubuntu) INFO="Ubuntu|Debian|-|https://ubuntu.com/|Complete desktop Linux operating system, freely available with both community and professional support.";; ubuntu-budgie) INFO="Ubuntu Budgie|Ubuntu|-|https://ubuntubudgie.org/|Community developed distribution, integrating the Budgie Desktop Environment with Ubuntu at its core.";; ubuntucinnamon) INFO="Ubuntu Cinnamon|Ubuntu|-|https://ubuntucinnamon.org/|Community-driven, featuring Linux Mint’s Cinnamon Desktop with Ubuntu at the core, packed fast and full of features, here is the most traditionally modern desktop you will ever love.";; @@ -130,7 +130,7 @@ function os_info() { ubuntu-server) INFO="Ubuntu Server|Ubuntu|-|https://ubuntu.com/server|Brings economic and technical scalability to your datacentre, public or private. Whether you want to deploy an OpenStack cloud, a Kubernetes cluster or a 50,000-node render farm, Ubuntu Server delivers the best value scale-out performance available.";; ubuntustudio) INFO="Ubuntu Studio|Ubuntu|-|https://ubuntustudio.org/|Comes preinstalled with a selection of the most common free multimedia applications available, and is configured for best performance for various purposes: Audio, Graphics, Video, Photography and Publishing.";; ubuntu-unity) INFO="Ubuntu Unity|Ubuntu|-|https://ubuntuunity.org/|Flavor of Ubuntu featuring the Unity7 desktop environment (the default desktop environment used by Ubuntu from 2010-2017).";; - vanillaos) INFO="Vanilla OS|Debian,Ubuntu|-|https://vanillaos.org/|Designed to be a reliable and productive operating system for your daily work.";; + vanillaos) INFO="Vanilla OS|Debian Ubuntu|-|https://vanillaos.org/|Designed to be a reliable and productive operating system for your daily work.";; void) INFO="Void Linux|Independent|anon:voidlinux|https://voidlinux.org/|General purpose operating system. Its package system allows you to quickly install, update and remove software; software is provided in binary packages or can be built directly from sources.";; vxlinux) INFO="VX Linux|Void|-|https://vxlinux.org/|Pre-configured, secure systemd-free Plasma desktop with focus on convenience, performance and simplicity. Based on the excellent Void Linux.";; whonix) INFO="Whonix|Debian|-|https://www.whonix.org/|Superior Internet Privacy with Whonix™ As handy as an app - delivering maximum anonymity and security.";; From 47914cd77fb702e89379e484164e931569ac3149 Mon Sep 17 00:00:00 2001 From: zen0bit Date: Mon, 29 Apr 2024 12:08:02 +0200 Subject: [PATCH 02/17] Add PRETTY_NAME variable --- quickget | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/quickget b/quickget index 38d6207..179ff54 100755 --- a/quickget +++ b/quickget @@ -154,6 +154,7 @@ function show_os_info() { function pretty_name() { echo $(show_os_info -1 "${1}") } +PRETTY_NAME=$(show_os_info -1 "${OS}") # Just in case quickget want use it function os_homepage(){ @@ -234,7 +235,7 @@ function error_not_supported_release() { function error_not_supported_edition() { if [[ ! " ${EDITIONS[*]} " =~ " ${EDITION} " ]]; then - echo -e "ERROR! ${EDITION} is not a supported $(pretty_name "${OS}") edition\n" + echo -e "ERROR! ${EDITION} is not a supported ${PRETTY_NAME} edition\n" echo -n ' - Editions: ' for EDITION in "${EDITIONS[@]}"; do echo -n "${EDITION} " @@ -245,7 +246,7 @@ function error_not_supported_edition() { } function error_not_supported_lang() { - echo -e "ERROR! ${LANG} is not a supported $(pretty_name "${OS}") language\n" + echo -e "ERROR! ${LANG} is not a supported ${PRETTY_NAME} language\n" echo -n ' - Editions: ' for LANG in "${LANGS[@]}"; do echo -n "${LANG} " @@ -1250,7 +1251,7 @@ function web_get() { fi if [[ ${OS} != windows && ${OS} != macos && ${OS} != windows-server ]]; then - echo Downloading $(pretty_name "${OS}") ${RELEASE} ${EDITION:+ $EDITION} + echo Downloading ${PRETTY_NAME} ${RELEASE} ${EDITION:+ $EDITION} echo "- URL: ${URL}" fi @@ -1317,7 +1318,7 @@ function zsync_get() { echo "ERROR! Unable to create directory ${DIR}" exit 1 fi - echo -e Downloading $(pretty_name "${OS}") ${RELEASE} ${EDITION+ ${EDITION}} from ${URL}'\n' + echo -e Downloading ${PRETTY_NAME} ${RELEASE} ${EDITION+ ${EDITION}} from ${URL}'\n' # Only force http for zsync - not earlier because we might fall through here if ! zsync "${URL/https/http}.zsync" -i "${DIR}/${OUT}" -o "${DIR}/${OUT}" 2>/dev/null; then echo "ERROR! Failed to download ${URL/https/http}.zsync" @@ -1513,7 +1514,7 @@ EOF echo "secureboot=\"off\"" >> "${CONF_FILE}" fi fi - echo -e "\nTo start your $(pretty_name "${OS}") virtual machine run:" + echo -e "\nTo start your ${PRETTY_NAME} virtual machine run:" if [ ${OS} == "slint" ]; then echo -e " quickemu --vm ${CONF_FILE}\nTo start Slint with braille support run:\n quickemu --vm --braille --display sdl ${CONF_FILE}" else @@ -2574,7 +2575,7 @@ function get_ubuntu() { HASH=$(cut_1 <<<${DATA}) fi if [ -z $ISO ] || [ -z $HASH ]; then - echo "$(pretty_name $OS) ${RELEASE} is currently unavailable. Please select other OS/Release combination" + echo "${PRETTY_NAME} ${RELEASE} is currently unavailable. Please select other OS/Release combination" exit 1 fi if [[ "${RELEASE}" == "daily"* ]] || [ "${RELEASE}" == "dvd" ]; then @@ -3123,7 +3124,7 @@ function download_windows_server() { # Limit untrusted size for input validation iso_download_link="$(echo "$iso_download_link" | head -c 1024)" - echo "Downloading $(pretty_name "${OS}") ${PRETTY_RELEASE} (${LANG}): $iso_download_link" + echo "Downloading ${PRETTY_NAME} ${PRETTY_RELEASE} (${LANG}): $iso_download_link" # Use highest TLS version for endpoints that support it case "$iso_download_link" in From 0c3f16c980aaa6f46992cc31ff7436885972f7c8 Mon Sep 17 00:00:00 2001 From: zen0bit Date: Mon, 29 Apr 2024 12:12:23 +0200 Subject: [PATCH 03/17] Change DISPLAY_NAME to PRETTY_NAME --- quickget | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/quickget b/quickget index 179ff54..8f841a8 100755 --- a/quickget +++ b/quickget @@ -226,7 +226,7 @@ function error_not_supported_os() { function error_not_supported_release() { if [[ ! " ${RELEASES[*]} " =~ " ${RELEASE} " ]]; then - echo -e "ERROR! ${DISPLAY_NAME} ${RELEASE} is not a supported release." + echo -e "ERROR! ${PRETTY_NAME} ${RELEASE} is not a supported release." echo -n 'Supported releases: ' "releases_${OS}" exit 1 @@ -274,11 +274,9 @@ function handle_missing() { } function validate_release() { - local DISPLAY_NAME="" + local PRETTY_NAME="" local RELEASE_GENERATOR="" local RELEASES="" - - DISPLAY_NAME="$(pretty_name "${OS}")" case ${OS} in *ubuntu-server*) RELEASE_GENERATOR="releases_ubuntu-server";; *ubuntu*) RELEASE_GENERATOR="releases_ubuntu";; @@ -296,15 +294,12 @@ function list_json() { function list_csv() { CSV_DATA="$(csv_data)" - - echo "Display Name,OS,Release,Option,Downloader,PNG,SVG" - sort -t',' -k2,2 <<<"${CSV_DATA}" - + sort -f <<<"${CSV_DATA}" exit 0 } function csv_data() { - local DISPLAY_NAME + local PRETTY_NAME local DL="" local DOWNLOADER local FUNC @@ -322,8 +317,8 @@ function csv_data() { for OS in $(os_support); do local EDITIONS="" - DISPLAY_NAME="$(pretty_name "${OS}")" - + echo "Pretty Name,OS,Release,Option,Downloader,PNG,SVG" + for OS in $(os_support); do case ${OS} in *ubuntu-server*) FUNC="ubuntu-server";; *ubuntu*) FUNC="ubuntu";; @@ -347,15 +342,15 @@ function csv_data() { # If the OS has an editions_() function, use it. if [[ ${EDITIONS} ]]; then for OPTION in ${EDITIONS}; do - echo "${DISPLAY_NAME},${OS},${RELEASE},${OPTION},${DOWNLOADER},${PNG},${SVG}" + echo "${PRETTY_NAME},${OS},${RELEASE},${OPTION},${DOWNLOADER},${PNG},${SVG}" done elif [[ "${OS}" == "windows"* ]]; then "languages_${OS}" for LANG in "${LANGS[@]}"; do - echo "${DISPLAY_NAME},${OS},${RELEASE},${LANG},${DOWNLOADER},${PNG},${SVG}" + echo "${PRETTY_NAME},${OS},${RELEASE},${LANG},${DOWNLOADER},${PNG},${SVG}" done else - echo "${DISPLAY_NAME},${OS},${RELEASE},,${DOWNLOADER},${PNG},${SVG}" + echo "${PRETTY_NAME},${OS},${RELEASE},,${DOWNLOADER},${PNG},${SVG}" fi done & done From 6d964212ed1da5413e642fe10dd379284e09ffaa Mon Sep 17 00:00:00 2001 From: zen0bit Date: Mon, 29 Apr 2024 12:16:52 +0200 Subject: [PATCH 04/17] Remove unused pretty_name() --- quickget | 3 --- 1 file changed, 3 deletions(-) diff --git a/quickget b/quickget index 8f841a8..75492a8 100755 --- a/quickget +++ b/quickget @@ -151,9 +151,6 @@ function show_os_info() { done } -function pretty_name() { - echo $(show_os_info -1 "${1}") -} PRETTY_NAME=$(show_os_info -1 "${OS}") # Just in case quickget want use it From 0da427a6d9eccae45f7cb1866b911a38856a3237 Mon Sep 17 00:00:00 2001 From: zen0bit Date: Mon, 29 Apr 2024 12:17:31 +0200 Subject: [PATCH 05/17] Add OS info to list_csv --- quickget | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/quickget b/quickget index 75492a8..a5ea98b 100755 --- a/quickget +++ b/quickget @@ -305,6 +305,7 @@ function csv_data() { local PNG local RELEASE local SVG + local INFO local HAS_ZSYNC=0 # Check if zsync is available @@ -313,9 +314,10 @@ function csv_data() { fi for OS in $(os_support); do + local INFO="" local EDITIONS="" - echo "Pretty Name,OS,Release,Option,Downloader,PNG,SVG" - for OS in $(os_support); do + INFO=$(os_info "$OS") + IFS='|' read -r PRETTY_NAME BASED_ON CREDENTIALS HOMEPAGE INFO_TEXT <<< "$INFO" case ${OS} in *ubuntu-server*) FUNC="ubuntu-server";; *ubuntu*) FUNC="ubuntu";; @@ -339,15 +341,15 @@ function csv_data() { # If the OS has an editions_() function, use it. if [[ ${EDITIONS} ]]; then for OPTION in ${EDITIONS}; do - echo "${PRETTY_NAME},${OS},${RELEASE},${OPTION},${DOWNLOADER},${PNG},${SVG}" + echo "${PRETTY_NAME},${OS},${RELEASE},${OPTION},${DOWNLOADER},${PNG},${SVG},${BASED_ON},${CREDENTIALS},${HOMEPAGE},${INFO_TEXT}" done elif [[ "${OS}" == "windows"* ]]; then "languages_${OS}" for LANG in "${LANGS[@]}"; do - echo "${PRETTY_NAME},${OS},${RELEASE},${LANG},${DOWNLOADER},${PNG},${SVG}" + echo "${PRETTY_NAME},${OS},${RELEASE},${LANG},${DOWNLOADER},${PNG},${SVG},${BASED_ON},${CREDENTIALS},${HOMEPAGE},${INFO_TEXT}" done else - echo "${PRETTY_NAME},${OS},${RELEASE},,${DOWNLOADER},${PNG},${SVG}" + echo "${PRETTY_NAME},${OS},${RELEASE},,${DOWNLOADER},${PNG},${SVG},${BASED_ON},${CREDENTIALS},${HOMEPAGE},${INFO_TEXT}" fi done & done @@ -3444,6 +3446,7 @@ case "${1}" in ;; #TODO: Argument without dashes should be DEPRECATED! '--list-csv'|'-lc'|'list'|'list_csv'|'lc') + echo "Pretty Name,OS,Release,Option,Downloader,PNG,SVG,Based on,Credentials,Homepage,Info" list_csv ;; #TODO: Argument without dashes should be DEPRECATED! From 53186479d30346c9f9a34704f6b59e9de1b73da7 Mon Sep 17 00:00:00 2001 From: zen0bit Date: Tue, 30 Apr 2024 20:48:29 +0200 Subject: [PATCH 06/17] Leave Not needed -ca and -ua arguments --- .github/workflows/quickget-tests.yml | 140 +++++++++++++++++++++++++++ quickget | 33 +++---- 2 files changed, 156 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/quickget-tests.yml diff --git a/.github/workflows/quickget-tests.yml b/.github/workflows/quickget-tests.yml new file mode 100644 index 0000000..dc44b88 --- /dev/null +++ b/.github/workflows/quickget-tests.yml @@ -0,0 +1,140 @@ +--- # This is a basic workflow to help test quickget + +name: quickget tests + +# Controls when the action will run. +on: + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + # Build at 00:00 on every 12th day-of-month. + #schedule: + # - cron: "0 0 */12 * *" + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: '**' #'!master' # excludes master + paths: [ quickget ] + pull_request: + branches: '**' # matches every branch + paths: + - quickget + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + job1: + name: All supported + runs-on: ubuntu-latest + # The type of runner that the job will run on + #runs-on: ubuntu-latest + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v4 + - name: List all supported OS variants + run: | + mkdir -p results + echo -e "\n\n Supported:\n\n" + ./quickget -l | tee results/supported.txt + echo -e "\n\nAll supported OS variants: $(cat results/supported.txt | wc -l)" + echo -e "\n\n Finished\n\n" + + - uses: actions/upload-artifact@v4 + with: + name: supported + path: results/supported.txt + + job2: + name: All info + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Show info about all OS + run: | + export TERM=xterm-256color + #sudo apt install -y neofetch + #echo -e "\n\n" + #neofetch + #echo -e "\n\n" + echo -e "\n\n OSinfo:\n\n" + distros="$(./quickget | sed '/^$/q' | tail -n +3)" + mkdir -p results + for os in ${distros}; do + echo -e "\n\n ${os}" && ./quickget -12345 "${os}" | tee -a results/infos.txt + done + echo -e "\n\nHomepages aka number of supported OS (os_info): $(cat results/infos.txt | grep 'http' | wc -l)" + echo -e "\n\n Finished\n\n" + + - uses: actions/upload-artifact@v4 + with: + name: infos + path: results/infos.txt + + job3: + needs: [job1] + name: All URLs + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + path: results + merge-multiple: true + - name: Display downloaded artifacts + run: ls -R results/ + + - uses: actions/checkout@v4 + - name: List all supported systems download URLs + run: | + export TERM=xterm-256color + distros="$(./quickget | sed '/^$/q' | tail -n +3)" + echo -e "\n\n ISOs:\n\n" + mkdir -p results + for os in ${distros}; do + echo -e "\n\n ${os}" && ./quickget -u "${os}" | tee -a results/urls.txt + done + echo -e "\n\nFounded/All URLs: $(cat results/urls.txt | grep 'http' | wc -l)/$(cat results/supported.txt | wc -l)" + echo -e "\n\n Finished\n\n" + + - uses: actions/upload-artifact@v4 + with: + name: urls + path: results/urls.txt + + job4: + name: All checks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Checking if all downloads for Operating Systems are available... + run: | + export TERM=xterm-256color + distros="$(./quickget | sed '/^$/q' | tail -n +3)" + echo -e "\n\n ISOs availability:\n\n" + mkdir -p results + for os in ${distros}; do + echo -e "\n\n ${os}" && ./quickget -c "${os}" | tee -a results/checks.txt + done + ALL=$(cat results/checks.txt | grep 'http' | wc -l) + FAILED=$(grep -c 'FAIL:' results/checks.txt) + SKIPED=$(grep -c 'SKIP:' results/checks.txt) + PASSED=$(grep -c 'PASS:' results/checks.txt) + CHECKED=$(($FAILED + $SKIPED + $PASSED)) + echo -e "\n\nFAILED: $FAILED" + echo "SKIPED: $SKIPED" + echo "PASSED: $PASSED" + echo "All/Checked: $ALL/$CHECKED" + echo -e "Failed:\n$(grep 'FAIL:' results/checks.txt | tee -a results/failed.txt)" + echo -e "\n\n Finished\n\n" + + - uses: actions/upload-artifact@v4 + with: + name: checks + path: results/checks.txt + + + - uses: actions/upload-artifact@v4 + with: + name: failed + path: results/failed.txt \ No newline at end of file diff --git a/quickget b/quickget index a5ea98b..3294c21 100755 --- a/quickget +++ b/quickget @@ -481,6 +481,7 @@ function test_all() { fi fi done + exit 0 } function os_support() { @@ -3357,21 +3358,21 @@ Advanced usage: quickget --download ubuntu 22.04 Arguments: - -[12345] : Show info* about OS - --download (-d) [ed] : Download image; no VM configuration - --create-config (-cc) [path/url]: Create default VM config for image - --open-homepage (-o) : Open homepage for the OS - --version (-v) : Show version - --help (-h) : Show this help message --------------------------- For testing & development --------------------------- - --url (-u) [os] [re] [ed] : Show image URL(s) - --check (-c) [os] [re] [ed] : Check image URL(s) - --list (-l) : List all supported systems - --list-csv (-lc) : List everything in csv format - --list-json (-lj) : List everything in json format --------------------------------------------------------------------------------- - *info: 1=Logo 2=Based of 3=Credentials 4=Homepage 5=Short info - Can be used in any combination like -13254 or -52 + -[12345] : Show info* about OS + --download (-d) [ed] : Download the ISO only; no VM configuration + --create-config (-cc) [path/url]: Create default VM config for image + --open-homepage (-o) : Open homepage for the OS + --version (-v) : Show version + --help (-h) : Show this help message +-------------- For testing & development --------------------- + --url (-u) [os] [re] [ed] : Show download URL for what specified or All + --check (-c) [os] [re] [ed] : Check download for what specified or All + --list (-l) : List all supported systems in plain text + --list-csv (-lc) : List all supported systems in csv format + --list-json (-lj) : List all supported systems in json format +-------------------------------------------------------------- + *info: 1=Logo 2=Based of 3=Credentials 4=Homepage 5=Short info + Can be used in any combination like -13254 or -52 Supported Operating Systems:\n\n' "$(quickemu --version)" "${CURL_VERSION}" os_support | fold -s -w "$(tput cols)" @@ -3430,7 +3431,6 @@ case "${1}" in elif [ -z "${2}" ]; then test_all "${1}" fi - exit 0 ;; '--check'|'-c') OPERATION="test" @@ -3442,7 +3442,6 @@ case "${1}" in elif [ -z "${2}" ]; then test_all "${1}" fi - exit 0 ;; #TODO: Argument without dashes should be DEPRECATED! '--list-csv'|'-lc'|'list'|'list_csv'|'lc') From c2624814d74c1dfd8018a5056e13f7d3e7c5e15b Mon Sep 17 00:00:00 2001 From: Liam <33645555+lj3954@users.noreply.github.com> Date: Tue, 30 Apr 2024 15:56:35 -0700 Subject: [PATCH 07/17] Ignore pretty name in list_csv sorting --- quickget | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickget b/quickget index 3294c21..e37f826 100755 --- a/quickget +++ b/quickget @@ -291,7 +291,7 @@ function list_json() { function list_csv() { CSV_DATA="$(csv_data)" - sort -f <<<"${CSV_DATA}" + sort -t',' -k2,2 <<<"${CSV_DATA}" exit 0 } From 8c7c2987a7892564d61222d3b6a8614d2e76f2e6 Mon Sep 17 00:00:00 2001 From: zen0bit Date: Wed, 1 May 2024 06:53:12 +0200 Subject: [PATCH 08/17] fix: daily-live not shown in checks --- quickget | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/quickget b/quickget index e37f826..dadc829 100755 --- a/quickget +++ b/quickget @@ -1286,20 +1286,19 @@ function web_check() { } function zsync_get() { + local CHECK="" local DIR="${2}" local FILE="${1##*/}" local OUT="" local URL="${1}" # Test mode for ISO if [ "${OPERATION}" == "show" ]; then - echo "${URL}" + test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" exit 0 - elif [ "${OPERATION}" == "check" ]; then + elif [ "${OPERATION}" == "test" ]; then if ! web_check "${URL}"; then - check_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "FAIL" - exit 0 - else - check_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "PASS" + CHECK=$(web_check "${URL}" && echo 'PASS' || echo 'FAIL') + test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "${CHECK}" exit 0 fi elif command -v zsync &>/dev/null; then From 528c3d793c40c1f0a42c72180c7248359005e702 Mon Sep 17 00:00:00 2001 From: zen0bit Date: Thu, 2 May 2024 11:13:04 +0200 Subject: [PATCH 09/17] Finall help --- quickget | 60 +++++++++++++++++++++++++++----------------------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/quickget b/quickget index dadc829..384ba5a 100755 --- a/quickget +++ b/quickget @@ -3336,42 +3336,40 @@ function create_vm() { function help_message() { #shellcheck disable=SC2016 - printf ' - _ _ _ - __ _ _ _(_) ___| | ____ _ ___| |_ - / _` | | | | |/ __| |/ / _` |/ _ \ __| -| (_| | |_| | | (__| < (_| | __/ |_ - \__, |\__,_|_|\___|_|\_\__, |\___|\__| - |_| |___/ v%s, using curl %s + printf ' _ _ + __ _ _ _ _ ___║ ║ ____ _ ___║ ║_ + / _` ║ ║ ║ ║ ║/ __║ ║/ / _` ║/ _ \ __║ MIT + ( (_║ ║ ║_║ ║ ║ (__║ < (_║ ║ __/ ║_ license + \__, ║\__,_║_║\___║_║\ \__, ║\___║\__║ version: %s + ║_║ ║___/ part of Quickemu project -------------------------------------------------------------------------------- - Project - https://github.com/quickemu-project/quickemu - Discord - https://wimpysworld.io/discord + > Quickly create and run optimised Linux, < + > Windows and macOS desktop virtual machines < + + Project - https://github.com/quickemu-project/quickemu + Discord - https://wimpysworld.io/discord -------------------------------------------------------------------------------- -Usage: - quickget [edition] - quickget ubuntu 22.04 - -Advanced usage: - quickget [path] [re] [ed] - quickget --download ubuntu 22.04 +Basic Usage: Advanced Usage: + quickget [edition] quickget [path] [re] [ed] + quickget ubuntu 22.04 quickget --download ubuntu 22.04 Arguments: - -[12345] : Show info* about OS - --download (-d) [ed] : Download the ISO only; no VM configuration - --create-config (-cc) [path/url]: Create default VM config for image - --open-homepage (-o) : Open homepage for the OS - --version (-v) : Show version - --help (-h) : Show this help message --------------- For testing & development --------------------- - --url (-u) [os] [re] [ed] : Show download URL for what specified or All - --check (-c) [os] [re] [ed] : Check download for what specified or All - --list (-l) : List all supported systems in plain text - --list-csv (-lc) : List all supported systems in csv format - --list-json (-lj) : List all supported systems in json format --------------------------------------------------------------- - *info: 1=Logo 2=Based of 3=Credentials 4=Homepage 5=Short info - Can be used in any combination like -13254 or -52 + -[12345] : Show info* about OS + --download (-d) [ed] : Download image; no VM configuration + --create-config (-cc) [path/url] : Create default VM config for image + --open-homepage (-o) : Open homepage for the OS + --version (-v) : Show version + --help (-h) : Show this help message +------------------ For testing & development ----------------------------------- + --url (-u) [os] [re] [ed] : Show URL(s) for what specified or All + --check (-c) [os] [re] [ed] : Check URL(s) for what specified or All + --list (-l) : List all supported systems + --list-csv (-lc) : List everything in csv format + --list-json (-lj) : List everything in json format +-------------------------------------------------------------------------------- + *info: 1=Logo 2=Based of 3=Credentials 4=Homepage 5=Short info + Can be used in any combination like -13254 or -52 Supported Operating Systems:\n\n' "$(quickemu --version)" "${CURL_VERSION}" os_support | fold -s -w "$(tput cols)" From 9c3310de7a1af544f0defff54e7734cffb5772ee Mon Sep 17 00:00:00 2001 From: zen0bit Date: Thu, 2 May 2024 10:01:39 +0200 Subject: [PATCH 10/17] Solve shellcheck error 2068 --- quickget | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/quickget b/quickget index 384ba5a..d80770f 100755 --- a/quickget +++ b/quickget @@ -1095,22 +1095,22 @@ function releases_ubuntu() { local EOL_VERSIONS=($(IFS=$'\n' jq -r 'select(.status=="Obsolete") | .version' <<<${VERSION_DATA} | sort)) case "${OS}" in ubuntu) - echo ${SUPPORTED_VERSIONS[@]} daily-live ${EOL_VERSIONS[@]/#/eol-};; + echo "${SUPPORTED_VERSIONS[@]}" daily-live "${EOL_VERSIONS[@]/#/eol-}";; kubuntu|lubuntu|ubuntukylin|ubuntu-mate|ubuntustudio|xubuntu) # after 16.04 - echo ${SUPPORTED_VERSIONS[@]:1} daily-live ${EOL_VERSIONS[@]/#/eol-};; + echo "${SUPPORTED_VERSIONS[@]:1}" daily-live "${EOL_VERSIONS[@]/#/eol-}";; ubuntu-budgie) # after 18.04 - echo ${SUPPORTED_VERSIONS[@]:2} daily-live ${EOL_VERSIONS[@]/#/eol-};; + echo "${SUPPORTED_VERSIONS[@]:2}" daily-live "${EOL_VERSIONS[@]/#/eol-}";; edubuntu|ubuntu-unity|ubuntucinnamon) # after 23.10 - echo ${SUPPORTED_VERSIONS[@]:5} daily-live ${EOL_VERSIONS[@]/#/eol-};; + echo "${SUPPORTED_VERSIONS[@]:5}" daily-live "${EOL_VERSIONS[@]/#/eol-}";; esac } function releases_ubuntu-server() { local ALL_VERSIONS=($(IFS=$'\n' web_pipe http://releases.ubuntu.com/streams/v1/com.ubuntu.releases:ubuntu-server.json | jq -r '.products[] | select(.arch=="amd64") | .version' | sort -rV)) - echo ${ALL_VERSIONS[@]} + echo "${ALL_VERSIONS[@]}" } function releases_vanillaos() { From 8a86280e9a12b3b09b4ff01dbcfa06b42d720f8f Mon Sep 17 00:00:00 2001 From: zen0bit Date: Sat, 4 May 2024 00:01:07 +0200 Subject: [PATCH 11/17] Solve or disable rest of check errors --- quickget | 74 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/quickget b/quickget index d80770f..850ca48 100755 --- a/quickget +++ b/quickget @@ -1,5 +1,6 @@ #!/usr/bin/env bash export LC_ALL=C +# shellcheck disable=SC2317 # Here the quick 'n dirty guide to adding a new OS to quickget # @@ -23,6 +24,7 @@ export LC_ALL=C # echo "${URL}/${ISO} ${HASH}" #} +# shellcheck disable=SC2317 function cleanup() { if [ -n "$(jobs -p)" ]; then kill "$(jobs -p)" @@ -142,10 +144,11 @@ function os_info() { echo "${INFO}" } +# shellcheck disable=SC2086 function show_os_info() { while getopts ":12345" opt; do case $opt in - 1|2|3|4|5) os_info "${2}" | cut -d'|' -f${opt};; + 1|2|3|4|5) os_info "${2}" | cut -d'|' -f"${opt}";; *) error_not_supported_argument;; esac done @@ -153,9 +156,10 @@ function show_os_info() { PRETTY_NAME=$(show_os_info -1 "${OS}") -# Just in case quickget want use it +# Just in case quickget want use it in future +# shellcheck disable=SC2005,SC2317 function os_homepage(){ - echo $(show_os_info -4 "${1}") + echo "$(show_os_info -4 "${1}")" } function error_specify_os() { @@ -715,7 +719,7 @@ function releases_debian() { local OLD="" NEW=$(web_pipe "https://cdimage.debian.org/debian-cd/" | grep '\.[0-9]/' | cut -d'>' -f 9 | cut -d'/' -f 1) OLD=$(web_pipe "https://cdimage.debian.org/cdimage/archive/" | grep -e '>[1-9][0-9]\.' | grep -v 'live' | grep -v NEVER | cut -d'>' -f 9 | cut -d'/' -f 1 | tac | head -20) - echo ${NEW} ${OLD} + echo "${NEW}" "${OLD}" } function editions_debian() { @@ -1091,8 +1095,8 @@ function releases_tuxedo-os() { function releases_ubuntu() { local VERSION_DATA="$(IFS=$'\n' web_pipe https://api.launchpad.net/devel/ubuntu/series | jq -r '.entries[]')" - local SUPPORTED_VERSIONS=($(IFS=$'\n' jq -r 'select(.status=="Supported" or .status=="Current Stable Release") | .version' <<<${VERSION_DATA} | sort)) - local EOL_VERSIONS=($(IFS=$'\n' jq -r 'select(.status=="Obsolete") | .version' <<<${VERSION_DATA} | sort)) + local SUPPORTED_VERSIONS=($(IFS=$'\n' jq -r 'select(.status=="Supported" or .status=="Current Stable Release") | .version' <<<"${VERSION_DATA}" | sort)) + local EOL_VERSIONS=($(IFS=$'\n' jq -r 'select(.status=="Obsolete") | .version' <<<"${VERSION_DATA}" | sort)) case "${OS}" in ubuntu) echo "${SUPPORTED_VERSIONS[@]}" daily-live "${EOL_VERSIONS[@]/#/eol-}";; @@ -1246,7 +1250,7 @@ function web_get() { fi if [[ ${OS} != windows && ${OS} != macos && ${OS} != windows-server ]]; then - echo Downloading ${PRETTY_NAME} ${RELEASE} ${EDITION:+ $EDITION} + echo Downloading "${PRETTY_NAME}" "${RELEASE}" "${EDITION:+ $EDITION}" echo "- URL: ${URL}" fi @@ -1312,7 +1316,7 @@ function zsync_get() { echo "ERROR! Unable to create directory ${DIR}" exit 1 fi - echo -e Downloading ${PRETTY_NAME} ${RELEASE} ${EDITION+ ${EDITION}} from ${URL}'\n' + echo -e Downloading "${PRETTY_NAME} ${RELEASE} ${EDITION+ ${EDITION}} from ${URL}\n" # Only force http for zsync - not earlier because we might fall through here if ! zsync "${URL/https/http}.zsync" -i "${DIR}/${OUT}" -o "${DIR}/${OUT}" 2>/dev/null; then echo "ERROR! Failed to download ${URL/https/http}.zsync" @@ -1509,7 +1513,7 @@ EOF fi fi echo -e "\nTo start your ${PRETTY_NAME} virtual machine run:" - if [ ${OS} == "slint" ]; then + if [ "${OS}" == "slint" ]; then echo -e " quickemu --vm ${CONF_FILE}\nTo start Slint with braille support run:\n quickemu --vm --braille --display sdl ${CONF_FILE}" else echo " quickemu --vm ${CONF_FILE}" @@ -1827,7 +1831,7 @@ function get_fedora() { Server|Kinoite|Onyx|Silverblue|Sericea|Workstation) VARIANT="${EDITION}";; *) VARIANT="Spins";; esac - JSON=$(web_pipe "https://getfedora.org/releases.json" | jq '.[] | select(.variant=="'${VARIANT}'" and .subvariant=="'"${EDITION}"'" and .arch=="x86_64" and .version=="'"${RELEASE}"'")') + JSON=$(web_pipe "https://getfedora.org/releases.json" | jq '.[] | select(.variant=="'"${VARIANT}"'" and .subvariant=="'"${EDITION}"'" and .arch=="x86_64" and .version=="'"${RELEASE}"'")') URL=$(echo "${JSON}" | jq -r '.link' | head -n1) HASH=$(echo "${JSON}" | jq -r '.sha256' | head -n1) echo "${URL} ${HASH}" @@ -2127,9 +2131,9 @@ function get_manjaro() { [[ ${RELEASE} != "sway" ]] && MANIFEST="$(web_pipe https://gitlab.manjaro.org/web/iso-info/-/raw/master/file-info.json)" [[ ${EDITION} == "minimal" && ${TYPE} != "sway" ]] && EDITION=".minimal" || EDITION="" if [[ ${RELEASE} != "sway" ]]; then - URL="$(echo ${MANIFEST} | jq -r .${TYPE}.${RELEASE}${EDITION}.image)" + URL="$(echo "${MANIFEST}" | jq -r "${TYPE}"."${RELEASE}""${EDITION}".image)" else - URL=$(echo ${MANIFEST} | jq -r '.[] | select(.name|test("^manjaro-sway-.*[.]iso$")) | select(.name|contains("unstable")|not) | .url') + URL=$(echo "${MANIFEST}" | jq -r '.[] | select(.name|test("^manjaro-sway-.*[.]iso$")) | select(.name|contains("unstable")|not) | .url') fi HASH=$(web_pipe "${URL}.sha512" | cut_1) echo "${URL} ${HASH}" @@ -2473,7 +2477,7 @@ function get_truenas-scale() { local ISO="" local URL="" local DLINFO="https://www.truenas.com/download-truenas-scale/" - URL=$(web_pipe ${DLINFO} | grep -o "\"https://.*${RELEASE}.*\.iso\"" | cut -d'"' -f 2) + URL=$(web_pipe "${DLINFO}" | grep -o "\"https://.*${RELEASE}.*\.iso\"" | cut -d'"' -f 2) HASH=$(web_pipe "${URL}.sha256" | cut_1) echo "${URL} ${HASH}" } @@ -2482,7 +2486,7 @@ function get_truenas-core() { local ISO="" local URL="" local DLINFO="https://www.truenas.com/download-truenas-core/" - URL=$(web_pipe ${DLINFO} | grep -o "\"https://.*${RELEASE}.*\.iso\"" | cut -d'"' -f 2) + URL=$(web_pipe "${DLINFO}" | grep -o "\"https://.*${RELEASE}.*\.iso\"" | cut -d'"' -f 2) HASH=$(web_pipe "${URL}".sha256 | cut_1) echo "${URL} ${HASH}" } @@ -2515,12 +2519,12 @@ function get_ubuntu-server() { if web_check "${URL}/SHA256SUMS"; then DATA=$(web_pipe "${URL}/SHA256SUMS" | grep "${NAME}" | grep amd64 | grep iso) - ISO=$(cut -d'*' -f2 <<<${DATA}) - HASH=$(cut_1 <<<${DATA}) + ISO=$(cut -d'*' -f2 <<<"${DATA}") + HASH=$(cut_1 <<<"${DATA}") else DATA=$(web_pipe "${URL}/MD5SUMS" | grep "${NAME}" | grep amd64 | grep iso) - ISO=$(cut -d' ' -f3 <<<${DATA}) - HASH=$(cut_1 <<<${DATA}) + ISO=$(cut -d' ' -f3 <<<"${DATA}") + HASH=$(cut_1 <<<"${DATA}") fi if [[ "${RELEASE}" == "daily"* ]] || [ "${RELEASE}" == "dvd" ]; then zsync_get "${URL}/${ISO}" "${VM_PATH}" "${OS}-devel.iso" @@ -2561,14 +2565,14 @@ function get_ubuntu() { fi if web_check "${URL}/SHA256SUMS"; then DATA=$(web_pipe "${URL}/SHA256SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | grep iso | grep -v "+mac") - ISO=$(cut -d'*' -f2 <<<${DATA} | sed '1q;d') - HASH=$(cut_1 <<<${DATA} | sed '1q;d') + ISO=$(cut -d'*' -f2 <<<"${DATA}" | sed '1q;d') + HASH=$(cut_1 <<<"${DATA}" | sed '1q;d') else DATA=$(web_pipe "${URL}/MD5SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | grep iso | grep -v "+mac") - ISO=$(cut -d'*' -f2 <<<${DATA}) - HASH=$(cut_1 <<<${DATA}) + ISO=$(cut -d'*' -f2 <<<"${DATA}") + HASH=$(cut_1 <<<"${DATA}") fi - if [ -z $ISO ] || [ -z $HASH ]; then + if [ -z "$ISO" ] || [ -z "$HASH" ]; then echo "${PRETTY_NAME} ${RELEASE} is currently unavailable. Please select other OS/Release combination" exit 1 fi @@ -3285,7 +3289,7 @@ function open_homepage() { error_specify_os else URL="$(os_info "${1}" | cut -d'|' -f4)" - xdg-open $URL || sensible-browser $URL || x-www-browser $URL || gnome-open $URL + xdg-open "$URL" || sensible-browser "$URL" || x-www-browser "$URL" || gnome-open "$URL" exit 0 fi } @@ -3304,32 +3308,32 @@ function create_vm() { check_hash "${ISO}" "${HASH}" fi - if [ ${OS} == "freedos" ] && [[ $ISO =~ ".zip" ]]; then - unzip ${VM_PATH}/${ISO} -d ${VM_PATH} - ISO=$(ls ${VM_PATH} | grep -i '.iso') + if [ "${OS}" == "freedos" ] && [[ $ISO =~ ".zip" ]]; then + unzip "${VM_PATH}/${ISO}" -d "${VM_PATH}" + ISO=$(ls "${VM_PATH}" | grep -i '.iso') fi - #if [ ${OS} == "guix" ] && [[ $ISO =~ ".qcow2" ]]; then + #if [ "${OS}" == "guix" ] && [[ $ISO =~ ".qcow2" ]]; then #cp ${VM_PATH}/${ISO} ${VM_PATH}/disc.qcow2 #fi - if [[ ${OS} == "batocera" ]] && [[ ${ISO} =~ ".gz" ]]; then + if [[ "${OS}" == "batocera" ]] && [[ ${ISO} =~ ".gz" ]]; then gzip -d "${VM_PATH}/${ISO}" ISO="${ISO/.gz/}" fi # Could be other OS iso files compressed with bzip2 or gzip # but for now we'll keep this to know cases - if [[ ${OS} == "dragonflybsd" ]] && [[ ${ISO} =~ ".bz2" ]]; then + if [[ "${OS}" == "dragonflybsd" ]] && [[ ${ISO} =~ ".bz2" ]]; then bzip2 -d "${VM_PATH}/${ISO}" ISO="${ISO/.bz2/}" fi - if [[ ${OS} == "easyos" ]] && [[ ${ISO} =~ ".img" ]]; then + if [[ "${OS}" == "easyos" ]] && [[ ${ISO} =~ ".img" ]]; then qemu-img convert -f raw -O qcow2 "${VM_PATH}/${ISO}" "${VM_PATH}/disk.qcow2" ISO="${ISO/.img/}" fi - if [ ${OS} == "reactos" ] && [[ $ISO =~ ".zip" ]]; then - unzip ${VM_PATH}/${ISO} -d ${VM_PATH} - ISO=$(ls ${VM_PATH} | grep -i '.iso' | grep -v '.zip') + if [ "${OS}" == "reactos" ] && [[ $ISO =~ ".zip" ]]; then + unzip "${VM_PATH}/${ISO}" -d "${VM_PATH}" + ISO=$(ls "${VM_PATH}" | grep -i '.iso' | grep -v '.zip') fi make_vm_config "${ISO}" } @@ -3471,7 +3475,7 @@ if [ -n "${2}" ]; then # If the OS has an editions_() function, use it. if [[ $(type -t "editions_${OS}") == function ]]; then validate_release "releases_${OS}" - EDITIONS=($(editions_${OS})) + EDITIONS=($("editions_${OS}")) EDITION=${EDITIONS[0]} if [ -n "${3}" ]; then EDITION="${3}" From 6486aa135bd2a5cfb6afd1b7135275d54cbd5488 Mon Sep 17 00:00:00 2001 From: zen0bit Date: Fri, 3 May 2024 15:28:43 +0200 Subject: [PATCH 12/17] Hide: "kill no such process" error --- quickget | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickget b/quickget index 850ca48..c3cb350 100755 --- a/quickget +++ b/quickget @@ -27,7 +27,7 @@ export LC_ALL=C # shellcheck disable=SC2317 function cleanup() { if [ -n "$(jobs -p)" ]; then - kill "$(jobs -p)" + kill "$(jobs -p)" 2>/dev/null fi } From 53ee0383a89cf490b3a85ae79e1e6393cd648512 Mon Sep 17 00:00:00 2001 From: zen0bit Date: Sat, 4 May 2024 02:45:22 +0200 Subject: [PATCH 13/17] Add missed exit codes --- quickget | 2 ++ 1 file changed, 2 insertions(+) diff --git a/quickget b/quickget index c3cb350..a56fa1c 100755 --- a/quickget +++ b/quickget @@ -3431,6 +3431,7 @@ case "${1}" in done elif [ -z "${2}" ]; then test_all "${1}" + exit 0 fi ;; '--check'|'-c') @@ -3442,6 +3443,7 @@ case "${1}" in done elif [ -z "${2}" ]; then test_all "${1}" + exit 0 fi ;; #TODO: Argument without dashes should be DEPRECATED! From a328cffbe99a7cb568906bdd10a89462c6a977cb Mon Sep 17 00:00:00 2001 From: zen0bit Date: Fri, 3 May 2024 09:36:17 +0200 Subject: [PATCH 14/17] Make tests of URLs parallel --- quickget | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/quickget b/quickget index a56fa1c..18594da 100755 --- a/quickget +++ b/quickget @@ -484,8 +484,8 @@ function test_all() { test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "${CHECK}" fi fi - done - exit 0 + done & + wait } function os_support() { @@ -3427,8 +3427,10 @@ case "${1}" in shift if [ -z "${1}" ]; then for OS in $(os_support); do - (test_all "${OS}") + (test_all "${OS}") & done + wait + exit 0 elif [ -z "${2}" ]; then test_all "${1}" exit 0 @@ -3439,8 +3441,10 @@ case "${1}" in shift if [ -z "${1}" ]; then for OS in $(os_support); do - (test_all "${OS}") + (test_all "${OS}") & done + wait + exit 0 elif [ -z "${2}" ]; then test_all "${1}" exit 0 From c4f4d1fdb14608b7de9f28fe7ab2f16d2186dfc0 Mon Sep 17 00:00:00 2001 From: zen0bit Date: Fri, 3 May 2024 10:18:05 +0200 Subject: [PATCH 15/17] CI: quickget tests --- .github/workflows/quickget-tests.yml | 140 --------------------------- .github/workflows/test-quickget.yml | 86 ++++++++-------- 2 files changed, 45 insertions(+), 181 deletions(-) delete mode 100644 .github/workflows/quickget-tests.yml diff --git a/.github/workflows/quickget-tests.yml b/.github/workflows/quickget-tests.yml deleted file mode 100644 index dc44b88..0000000 --- a/.github/workflows/quickget-tests.yml +++ /dev/null @@ -1,140 +0,0 @@ ---- # This is a basic workflow to help test quickget - -name: quickget tests - -# Controls when the action will run. -on: - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - # Build at 00:00 on every 12th day-of-month. - #schedule: - # - cron: "0 0 */12 * *" - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: '**' #'!master' # excludes master - paths: [ quickget ] - pull_request: - branches: '**' # matches every branch - paths: - - quickget - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - job1: - name: All supported - runs-on: ubuntu-latest - # The type of runner that the job will run on - #runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 - - name: List all supported OS variants - run: | - mkdir -p results - echo -e "\n\n Supported:\n\n" - ./quickget -l | tee results/supported.txt - echo -e "\n\nAll supported OS variants: $(cat results/supported.txt | wc -l)" - echo -e "\n\n Finished\n\n" - - - uses: actions/upload-artifact@v4 - with: - name: supported - path: results/supported.txt - - job2: - name: All info - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Show info about all OS - run: | - export TERM=xterm-256color - #sudo apt install -y neofetch - #echo -e "\n\n" - #neofetch - #echo -e "\n\n" - echo -e "\n\n OSinfo:\n\n" - distros="$(./quickget | sed '/^$/q' | tail -n +3)" - mkdir -p results - for os in ${distros}; do - echo -e "\n\n ${os}" && ./quickget -12345 "${os}" | tee -a results/infos.txt - done - echo -e "\n\nHomepages aka number of supported OS (os_info): $(cat results/infos.txt | grep 'http' | wc -l)" - echo -e "\n\n Finished\n\n" - - - uses: actions/upload-artifact@v4 - with: - name: infos - path: results/infos.txt - - job3: - needs: [job1] - name: All URLs - runs-on: ubuntu-latest - steps: - - uses: actions/download-artifact@v4 - with: - path: results - merge-multiple: true - - name: Display downloaded artifacts - run: ls -R results/ - - - uses: actions/checkout@v4 - - name: List all supported systems download URLs - run: | - export TERM=xterm-256color - distros="$(./quickget | sed '/^$/q' | tail -n +3)" - echo -e "\n\n ISOs:\n\n" - mkdir -p results - for os in ${distros}; do - echo -e "\n\n ${os}" && ./quickget -u "${os}" | tee -a results/urls.txt - done - echo -e "\n\nFounded/All URLs: $(cat results/urls.txt | grep 'http' | wc -l)/$(cat results/supported.txt | wc -l)" - echo -e "\n\n Finished\n\n" - - - uses: actions/upload-artifact@v4 - with: - name: urls - path: results/urls.txt - - job4: - name: All checks - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Checking if all downloads for Operating Systems are available... - run: | - export TERM=xterm-256color - distros="$(./quickget | sed '/^$/q' | tail -n +3)" - echo -e "\n\n ISOs availability:\n\n" - mkdir -p results - for os in ${distros}; do - echo -e "\n\n ${os}" && ./quickget -c "${os}" | tee -a results/checks.txt - done - ALL=$(cat results/checks.txt | grep 'http' | wc -l) - FAILED=$(grep -c 'FAIL:' results/checks.txt) - SKIPED=$(grep -c 'SKIP:' results/checks.txt) - PASSED=$(grep -c 'PASS:' results/checks.txt) - CHECKED=$(($FAILED + $SKIPED + $PASSED)) - echo -e "\n\nFAILED: $FAILED" - echo "SKIPED: $SKIPED" - echo "PASSED: $PASSED" - echo "All/Checked: $ALL/$CHECKED" - echo -e "Failed:\n$(grep 'FAIL:' results/checks.txt | tee -a results/failed.txt)" - echo -e "\n\n Finished\n\n" - - - uses: actions/upload-artifact@v4 - with: - name: checks - path: results/checks.txt - - - - uses: actions/upload-artifact@v4 - with: - name: failed - path: results/failed.txt \ No newline at end of file diff --git a/.github/workflows/test-quickget.yml b/.github/workflows/test-quickget.yml index 70c917a..0b63c7c 100644 --- a/.github/workflows/test-quickget.yml +++ b/.github/workflows/test-quickget.yml @@ -4,101 +4,105 @@ on: workflow_dispatch: push: branches: '**' - paths: [ quickget ] + paths: + - quickget pull_request: branches: '**' - paths: [ quickget ] - + paths: + - quickget concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: list-all-supported: - name: "List all supported OS 📝" + name: List all supported OS 📝 runs-on: ubuntu-22.04 - # The type of runner that the job will run on - #runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v4 - - name: "List all supported OS variants" + - name: List all supported OS variants run: | mkdir -p results - ./quickget --list | tee results/supported.txt - echo -e "\nResults:" - echo "- All supported OS variants: $(wc -l results/supported.txt | cut -d' ' -f 1)" + ./quickget --list | tee -a results/supported.txt + echo -e "\nAll supported OS variants: $(wc -l results/supported.txt)" - uses: actions/upload-artifact@v4 with: name: supported path: results/supported.txt + retention-days: 1 list-all-info: - name: "List all OS info ℹ️" + name: List all OS info ℹ️ runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: Show info about all OS run: | - export TERM=xterm-256color + export TERM=xterm mkdir -p results - for os in $(./quickget | sed '/^$/q' | tail -n +3); do + distros=$(./quickget | sed '/^$/q' | tail -n +3) + for os in ${distros}; do + echo -e "\n\n ${os}" ./quickget -12345 "${os}" | tee -a results/infos.txt done - echo -e "\nResults:" - echo -e "- OS Info URLs: $(grep -c http results/infos.txt)" + echo -e "\nOS info: $(grep -c "http" results/infos.txt)" - uses: actions/upload-artifact@v4 with: name: infos path: results/infos.txt + retention-days: 1 list-all-urls: needs: [list-all-supported] - name: "List all URLs 🔗" + name: List all URLs 🔗 runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - - name: "quickget --url" + - name: quickget --url run: | - export TERM=xterm-256color + export TERM=xterm mkdir -p results - ./quickget --url | tee results/urls.txt + ./quickget -u | tee -a url.txt + sort < url.txt > results/urls.txt - uses: actions/download-artifact@v4 with: path: results merge-multiple: true - - name: "Show differences ⚖️" + - name: results run: | - echo -e "\nResults:" - echo -e "List All URLs:\t$(grep -c http results/urls.txt)" - echo -e "OS Info URLs:\t$(wc -l results/supported.txt | cut -d' ' -f 1)" + ls -R results/ + FOUND=$(grep -c 'http' < results/urls.txt) + ALL=$(wc -l < results/supported.txt) + echo -e "$FOUND/$ALL" - uses: actions/upload-artifact@v4 with: name: urls path: results/urls.txt check-all-urls: - name: "Check all image URLs 💿️" + name: Check all image URLs 💿️ runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - - name: "quickget --check" + - name: quickget --check run: | - export TERM=xterm-256color + export TERM=xterm mkdir -p results - ./quickget --check | tee results/checks.txt - WINDOWS=$(grep -c "windows-" results/checks.txt) - FAILED=$(grep -c ^FAIL results/checks.txt) - SKIPPED=$(grep -c ^SKIP results/checks.txt) - PASSED=$(grep -c ^PASS results/checks.txt) + ./quickget --check | tee -a check.txt + cat check.txt | sort > results/checks.txt + GOOD=$(grep -c 'http' results/checks.txt) + WINDOWS=$(grep -c 'windows' results/checks.txt) + ALL=$((GOOD + WINDOWS)) + FAILED=$(grep -c 'FAIL:' results/checks.txt) + SKIPPED=$(grep -c 'SKIP:' results/checks.txt) + PASSED=$(grep -c 'PASS:' results/checks.txt) CHECKED=$((FAILED + SKIPPED + PASSED)) - echo -e "\nResults:" - echo -e "- PASSED:\t${PASSED}" - echo -e "- SKIPPED:\t${SKIPPED}\t(of which ${WINDOWS} are Windows)" - echo -e "- FAILED:\t${FAILED}\n" - grep ^FAIL results/checks.txt | tee results/failed.txt + FAIL=$(grep 'FAIL:' results/checks.txt | tee -a results/failed.txt) + echo -e "\nFAILED: $FAILED" + echo "SKIPPED: $SKIPPED" + echo "PASSED: $PASSED" + echo "$CHECKED/$ALL with skipped Windows" + echo -e "Failed:\n$FAIL" - uses: actions/upload-artifact@v4 with: name: checks @@ -110,14 +114,14 @@ jobs: upload-artifacts: needs: [list-all-info, list-all-urls, check-all-urls] - name: "Uploading artifacts" + name: Uploading artifacts runs-on: ubuntu-22.04 steps: - uses: actions/download-artifact@v4 with: path: results merge-multiple: true - - name: "List results" + - name: results run: | ls -R results/ - uses: actions/upload-artifact@v4 From e98499fd82468779feb6b3e3c7f361a09736f780 Mon Sep 17 00:00:00 2001 From: zen0bit Date: Sat, 4 May 2024 03:12:24 +0200 Subject: [PATCH 16/17] CI: Add YAML check --- .github/workflows/lint-yaml.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/lint-yaml.yml diff --git a/.github/workflows/lint-yaml.yml b/.github/workflows/lint-yaml.yml new file mode 100644 index 0000000..ef619f2 --- /dev/null +++ b/.github/workflows/lint-yaml.yml @@ -0,0 +1,24 @@ +--- +name: 🐶 YAML check 🧪 +on: + push: + branches: '**' + pull_request: + branches: '**' + workflow_dispatch: +jobs: + yamllint: + name: yaml lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: haya14busa/action-cond@v1 + id: reporter + with: + cond: ${{ github.event_name == 'pull_request' }} + - uses: reviewdog/action-yamllint@v1 + with: + reporter: ${{ steps.reporter.outputs.value }} + github_token: ${{ secrets.github_token }} + yamllint_flags: '-d relaxed .github/' + level: error From 2aa621165b295ab562cb4a8225ed1f5081570f57 Mon Sep 17 00:00:00 2001 From: zen0bit Date: Sat, 4 May 2024 03:12:53 +0200 Subject: [PATCH 17/17] CI: Add SHELL check --- .github/workflows/lint-shell.yml | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/lint-shell.yml diff --git a/.github/workflows/lint-shell.yml b/.github/workflows/lint-shell.yml new file mode 100644 index 0000000..d397128 --- /dev/null +++ b/.github/workflows/lint-shell.yml @@ -0,0 +1,33 @@ +--- +name: 🐶 SHELL check 🧪 +on: + push: + branches: '**' + pull_request: + branches: '**' + workflow_dispatch: + +jobs: + reviewdog: + permissions: + checks: write + contents: read + pull-requests: write + name: shellcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: haya14busa/action-cond@v1 + id: reporter + with: + cond: ${{ github.event_name == 'pull_request' }} + + - uses: reviewdog/action-shellcheck@v1 + with: + reporter: ${{ steps.reporter.outputs.value }} + github_token: ${{ secrets.github_token }} + path: "." + check_all_files_with_shebangs: true + level: error + shellcheck_flags: '--external-sources --severity=error'