- Corrected golang.spec to use --no-backup-if-mismatch to avoid creating .orig files

- Resolves: RHEL-34671
This commit is contained in:
Archana 2024-05-13 21:42:32 +05:30
parent aa99fe1654
commit c9d6351079

View File

@ -111,7 +111,7 @@
%global pkg_release 1 %global pkg_release 1
# For rpmdev-bumpspec and releng automation. # For rpmdev-bumpspec and releng automation.
%global baserelease 2 %global baserelease 3
Name: golang Name: golang
Version: %{go_version} Version: %{go_version}
@ -327,20 +327,12 @@ cp %{SOURCE2} ./src/runtime/
popd popd
# TODO Check here, this is failing due to the external linker flag? maybe, but it's clearly related to that according tho this commit: # TODO Check here, this is failing due to the external linker flag? maybe, but it's clearly related to that according tho this commit:
# https://github.com/golang-fips/go/blob/main/patches/000-initial-setup.patch#L48 # https://github.com/golang-fips/go/blob/main/patches/000-initial-setup.patch#L48
patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/000-initial-setup.patch # Add --no-backup-if-mismatch option to avoid creating .orig temp files
patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/001-initial-openssl-for-fips.patch patch_dir="../go-go%{version}-%{pkg_release}-openssl-fips/patches"
patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/002-strict-fips-runtime-detection.patch for p in "$patch_dir"/*.patch; do
patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/003-init-openssl-v2-backend.patch echo "Applying $p"
patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/004-fixes.patch patch --no-backup-if-mismatch -p1 < $p
patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/005-fixes-2.patch done
patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/006-fixes-3.patch
patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/007-fixes-4.patch
patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/008-fixes-5.patch
patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/009-fixes-6.patch
patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/010-fixes-7.patch
patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/011-122-fixes.patch
patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/012-fixes.patch
patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/013-fixes.patch
# Configure crypto tests # Configure crypto tests
echo "Configure crypto tests" echo "Configure crypto tests"
@ -349,8 +341,6 @@ cp %{SOURCE2} ./src/runtime/
./scripts/configure-crypto-tests.sh ./scripts/configure-crypto-tests.sh
popd popd
%endif %endif
# Remove all .orig files if they are generated during patching
find -name "*.orig" -exec rm {} \;
%build %build
# -x: print commands as they are executed # -x: print commands as they are executed