1 Commits

Author SHA256 Message Date
ed100541ba Merge pull request 'Factory' (#1) from factory into main 2025-10-08 12:55:56 +02:00
2 changed files with 21 additions and 20 deletions

View File

@@ -1,14 +1,3 @@
-------------------------------------------------------------------
Tue Jan 27 14:12:22 UTC 2026 - Richard Biener <rguenther@suse.com>
- Improve go/gofmt alternative removal upon migration to an
alternative-less system.
-------------------------------------------------------------------
Fri Dec 5 07:33:47 UTC 2025 - Richard Biener <rguenther@suse.com>
- Remove go/gofmt alternatives. [bsc#1245878]
-------------------------------------------------------------------
Wed May 7 11:27:11 UTC 2025 - Richard Biener <rguenther@suse.com>

View File

@@ -469,8 +469,8 @@ Conflicts: gcc-go
%endif
Requires: gcc%{gcc_version}-go
Requires: gcc%{gccsuffix} = %{version}
OrderWithRequires(pre): update-alternatives
Suggests: update-alternatives
Requires(post): update-alternatives
Requires(postun): update-alternatives
%description -n gcc%{gccsuffix}-go
The system GNU Go Compiler.
@@ -660,9 +660,10 @@ for program in \
; do
ln -sf $program-%{gcc_suffix} $RPM_BUILD_ROOT%{_prefix}/bin/$program
done
# Do not add a gofmt link from gofmt-%{gcc_suffix} since that conflicts with
# the golang libalternatives version of this. Do not use gccgofmt either,
# that's nonstandard and not expected by anyone.
# For go and gofmt use alternatives since they are shared with golang
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
ln -sf %{_sysconfdir}/alternatives/go %{buildroot}%{_bindir}/go
ln -sf %{_sysconfdir}/alternatives/gofmt %{buildroot}%{_bindir}/gofmt
# Link section 1 manpages
for man1 in \
gcc gcov gcov-dump gcov-tool lto-dump \
@@ -705,10 +706,17 @@ ln -sf gcc-%{gcc_suffix}.1.gz $RPM_BUILD_ROOT%{_mandir}/man1/cc.1.gz
mkdir -p $RPM_BUILD_ROOT%{_libdir}/bfd-plugins
ln -s `gcc-%{gcc_suffix} -print-file-name=liblto_plugin.so` $RPM_BUILD_ROOT%{_libdir}/bfd-plugins/liblto_plugin.so
# We no longer register go/gofmt alternatives for gcc-go, but remove
# any existing one on upgrade if it still exists
%pre -n gcc%{gccsuffix}-go
if [ $1 -eq 2 ] && [ -f %{_sysconfdir}/alternatives/go ] ; then
%post -n gcc%{gccsuffix}-go
# we don't want a BuildRequires on gccN-go but otherwise the install
# step of the build fails, so simply skip the script when gccN-go isn't there
if [ -f %{_bindir}/go-%{gcc_suffix} ] ; then
update-alternatives \
--install %{_bindir}/go go %{_bindir}/go-%{gcc_suffix} 100 \
--slave %{_bindir}/gofmt gofmt %{_bindir}/gofmt-%{gcc_suffix}
fi
%postun -n gcc%{gccsuffix}-go
if [ $1 -eq 0 ] ; then
update-alternatives --remove go %{_bindir}/go-%{gcc_suffix}
fi
@@ -805,6 +813,10 @@ fi
%files -n gcc%{gccsuffix}-go
%defattr(-,root,root)
%{_bindir}/gccgo
%{_bindir}/go
%{_bindir}/gofmt
%ghost %{_sysconfdir}/alternatives/go
%ghost %{_sysconfdir}/alternatives/gofmt
%doc %{_mandir}/man1/gccgo.1.gz
%if %{build_d}