3 Commits

Author SHA256 Message Date
Richard Biener
175209bb2f - Improve go/gofmt alternative removal upon migration to an
alternative-less system.
2026-01-27 15:13:09 +01:00
Richard Biener
3f7bae42d0 Fix typo in comment 2025-12-05 14:51:42 +01:00
Richard Biener
6f45f8905d - Remove go/gofmt alternatives. [bsc#1245878] 2025-12-05 08:38:41 +01:00
2 changed files with 20 additions and 21 deletions

View File

@@ -1,3 +1,14 @@
-------------------------------------------------------------------
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}
Requires(post): update-alternatives
Requires(postun): update-alternatives
OrderWithRequires(pre): update-alternatives
Suggests: update-alternatives
%description -n gcc%{gccsuffix}-go
The system GNU Go Compiler.
@@ -660,10 +660,9 @@ for program in \
; do
ln -sf $program-%{gcc_suffix} $RPM_BUILD_ROOT%{_prefix}/bin/$program
done
# 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
# 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.
# Link section 1 manpages
for man1 in \
gcc gcov gcov-dump gcov-tool lto-dump \
@@ -706,17 +705,10 @@ 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
%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
# 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
update-alternatives --remove go %{_bindir}/go-%{gcc_suffix}
fi
@@ -813,10 +805,6 @@ 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}