fedora: skip up to date packages while installing

This commit is contained in:
fb24m
2026-04-12 15:32:01 +04:00
parent 09ff686f18
commit eae36f4d4f
+31 -12
View File
@@ -28,27 +28,46 @@ function install_RPMS() {
local local_specs local_rpms local local_specs local_rpms
rpmbuildroot="${rpmbuildroot:-${REPO_ROOT}/cache/rpmbuild}" rpmbuildroot="${rpmbuildroot:-${REPO_ROOT}/cache/rpmbuild}"
x rm -rf "${REPO_ROOT}/cache/rpmbuild"
x mkdir -p "$rpmbuildroot"/{BUILD,RPMS,SOURCES} x mkdir -p "$rpmbuildroot"/{BUILD,RPMS,SOURCES}
x cp -r "${REPO_ROOT}/sdata/dist-fedora/SPECS" "$rpmbuildroot/" x cp -r "${REPO_ROOT}/sdata/dist-fedora/SPECS" "$rpmbuildroot/"
x cd $rpmbuildroot/SPECS x cd $rpmbuildroot/SPECS
# we need cpptrace BEFORE quickshell-git packages=(
local_specs=( "cpptrace"
"$rpm_specs/cpptrace.spec" "quickshell-git"
"$rpm_specs/quickshell-git.spec" "hyprland-qt-support"
"$rpm_specs/hyprland-qt-support.spec" "matugen"
"$rpm_specs/matugen.spec"
) )
for spec_file in ${local_specs[@]}; do for package in "${packages[@]}"; do
echo "start $package"
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")
[[ -f "$spec" ]] || {
echo "Missing spec: $spec"
continue
}
echo "rpm_specs=$rpm_specs"
echo "spec=$spec"
echo "spec_stamp=$spec_stamp"
if [[ "$installed_rpm_stamp" == "$spec_stamp" ]]; then
printf "$installed_rpm_stamp is installed and up to date. Skipping.\n"
continue
fi
# Download sources # Download sources
x spectool -g -C "$rpmbuildroot/SOURCES" "$spec_file" x spectool -g -C "$rpmbuildroot/SOURCES" "$spec"
# Install build dependencies # Install build dependencies
r x sudo dnf builddep -y "$spec_file" r x sudo dnf builddep -y "$spec"
# Build the RPM package locally. If it fails, download it from COPR. # Build the RPM package locally. If it fails, download it from COPR.
if ! rpmbuild -bb --define "_topdir $rpmbuildroot" --define "debug_package %{nil}" "$spec_file"; then if ! rpmbuild -bb --define "_topdir $rpmbuildroot" --define "debug_package %{nil}" "$spec"; then
printf "${STY_RED}Local build encountered an issue. Downloading $(basename "$spec_file" .spec) from COPR. Report the issue to Discussions pls.${STY_RST}\n" printf "${STY_RED}Local build encountered an issue. Downloading $(basename "$spec" .spec) from COPR. Report the issue to Discussions pls.${STY_RST}\n"
sudo dnf install -y $(basename "$spec_file" .spec) sudo dnf install -y $(basename "$spec" .spec)
nolock_qs=true nolock_qs=true
fi fi
done done