Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package go1.22 for openSUSE:Factory checked 
in at 2026-06-09 14:14:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/go1.22 (Old)
 and      /work/SRC/openSUSE:Factory/.go1.22.new.2375 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "go1.22"

Tue Jun  9 14:14:36 2026 rev:22 rq:1358040 version:1.22.12

Changes:
--------
--- /work/SRC/openSUSE:Factory/go1.22/go1.22.changes    2025-08-16 
20:38:37.834368119 +0200
+++ /work/SRC/openSUSE:Factory/.go1.22.new.2375/go1.22.changes  2026-06-09 
14:15:19.056213343 +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.22 dependency on update-alternatives fixes bsc#1264391
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ go1.22.spec ++++++
--- /var/tmp/diff_new_pack.xWfz30/_old  2026-06-09 14:15:20.900289752 +0200
+++ /var/tmp/diff_new_pack.xWfz30/_new  2026-06-09 14:15:20.904289918 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package go1.22
 #
-# 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
@@ -51,6 +51,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 122
+
+# 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
@@ -124,8 +144,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}
@@ -136,6 +154,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
@@ -348,20 +373,45 @@
 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)
 find doc/ misc/ -type f -exec chmod 0644 '{}' +
+# remove markdown doc source templates new in go1.23
+# templates do not appear to be rendered markdown content
+rm -rf doc/{initial,next}
 # remove unwanted arch-dependant binaries (rpmlint warning)
 rm -rf misc/cgo/test/{_*,*.o,*.out,*.6,*.8}
 # prepare go-doc
@@ -372,16 +422,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
@@ -391,10 +453,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
@@ -406,6 +464,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}

Reply via email to