# Template file for 'pureos' OSNAME="pureos" PRETTY="PureOS" LOGO="" ICON="pureos.svg" ICON_ONLINE="" CATEGORY="advanced" BASEDOF="Debian" DESCRIPTION="Fully free/libre and open source GNU/Linux operating system, endorsed by the Free Software Foundation" HOMEPAGE="https://www.pureos.net" CREDENTIALS="-" GPG="" RSS="" DW="" MAGNET="" MAGNET_PREFERRED="" TORRENT="" CHAT="" RELEASES="11" EDITIONS="gnome plasma" EDITIONS_LIST="gnome plasma" QEMU_ARCH="amd64" releases_() { local url iso_ver url=$(web_pipe "https://www.pureos.net/download/" \ | grep -oP 'pureos-\K[0-9]+(?=-gnome-live-)' \ | head -1) [ -n "$url" ] && echo "$url" } editions_() { # Editions are listed as separate download links on the page. web_pipe "https://www.pureos.net/download/" \ | grep -oP 'pureos-[0-9]+-\K[^-]+(?=-live-)' \ | sort -u } get_() { local iso_url codename ver_date version edition build_date iso_url=$(web_pipe "https://www.pureos.net/download/" \ | grep -oP 'href="\Khttps://storage[^"]*\.iso[^"]*' \ | head -1) [ -z "$iso_url" ] && return # Parse URL components: .../images/{CODENAME}/{YYYY.MM}/{EDITION}/pureos-{VERSION}-{EDITION}-live-{YYYYMMDD}_amd64.iso # cut -d'/' fields: 1=https: 2='' 3=host 4=pureos 5=images 6=codename 7=ver_date 8=edition 9=filename codename=$(echo "$iso_url" | cut -d'/' -f6) ver_date=$(echo "$iso_url" | cut -d'/' -f7) edition=$(echo "$iso_url" | cut -d'/' -f8) version=$(echo "$iso_url" | grep -oP 'pureos-\K[0-9]+(?=-)') build_date=$(echo "$iso_url" | grep -oP 'live-\K[0-9]+(?=_amd64)') # Reconstruct the URL using the requested RELEASE version and EDITION. # EDITION is set by get_entries_ loop; RELEASE is the PureOS major version. local iso_name="pureos-${version}-${EDITION}-live-${build_date}_amd64.iso" local url="https://storage.puri.sm/pureos/images/${codename}/${ver_date}/${EDITION}/${iso_name}" local hash_url="https://storage.puri.sm/pureos/images/${codename}/${ver_date}/${EDITION}/${iso_name%.iso}.checksums_sha256.txt" local hash hash=$(web_pipe "$hash_url" 2>/dev/null \ | grep -m1 "\.iso$" | awk '{print $1}') [ -n "$url" ] && echo "${url} ${hash}" } releases_() { # Releases parsed at generation time — no network access needed. echo "${RELEASES}" } editions_() { # Editions parsed at generation time — no network access needed. local _scoped="" if [ -n "${RELEASE:-}" ] && declare -F _release_editions_ >/dev/null; then _scoped=$(_release_editions_ "${ARCH:-}|${RELEASE}") fi if [ -n "${_scoped}" ]; then echo "${_scoped}" return 0 fi local _per_arch="EDITIONS_${ARCH:-}" if [ -n "${!_per_arch:-}" ]; then echo "${!_per_arch}" return 0 fi echo "${EDITIONS:-}" }