Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package go1.21 for openSUSE:Factory checked in at 2026-06-09 14:14:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/go1.21 (Old) and /work/SRC/openSUSE:Factory/.go1.21.new.2375 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "go1.21" Tue Jun 9 14:14:27 2026 rev:26 rq:1358036 version:1.21.13 Changes: -------- --- /work/SRC/openSUSE:Factory/go1.21/go1.21.changes 2025-10-10 17:08:36.555373294 +0200 +++ /work/SRC/openSUSE:Factory/.go1.21.new.2375/go1.21.changes 2026-06-09 14:15:10.311851025 +0200 @@ -1,0 +2,7 @@ +Thu Jun 4 11:32:39 UTC 2026 - Jeff Kowalczyk <[email protected]> + +- Packaging: Enable libalternatives for SLE16.1 and Tumbleweed + Refs boo#1245878 + * Drop go1.21 dependency on update-alternatives fixes bsc#1264390 + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ go1.21.spec ++++++ --- /var/tmp/diff_new_pack.4SNYFs/_old 2026-06-09 14:15:14.252014283 +0200 +++ /var/tmp/diff_new_pack.4SNYFs/_new 2026-06-09 14:15:14.264014781 +0200 @@ -1,7 +1,7 @@ # # spec file for package go1.21 # -# Copyright (c) 2025 SUSE LLC and contributors +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -80,6 +80,26 @@ # go_api or go_api-foo %define go_label %{go_api} +# go_libalternatives is the name for the libalternatives configuration file +# which denotes its priority and numbered as go_api sans dot separator +%define go_libalternatives 121 + +# with_libalternatives denotes whether or not libalternatives should be used +# if it is not used, then update-alternatives is used instead +%define with_libalternatives 0 +# Enable libalternatives for SLE16.1+ and Tumbleweed +%if 0%{suse_version} >= 1610 +%define with_libalternatives 1 +%endif + +# with_update_alternatives is automatically defined, based on the +# value of with_libalternatives +%if %{with_libalternatives} +%define with_update_alternatives 0 +%else +%define with_update_alternatives 1 +%endif + # shared library support %if "%{rpm_vercmp %{go_api} 1.5}" > "0" %ifarch %ix86 %arm x86_64 aarch64 @@ -158,8 +178,6 @@ %endif #BNC#818502 debug edit tool of rpm fails on i586 builds BuildRequires: rpm >= 4.11.1 -Requires(post): update-alternatives -Requires(postun): update-alternatives Requires: gcc Provides: go = %{version} Provides: go-devel = go%{version} @@ -170,6 +188,13 @@ Obsoletes: go-emacs <= 1.3.3 Obsoletes: go-vim <= 1.3.3 ExclusiveArch: %ix86 x86_64 %arm aarch64 ppc64 ppc64le s390x riscv64 loongarch64 +Requires(post): update-alternatives +%if %{with_libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(postun): update-alternatives +%endif %description Go is an expressive, concurrent, garbage collected systems programming language @@ -396,16 +421,38 @@ sed -i "s/lib/lib64/" $GOROOT/bin/gdbinit.d/go.gdb sed -i "s/\$go_label/%{go_label}/" $GOROOT/bin/gdbinit.d/go.gdb %endif +mkdir -p %{buildroot}%{_sysconfdir}/gdbinit.d # update-alternatives +%if %{with_update_alternatives} mkdir -p %{buildroot}%{_sysconfdir}/alternatives mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_sysconfdir}/profile.d -mkdir -p %{buildroot}%{_sysconfdir}/gdbinit.d touch %{buildroot}%{_sysconfdir}/alternatives/{go,gofmt,go.gdb} ln -sf %{_sysconfdir}/alternatives/go %{buildroot}%{_bindir}/go ln -sf %{_sysconfdir}/alternatives/gofmt %{buildroot}%{_bindir}/gofmt ln -sf %{_sysconfdir}/alternatives/go.gdb %{buildroot}%{_sysconfdir}/gdbinit.d/go.gdb +%endif + +# libalternatives +%if %{with_libalternatives} +ln -s %{_libdir}/go/%{go_label}/bin/gdbinit.d/go.gdb %{buildroot}%{_sysconfdir}/gdbinit.d/go%{go_label}.gdb + +mkdir -p %{buildroot}%{_bindir} + +ln -s %{_bindir}/alts %{buildroot}%{_bindir}/go +ln -s %{_bindir}/alts %{buildroot}%{_bindir}/gofmt +# create 'go' configuration file +mkdir -p %{buildroot}%{_datadir}/libalternatives/go +cat > %{buildroot}%{_datadir}/libalternatives/go/%{go_libalternatives}.conf <<EOF +binary=%{_libdir}/go/%{go_label}/bin/go +EOF +# create 'gofmt' configuration file +mkdir -p %{buildroot}%{_datadir}/libalternatives/gofmt +cat > %{buildroot}%{_datadir}/libalternatives/gofmt/%{go_libalternatives}.conf <<EOF +binary=%{_libdir}/go/%{go_label}/bin/gofmt +EOF +%endif # documentation and examples # fix documetation permissions (rpmlint warning) @@ -420,16 +467,28 @@ %fdupes -s %{buildroot}%{_prefix} %post - +%if %{with_update_alternatives} update-alternatives \ --install %{_bindir}/go go %{_libdir}/go/%{go_label}/bin/go $((20+$(echo %{go_label} | cut -d. -f2))) \ --slave %{_bindir}/gofmt gofmt %{_libdir}/go/%{go_label}/bin/gofmt \ --slave %{_sysconfdir}/gdbinit.d/go.gdb go.gdb %{_libdir}/go/%{go_label}/bin/gdbinit.d/go.gdb +%endif + +# this is invoked when a user is migrating from update-alternatives to +# libalternatives, hence why we always require update-alternatives +# during %post +%if %{with_libalternatives} +if [ $1 -eq 0 ] ; then + update-alternatives --remove go %{_libdir}/go/%{go_label}/bin/go +fi +%endif %postun +%if %{with_update_alternatives} if [ $1 -eq 0 ] ; then update-alternatives --remove go %{_libdir}/go/%{go_label}/bin/go fi +%endif %files %{_bindir}/go @@ -439,10 +498,6 @@ %dir %{_datadir}/go %{_datadir}/go/%{go_label} %dir %{_sysconfdir}/gdbinit.d/ -%config %{_sysconfdir}/gdbinit.d/go.gdb -%ghost %{_sysconfdir}/alternatives/go -%ghost %{_sysconfdir}/alternatives/gofmt -%ghost %{_sysconfdir}/alternatives/go.gdb %dir %{_docdir}/go %dir %{_docdir}/go/%{go_label} %doc %{_docdir}/go/%{go_label}/CONTRIBUTING.md @@ -454,6 +509,19 @@ %else %license %{_docdir}/go/%{go_label}/LICENSE %endif +%if %{with_libalternatives} +%config %{_sysconfdir}/gdbinit.d/go%{go_label}.gdb +%dir %{_datadir}/libalternatives/go +%{_datadir}/libalternatives/go/%{go_libalternatives}.conf +%dir %{_datadir}/libalternatives/gofmt +%{_datadir}/libalternatives/gofmt/%{go_libalternatives}.conf +%endif +%if %{with_update_alternatives} +%config %{_sysconfdir}/gdbinit.d/go.gdb +%ghost %{_sysconfdir}/alternatives/go +%ghost %{_sysconfdir}/alternatives/gofmt +%ghost %{_sysconfdir}/alternatives/go.gdb +%endif # We don't include TSAN in the main Go package. %ifarch %{tsan_arch}
