Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package os-update for openSUSE:Factory 
checked in at 2022-10-31 12:15:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/os-update (Old)
 and      /work/SRC/openSUSE:Factory/.os-update.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "os-update"

Mon Oct 31 12:15:15 2022 rev:2 rq:1032437 version:1.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/os-update/os-update.changes      2022-10-28 
19:30:21.258879256 +0200
+++ /work/SRC/openSUSE:Factory/.os-update.new.2275/os-update.changes    
2022-10-31 12:15:16.742378809 +0100
@@ -1,0 +2,6 @@
+Mon Oct 31 10:02:40 UTC 2022 - Thorsten Kukuk <[email protected]>
+
+- Update to version 1.2
+  - Restart updated services
+
+-------------------------------------------------------------------

Old:
----
  os-update-1.1.tar.xz

New:
----
  os-update-1.2.tar.xz

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

Other differences:
------------------
++++++ os-update.spec ++++++
--- /var/tmp/diff_new_pack.46qPtT/_old  2022-10-31 12:15:17.274381306 +0100
+++ /var/tmp/diff_new_pack.46qPtT/_new  2022-10-31 12:15:17.278381325 +0100
@@ -15,12 +15,13 @@
 # Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
+
 %if ! %{defined _distconfdir}
   %define _distconfdir %{_datadir}
 %endif
 
 Name:           os-update
-Version:        1.1
+Version:        1.2
 Release:        0
 Summary:        Updates the system regular to stay current and safe
 License:        GPL-2.0-or-later

++++++ os-update-1.1.tar.xz -> os-update-1.2.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/os-update-1.1/NEWS new/os-update-1.2/NEWS
--- old/os-update-1.1/NEWS      2022-10-26 14:52:56.000000000 +0200
+++ new/os-update-1.2/NEWS      2022-10-31 10:51:18.000000000 +0100
@@ -1,3 +1,6 @@
+Version 1.2
+ - Support restart of updated services
+
 Version 1.1
  - Documentation update
  - Add openSUSE Leap
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/os-update-1.1/configure new/os-update-1.2/configure
--- old/os-update-1.1/configure 2022-10-27 09:54:36.000000000 +0200
+++ new/os-update-1.2/configure 2022-10-31 10:51:26.000000000 +0100
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for os-update 1.1.
+# Generated by GNU Autoconf 2.69 for os-update 1.2.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -576,8 +576,8 @@
 # Identity of this package.
 PACKAGE_NAME='os-update'
 PACKAGE_TARNAME='os-update'
-PACKAGE_VERSION='1.1'
-PACKAGE_STRING='os-update 1.1'
+PACKAGE_VERSION='1.2'
+PACKAGE_STRING='os-update 1.2'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1214,7 +1214,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures os-update 1.1 to adapt to many kinds of systems.
+\`configure' configures os-update 1.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1280,7 +1280,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of os-update 1.1:";;
+     short | recursive ) echo "Configuration of os-update 1.2:";;
    esac
   cat <<\_ACEOF
 
@@ -1370,7 +1370,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-os-update configure 1.1
+os-update configure 1.2
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1387,7 +1387,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by os-update $as_me 1.1, which was
+It was created by os-update $as_me 1.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2250,7 +2250,7 @@
 
 # Define the identity of the package.
  PACKAGE='os-update'
- VERSION='1.1'
+ VERSION='1.2'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3124,7 +3124,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by os-update $as_me 1.1, which was
+This file was extended by os-update $as_me 1.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -3177,7 +3177,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-os-update config.status 1.1
+os-update config.status 1.2
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/os-update-1.1/configure.ac 
new/os-update-1.2/configure.ac
--- old/os-update-1.1/configure.ac      2022-10-27 09:54:29.000000000 +0200
+++ new/os-update-1.2/configure.ac      2022-10-31 10:51:23.000000000 +0100
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(os-update, 1.1)
+AC_INIT(os-update, 1.2)
 AM_INIT_AUTOMAKE
 AC_PREFIX_DEFAULT(/usr)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/os-update-1.1/src/os-update.8 
new/os-update-1.2/src/os-update.8
--- old/os-update-1.1/src/os-update.8   2022-10-26 14:50:53.000000000 +0200
+++ new/os-update-1.2/src/os-update.8   2022-10-31 10:46:55.000000000 +0100
@@ -33,6 +33,28 @@
 (e.g.\ \f[C]zypper up\f[R] for something like \f[I]SUSE Linux
 Enterprise\f[R]) or to apply only security updates
 (e.g.\ \f[C]zypper patch --category security\f[R]).
+.SH CONFIGURATION OPTIONS
+.TP
+UPDATE_CMD=\[lq]auto\[rq]
+Specifies how to update the system.
+Valid values are \[lq]auto\[rq], \[lq]dup\[rq], \[lq]up\[rq] and
+\[lq]security\[rq].
+\[lq]auto\[rq] will select the best fitting command depending on the OS.
+.TP
+REBOOT_CMD=\[lq]auto\[rq]
+Specifies how the system will be rebooted in case an update requires
+this.
+Valid values are \[lq]auto\[rq], \[lq]rebootmgr\[rq] and
+\[lq]reboot\[rq].
+\[lq]auto\[rq] will use rebootmgr if installed and running, else
+\f[C]systemctl reboot\f[R].
+.TP
+RESTART_SERVICES=\[lq]yes\[rq]
+Specifies if after a successful update services should automatically
+restarted, if they are still using old libraries.
+.TP
+IGNORE_SERVICES_FROM_RESTART=\[lq]udev dbus\[rq]
+Specifies a list of services which should not be restarted
 .SH CONFIGURATION FILES
 .TP
 /usr/etc/os-update.conf
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/os-update-1.1/src/os-update.8.md 
new/os-update-1.2/src/os-update.8.md
--- old/os-update-1.1/src/os-update.8.md        2022-10-26 14:50:50.000000000 
+0200
+++ new/os-update-1.2/src/os-update.8.md        2022-10-31 10:46:50.000000000 
+0100
@@ -26,6 +26,23 @@
 *SUSE Linux Enterprise*) or to apply only security updates
 (e.g. `zypper patch --category security`).
 
+# CONFIGURATION OPTIONS
+
+UPDATE_CMD="auto"
+: Specifies how to update the system. Valid values are "auto", "dup", "up" and
+"security". "auto" will select the best fitting command depending on the OS.
+
+REBOOT_CMD="auto"
+: Specifies how the system will be rebooted in case an update requires
+this. Valid values are "auto", "rebootmgr" and "reboot". "auto" will use
+rebootmgr if installed and running, else `systemctl reboot`.
+
+RESTART_SERVICES="yes"
+: Specifies if after a successful update services should automatically
+restarted, if they are still using old libraries.
+
+IGNORE_SERVICES_FROM_RESTART="udev dbus"
+: Specifies a list of services which should not be restarted
 
 # CONFIGURATION FILES
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/os-update-1.1/src/os-update.conf 
new/os-update-1.2/src/os-update.conf
--- old/os-update-1.1/src/os-update.conf        2022-10-24 15:55:17.000000000 
+0200
+++ new/os-update-1.2/src/os-update.conf        2022-10-31 10:31:47.000000000 
+0100
@@ -1,2 +1,4 @@
 UPDATE_CMD=auto
 REBOOT_CMD=auto
+RESTART_SERVICES=yes
+IGNORE_SERVICES_FROM_RESTART="udev dbus"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/os-update-1.1/src/os-update.in 
new/os-update-1.2/src/os-update.in
--- old/os-update-1.1/src/os-update.in  2022-10-24 16:45:25.000000000 +0200
+++ new/os-update-1.2/src/os-update.in  2022-10-31 10:38:12.000000000 +0100
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Copyright (C) 2020 Thorsten Kukuk <[email protected]>
+# Copyright (C) 2020-2022 Thorsten Kukuk <[email protected]>
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -17,6 +17,17 @@
 
 export LANG=C.UTF-8
 
+# Default variables
+PKG_MANAGER="zypper"
+UPDATE_CMD="auto"
+REBOOT_CMD="auto"
+RESTART_SERVICES="yes"
+IGNORE_SERVICES_FROM_RESTART="udev dbus"
+
+# Additional variables per package manager
+ZYPPER_NONINTERACTIVE="-y --auto-agree-with-product-licenses"
+
+
 log_error()
 {
     echo "$@" >&2
@@ -81,7 +92,7 @@
 eval_zypper_retval() {
     RETVAL=$1
 
-    if [ $RETVAL -eq 0 ] || [ $RETVAL -eq 102 ] || [ $RETVAL -eq 103 ]; then
+    if [ "$RETVAL" -eq 0 ] || [ "$RETVAL" -eq 102 ] || [ "$RETVAL" -eq 103 ]; 
then
        log_info "Update was successful"
     else
        log_error "ERROR: update failed, exit code was ${RETVAL}"
@@ -104,6 +115,21 @@
     eval_zypper_retval $?
 }
 
+zypper_restart_services() {
+    for service in $(zypper ps --print %s); do
+        for ignore in $IGNORE_SERVICES_FROM_RESTART; do
+            if [ "$ignore" = "$service" ]; then
+                log_info "Not restarting $service as it is excluded in 
IGNORE_SERVICES_FROM_RESTART"
+               break
+           fi
+       done
+        if [ "$ignore" != "$service" ]; then
+           log_info "Restarting $service"
+            systemctl try-restart "$service".service
+       fi
+    done
+}
+
 run_zypper() {
 
     case "$UPDATE_CMD" in
@@ -168,13 +194,6 @@
 fi
 
 # Read configuration variables
-# Default variables
-PKG_MANAGER="zypper"
-UPDATE_CMD="auto"
-REBOOT_CMD="auto"
-
-# Additional variables per package manager
-ZYPPER_NONINTERACTIVE="-y --auto-agree-with-product-licenses"
 
 # Overwrite with vendor specific values if exist:
 if [ -e /usr/etc/os-update.conf ]; then
@@ -187,6 +206,12 @@
 
 run_${PKG_MANAGER}
 
+case "$RESTART_SERVICES" in
+    [yY]*)
+       zypper_restart_services
+       ;;
+esac
+
 check_and_reboot
 
 exit 0

Reply via email to