From 44c8de82c74001d85ac76ba88b653d82e2e9bd11 Mon Sep 17 00:00:00 2001 From: Elysia <1391048988@qq.com> Date: Sat, 8 Nov 2025 13:39:25 +0800 Subject: [PATCH] Adjust the code structure. --- sdata/dist-fedora/install-deps.sh | 21 ++++++++++++++++++++- sdata/dist-fedora/install-setups.sh | 17 ----------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/sdata/dist-fedora/install-deps.sh b/sdata/dist-fedora/install-deps.sh index 47e4e5767..21022a249 100644 --- a/sdata/dist-fedora/install-deps.sh +++ b/sdata/dist-fedora/install-deps.sh @@ -91,4 +91,23 @@ v sudo dnf install upower wtype ydotool -y v sudo dnf install fuzzel glib2 ImageMagick hypridle hyprlock hyprpicker songrec translate-shell wlogout -y # Extra -v sudo dnf install --setopt="install_weak_deps=False" mpvpaper plasma-systemmonitor unzip -y \ No newline at end of file +v sudo dnf install --setopt="install_weak_deps=False" mpvpaper plasma-systemmonitor unzip -y + +# Start building the missing RPM package locally. +install_RPMS() { + rpmbuildroot=${REPO_ROOT}/cache/rpmbuild + x mkdir -p $rpmbuildroot/{BUILD,RPMS,SOURCES} + x cp -r ${REPO_ROOT}/sdata/dist-fedora/SPECS $rpmbuildroot/ + x cd $rpmbuildroot/SPECS + mapfile -t -d '' local_specs < <(find "$rpmbuildroot/SPECS" -maxdepth 1 -type f -name "*.spec" -print0) + for spec_file in ${local_specs[@]}; do + x rpmbuild -bb --define "_topdir $rpmbuildroot" $spec_file + done + mapfile -t -d '' local_rpms < <(find "$rpmbuildroot/RPMS" -maxdepth 2 -type f -name '*.rpm' -not -name '*debug*' -print0) + echo "${STY_BLUE}Next command:${STY_RST} sudo dnf install ${local_rpms[@]} -y" + x sudo dnf install "${local_rpms[@]}" -y + x cd ${REPO_ROOT} +} + +showfun install_RPMS +v install_RPMS diff --git a/sdata/dist-fedora/install-setups.sh b/sdata/dist-fedora/install-setups.sh index 797cad9eb..eb135d420 100644 --- a/sdata/dist-fedora/install-setups.sh +++ b/sdata/dist-fedora/install-setups.sh @@ -1,23 +1,6 @@ # This script is meant to be sourced. # It's not for directly running. -# Start building the missing RPM package locally. -install_RPMS() { - rpmbuildroot=${REPO_ROOT}/sdata/dist-fedora - x mkdir $rpmbuildroot/{BUILD,RPMS,SOURCES} - x cd $rpmbuildroot/SPECS - mapfile -t -d '' local_specs < <(find "$rpmbuildroot/SPECS" -maxdepth 1 -type f -name "*.spec" -print0) - for spec_file in ${local_specs[@]}; do - x rpmbuild -bb --define "_topdir $rpmbuildroot" $spec_file - done - mapfile -t -d '' local_rpms < <(find "$rpmbuildroot/RPMS" -maxdepth 2 -type f -name '*.rpm' -not -name '*debug*' -print0) - x sudo dnf install "${local_rpms[@]}" -y - cd ${REPO_ROOT} -} - -showfun install_RPMS -v install_RPMS - ##################################################################################### # These python packages are installed using uv into the venv (virtual environment). Once the folder of the venv gets deleted, they are all gone cleanly. So it's considered as setups, not dependencies. showfun install-python-packages