fedora: Install packages right after building (#3273)

This commit is contained in:
Celestial.y
2026-05-05 07:12:02 +08:00
committed by GitHub
2 changed files with 9 additions and 7 deletions
+1
View File
@@ -18,6 +18,7 @@ BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: ninja-build
BuildRequires: libunwind-devel
%description
C++ lightweight logging library used by Quickshell.
+8 -7
View File
@@ -45,7 +45,9 @@ function install_RPMS() {
spec="$rpm_specs/$package.spec"
installed_rpm_stamp=$(rpm -q --qf '%{NVRA}\n' "$package" 2>/dev/null || true)
spec_stamp=$(rpmspec -q --qf '%{NVRA}\n' "$spec")
arch=$(rpm --eval "%_arch") # if we somehow want aarch64??
built_rpm_path="$rpmbuildroot/RPMS/$arch/$spec_stamp.rpm"
[[ -f "$spec" ]] || {
echo "Missing spec: $spec"
continue
@@ -69,13 +71,12 @@ function install_RPMS() {
sudo dnf install -y $(basename "$spec" .spec)
nolock_qs=true
fi
done
mapfile -t -d '' local_rpms < <(find "$rpmbuildroot/RPMS" -maxdepth 2 -type f -name '*.rpm' -not -name '*debug*' -print0)
if [[ ${#local_rpms[@]} -ge 1 ]]; then
echo -e "${STY_BLUE}Next command:${STY_RST} sudo dnf install ${local_rpms[@]} -y"
r x sudo dnf install "${local_rpms[@]}" -y
fi
if [[ -f "$rpmbuildroot/RPMS/x86_64/$spec_stamp.rpm" ]]; then
echo -e "${STY_BLUE}Next command:${STY_RST} sudo dnf install $rpmbuildroot/RPMS/x86_64/$spec_stamp.rpm -y"
r x sudo dnf install "$rpmbuildroot/RPMS/x86_64/$spec_stamp.rpm" -y
fi
done
x cd ${REPO_ROOT}
}