Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package java-17-openjdk for openSUSE:Factory 
checked in at 2026-05-29 18:09:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/java-17-openjdk (Old)
 and      /work/SRC/openSUSE:Factory/.java-17-openjdk.new.1937 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "java-17-openjdk"

Fri May 29 18:09:40 2026 rev:47 rq:1355809 version:17.0.19.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/java-17-openjdk/java-17-openjdk.changes  
2026-04-28 11:59:32.889418650 +0200
+++ 
/work/SRC/openSUSE:Factory/.java-17-openjdk.new.1937/java-17-openjdk.changes    
    2026-05-29 18:11:05.732363030 +0200
@@ -1,0 +2,12 @@
+Fri May 29 07:15:04 UTC 2026 - Fridrich Strba <[email protected]>
+
+- Use libalternatives instead of update-alternatives for
+  distributions where libalternatives is available
+
+-------------------------------------------------------------------
+Fri May 29 07:11:31 UTC 2026 - Fridrich Strba <[email protected]>
+
+- Use libalternatives instead of update-alternatives for
+  distributions where libalternatives is available (bsc#1264396)
+
+-------------------------------------------------------------------

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

Other differences:
------------------
++++++ java-17-openjdk.spec ++++++
--- /var/tmp/diff_new_pack.IIs6ne/_old  2026-05-29 18:11:06.972414391 +0200
+++ /var/tmp/diff_new_pack.IIs6ne/_new  2026-05-29 18:11:06.976414558 +0200
@@ -23,6 +23,10 @@
 %global make make
 %global is_release 1
 %global buildoutputdir build
+%global headless_binaries java keytool rmiregistry
+%global headless_binaries_comma %(echo %{headless_binaries} | sed 's#\ #,#g')
+%global devel_binaries javac jar jarsigner javadoc javap jcmd jconsole jdb 
jdeprscan jdeps jimage jinfo jlink jmap jmod jps jpackage jrunscript jshell 
jstack jstat jstatd serialver
+%global devel_binaries_comma %(echo %{devel_binaries} | sed 's#\ #,#g')
 # Convert an absolute path to a relative path.  Each symbolic link is
 # specified relative to the directory in which it is installed so that
 # it will resolve properly within chrooted installations.
@@ -38,6 +42,11 @@
 %global openjdk_repo    jdk17u
 %global openjdk_tag     
jdk-%{featurever}.%{interimver}.%{updatever}%{?patchver:.%{patchver}}+%{buildver}
 %global openjdk_dir     
%{openjdk_repo}-jdk-%{featurever}.%{interimver}.%{updatever}%{?patchver:.%{patchver}}-%{buildver}
+%if 0%{?suse_version} > 1500
+%bcond_without libalternatives
+%else
+%bcond_with libalternatives
+%endif
 # priority must be 6 digits in total
 %if 0%{?suse_version} > 1315 || 0%{?java_bootstrap}
 %global priority        2705
@@ -280,12 +289,8 @@
 Group:          Development/Languages/Java
 Requires:       jpackage-utils
 Requires:       mozilla-nss
-# Post requires update-alternatives to install tool update-alternatives.
-Requires(post): update-alternatives
 Requires(posttrans): file
 Requires(posttrans): java-ca-certificates
-# Postun requires update-alternatives to uninstall tool update-alternatives.
-Requires(postun): update-alternatives
 Recommends:     mozilla-nss-sysinit
 Obsoletes:      %{name}-accessibility
 Provides:       timezone-java
@@ -311,6 +316,12 @@
 Provides:       jndi-rmi = %{version}
 Provides:       jsse = %{version}
 %endif
+%if %{without libalternatives}
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
+%else
+Requires:       alts
+%endif
 
 %description headless
 The OpenJDK %{featurever} runtime environment without audio and video support.
@@ -320,10 +331,6 @@
 # Require base package.
 Group:          Development/Languages/Java
 Requires:       %{name} = %{version}-%{release}
-# Post requires update-alternatives to install tool update-alternatives.
-Requires(post): update-alternatives
-# Postun requires update-alternatives to uninstall tool update-alternatives.
-Requires(postun): update-alternatives
 %if 0%{?suse_version} > 1315 || 0%{?java_bootstrap}
 # Standard JPackage devel provides.
 Provides:       java-%{javaver}-devel = %{version}
@@ -334,6 +341,12 @@
 Provides:       java-sdk-%{javaver}-openjdk = %{version}
 Provides:       java-sdk-openjdk = %{version}
 %endif
+%if %{without libalternatives}
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
+%else
+Requires:       alts
+%endif
 
 %description devel
 The OpenJDK %{featurever} development tools.
@@ -366,16 +379,16 @@
 Summary:        OpenJDK %{featurever} API Documentation
 Group:          Development/Languages/Java
 Requires:       jpackage-utils
-# Post requires update-alternatives to install javadoc alternative.
-Requires(post): update-alternatives
-# Postun requires update-alternatives to uninstall javadoc alternative.
-Requires(postun): update-alternatives
 BuildArch:      noarch
 %if 0%{?suse_version} > 1315 || 0%{?java_bootstrap}
 # Standard JPackage javadoc provides.
 Provides:       java-%{javaver}-javadoc = %{version}-%{release}
 Provides:       java-javadoc = %{version}-%{release}
 %endif
+%if %{without libalternatives}
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
+%endif
 
 %description javadoc
 The OpenJDK %{featurever} API documentation.
@@ -662,8 +675,42 @@
 %fdupes -s %{buildroot}/%{_jvmdir}/%{sdkdir}/demo
 %fdupes -s %{buildroot}%{_javadocdir}/%{sdklnk}
 
+touch .mfiles-headless
+touch .mfiles-devel
+
+%if %{with libalternatives}
+
+%if 0%{?priority} == 0
+%define priority %{featurever}
+%endif
+
+for i in %{headless_binaries}; do
+  install -dm 0755 %{buildroot}%{_datadir}/libalternatives/${i}
+  echo "%%dir %{_datadir}/libalternatives/${i}" >> .mfiles-headless
+  echo "binary=%{jrebindir}/${i}" >> 
%{buildroot}%{_datadir}/libalternatives/${i}/%{priority}.conf
+  echo "man=${i}-%{sdklnk}.1$ext" >> 
%{buildroot}%{_datadir}/libalternatives/${i}/%{priority}.conf
+  echo "group=%{headless_binaries_comma}" >> 
%{buildroot}%{_datadir}/libalternatives/${i}/%{priority}.conf
+  echo "%{_datadir}/libalternatives/${i}/%{priority}.conf" >> .mfiles-headless
+  echo "%%ghost %{_bindir}/${i}" >> .mfiles-headless
+done
+
+for i in %{devel_binaries}; do
+  install -dm 0755 %{buildroot}%{_datadir}/libalternatives/${i}
+  echo "%%dir %{_datadir}/libalternatives/${i}" >> .mfiles-devel
+  echo "binary=%{sdkbindir}/${i}" >> 
%{buildroot}%{_datadir}/libalternatives/${i}/%{priority}.conf
+  echo "man=${i}-%{sdklnk}.1$ext" >> 
%{buildroot}%{_datadir}/libalternatives/${i}/%{priority}.conf
+  echo "group=%{devel_binaries_comma}" >> 
%{buildroot}%{_datadir}/libalternatives/${i}/%{priority}.conf
+  echo "%{_datadir}/libalternatives/${i}/%{priority}.conf" >> .mfiles-devel
+  echo "%%ghost %{_bindir}/${i}" >> .mfiles-devel
+done
+
+%endif
+
 %post headless
 ext=.gz
+
+%if %{without libalternatives}
+
 update-alternatives \
   --install %{_bindir}/java java %{jrebindir}/java %{priority} \
   --slave %{_jvmdir}/jre jre %{_jvmdir}/%{jrelnk} \
@@ -683,7 +730,25 @@
   --install %{_jvmdir}/jre-%{javaver} \
   jre_%{javaver} %{_jvmdir}/%{jrelnk} %{priority}
 
+%else
+
+if [ -x %{_sbindir}/update-alternatives ]; then
+  update-alternatives --remove-all java
+  update-alternatives --remove-all jre_openjdk
+  update-alternatives --remove-all jre_%{javaver}
+fi || true
+
+for i in %{headless_binaries}; do
+  if ! [ -e %{_bindir}/${i} ]; then
+    ln -sf %{_bindir}/alts %{_bindir}/${i}
+  fi
+done
+
+%endif
+
+%if %{without libalternatives}
 %postun headless
+
 if [ $1 -eq 0 ]
 then
   if test -f /proc/sys/fs/binfmt_misc/jarexec
@@ -694,6 +759,7 @@
   update-alternatives --remove jre_openjdk %{_jvmdir}/%{jrelnk}
   update-alternatives --remove jre_%{javaver} %{_jvmdir}/%{jrelnk}
 fi
+%endif
 
 %posttrans headless
 # bnc#781690#c11: don't trust user defined JAVA_HOME and use the current VM
@@ -726,6 +792,9 @@
 
 %post devel
 ext=.gz
+
+%if %{without libalternatives}
+
 update-alternatives \
   --install %{_bindir}/javac javac %{sdkbindir}/javac %{priority} \
   --slave %{_jvmdir}/java java_sdk %{_jvmdir}/%{sdklnk} \
@@ -816,15 +885,37 @@
   --install %{_jvmdir}/java-%{javaver} \
   java_sdk_%{javaver} %{_jvmdir}/%{sdklnk} %{priority}
 
+%else
+
+if [ -x %{_sbindir}/update-alternatives ]; then
+  update-alternatives --remove-all javac
+  update-alternatives --remove-all java_sdk_openjdk
+  update-alternatives --remove-all java_sdk_%{javaver}
+fi || true
+
+for i in %{devel_binaries}; do
+  if ! [ -e %{_bindir}/${i} ]; then
+    ln -sf %{_bindir}/alts %{_bindir}/${i}
+  fi
+done
+
+%endif
+
+%if %{without libalternatives}
 %postun devel
+
 if [ $1 -eq 0 ]
 then
   update-alternatives --remove javac %{sdkbindir}/javac
   update-alternatives --remove java_sdk_openjdk %{_jvmdir}/%{sdklnk}
   update-alternatives --remove java_sdk_%{javaver} %{_jvmdir}/%{sdklnk}
 fi
+%endif
 
 %post javadoc
+
+%if %{without libalternatives}
+
 # in some settings, the %{_javadocdir}/%{sdklnk}/api does not exist
 # and the update-alternatives call ends up in error. So, filter this
 # cases out.
@@ -835,7 +926,17 @@
     %{priority}
 fi
 
+%else
+
+if [ -x %{_sbindir}/update-alternatives ]; then
+  update-alternatives --remove-all javadocdir
+fi || true
+
+%endif
+
+%if %{without libalternatives}
 %postun javadoc
+
 if [ $1 -eq 0 ]
 then
 # in some settings, the %{_javadocdir}/%{sdklnk}/api does not exist
@@ -846,6 +947,7 @@
     update-alternatives --remove javadocdir %{_javadocdir}/%{sdklnk}/api
   fi
 fi
+%endif
 
 %files
 %dir %{_jvmdir}/%{sdkdir}/lib
@@ -855,7 +957,7 @@
 %dir %{_datadir}/icons/hicolor
 %{_datadir}/icons/hicolor/*x*/apps/java-%{javaver}.png
 
-%files headless
+%files headless -f .mfiles-headless
 %dir %{_jvmdir}
 %dir %{_jvmdir}/%{sdkdir}/
 %dir %{_jvmdir}/%{sdkdir}/bin
@@ -959,7 +1061,7 @@
 %{_mandir}/man1/keytool-%{sdklnk}.1%{?ext_man}
 %{_mandir}/man1/rmiregistry-%{sdklnk}.1%{?ext_man}
 
-%files devel
+%files devel -f .mfiles-devel
 %dir %{_jvmdir}/%{sdkdir}/bin
 %dir %{_jvmdir}/%{sdkdir}/include
 %dir %{_jvmdir}/%{sdkdir}/include/linux

Reply via email to