diff --git a/cd.sh b/cd.sh index a1b2398..69d4f12 100644 --- a/cd.sh +++ b/cd.sh @@ -45,12 +45,13 @@ cd_set_environment_variables () { "alpine") CD_OS_ID="${CD_OS_ALPINE}" ;; "arch") CD_OS_ID="${CD_OS_ARCH}" ;; "debian") CD_OS_ID="${CD_OS_DEBIAN}" ;; + "fedora") CD_OS_ID="${CD_OS_FEDORA}" ;; "rocky") CD_OS_ID="${CD_OS_ROCKY}" ;; "ubuntu") CD_OS_ID="${CD_OS_UBUNTU}" ;; *) cd_error_os "CD_OS_ID" ;; esac case "${CD_OS_ID}" in - "${CD_OS_ALMA}"|"${CD_OS_ARCH}"|"${CD_OS_ROCKY}") + "${CD_OS_ALMA}"|"${CD_OS_ARCH}"|"${CD_OS_FEDORA}"|"${CD_OS_ROCKY}") CD_OS_VERSION=$(cd_grep_os VERSION_ID \ | sed "s|^\([0-9]\+\)\..*|\1|") ;; @@ -87,6 +88,12 @@ cd_set_environment_variables () { *) cd_error_os "CD_OS_VERSION" ;; esac ;; + "${CD_OS_FEDORA}") + case "${CD_OS_VERSION}" in + "39"|"40") ;; + *) cd_error_os "CD_OS_VERSION" ;; + esac + ;; "${CD_OS_UBUNTU}") case "${CD_OS_VERSION}" in "mantic"|"noble") ;; @@ -102,7 +109,7 @@ cd_set_environment_variables () { cd_echo "CD_DNS_FILE" "CD_PKG_CA" "CD_PKG_GIT" # shared case "${CD_OS_ID}" in - "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") + "${CD_OS_ALMA}"|"${CD_OS_FEDORA}"|"${CD_OS_ROCKY}") CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" CD_CMD_CA="update-ca-trust" ;; @@ -119,7 +126,7 @@ cd_set_environment_variables () { cd_echo "CD_CA_ROOT" "CD_CMD_CA" # common case "${CD_OS_ID}" in - "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") + "${CD_OS_ALMA}"|"${CD_OS_FEDORA}"|"${CD_OS_ROCKY}") CD_CMD_CLEAN="dnf clean all" CD_CMD_INSTALL="dnf install --assumeyes" CD_CMD_QUERY="rpm --query" @@ -201,6 +208,9 @@ Dir::Etc::SourceParts \"\"; "${CD_OS_DEBIAN}") CD_URL_DEFAULT="http://deb.debian.org/debian" ;; + "${CD_OS_FEDORA}") + CD_URL_DEFAULT="http://download.example/pub/fedora/linux/releases" + ;; "${CD_OS_ROCKY}") CD_URL_DEFAULT="http://dl.rockylinux.org/\$contentdir" ;; @@ -220,6 +230,10 @@ Dir::Etc::SourceParts \"\"; [ "${CD_URL_DEBIAN}" ] && CD_URL_CHOSEN="${CD_URL_DEBIAN}" \ || CD_URL_CHOSEN="https://deb.debian.org/debian" ;; + "${CD_OS_FEDORA}") + [ "${CD_URL_FEDORA}" ] && CD_URL_CHOSEN="${CD_URL_FEDORA}" \ + || CD_URL_CHOSEN="https://rpmfind.net/linux/fedora/linux/releases" + ;; "${CD_OS_ROCKY}") [ "${CD_URL_ROCKY}" ] && CD_URL_CHOSEN="${CD_URL_ROCKY}" \ || CD_URL_CHOSEN="https://dl.rockylinux.org/\$contentdir" @@ -256,6 +270,11 @@ Dir::Etc::SourceParts \"\"; CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" ;; + "${CD_OS_FEDORA}") + CD_PYTHON_COMMAND="python3.12" + CD_PYTHON_PACKAGE="python3" + CD_PYTHON_PACKAGES="/usr/lib64/python3.12/site-packages" + ;; "${CD_OS_UBUNTU}") case "${CD_OS_VERSION}" in "noble") CD_PYTHON_COMMAND="python3.12" ;; @@ -634,6 +653,7 @@ CD_OS_ALMA="alma" CD_OS_ALPINE="alpine" CD_OS_ARCH="arch" CD_OS_DEBIAN="debian" +CD_OS_FEDORA="fedora" CD_OS_ROCKY="rocky" CD_OS_UBUNTU="ubuntu" diff --git a/readme.md b/readme.md index 0ec7612..1fbd687 100644 --- a/readme.md +++ b/readme.md @@ -37,7 +37,7 @@ from various CA, CI, OCI / OS. * [X] Python * [X] 3.9 (Debian Bullseye) * [X] 3.11 (Alma, Alpine, Debian Bookworm, Rocky, Ubuntu Mantic) - * [X] 3.12 (Arch, Ubuntu Noble) + * [X] 3.12 (Arch, Fedora, Ubuntu Noble) ## How @@ -49,6 +49,7 @@ from various CA, CI, OCI / OS. | CD_URL_ALPINE | Alpine repository URL | | CD_URL_ARCH | Arch repository URL | | CD_URL_DEBIAN | Debian repository URL | +| CD_URL_FEDORA | Fedora repository URL | | CD_URL_ROCKY | Rocky repository URL | | CD_URL_UBUNTU | Ubuntu repository URL |