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 2024-11-06 16:56:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/os-update (Old) and /work/SRC/openSUSE:Factory/.os-update.new.2020 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "os-update" Wed Nov 6 16:56:29 2024 rev:24 rq:1221725 version:1.18+git.20241106 Changes: -------- --- /work/SRC/openSUSE:Factory/os-update/os-update.changes 2024-10-07 21:53:21.997088820 +0200 +++ /work/SRC/openSUSE:Factory/.os-update.new.2020/os-update.changes 2024-11-06 16:57:25.657676655 +0100 @@ -1,0 +2,8 @@ +Wed Nov 06 10:24:35 UTC 2024 - [email protected] + +- Update to version 1.18+git.20241106: + * Release version 1.18 + * Move vendor config to /usr/share/os-update + * Unify indentation style + +------------------------------------------------------------------- Old: ---- os-update-1.17+git.20241007.tar.xz New: ---- os-update-1.18+git.20241106.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ os-update.spec ++++++ --- /var/tmp/diff_new_pack.Jm2E7s/_old 2024-11-06 16:57:26.129696283 +0100 +++ /var/tmp/diff_new_pack.Jm2E7s/_new 2024-11-06 16:57:26.129696283 +0100 @@ -21,7 +21,7 @@ %endif Name: os-update -Version: 1.17+git.20241007 +Version: 1.18+git.20241106 Release: 0 Summary: Updates the system regularly to stay current and safe License: GPL-2.0-or-later @@ -36,15 +36,15 @@ BuildRequires: sysuser-tools BuildRequires: pkgconfig(systemd) Requires: lsof +Recommends: rebootmgr +Recommends: systemd-status-mail +BuildArch: noarch %if 0%{?suse_version} >= 1500 Requires: zypper-needs-restarting %endif %if 0%{?suse_version} >= 1600 Requires: zypp-boot-plugin >= 0.0.4 %endif -Recommends: rebootmgr -Recommends: systemd-status-mail -BuildArch: noarch %description Service to keep an OS update to date and secure. It is run by a @@ -53,13 +53,13 @@ %package -n systemd-status-mail Summary: Send a mail if a systemd.timer fails and/or succeeds +%sysusers_requires %if 0%{?suse_version} >= 1500 Requires: (/usr/sbin/sendmail or mailx) Suggests: mailx %else Requires: mailx %endif -%sysusers_requires %description -n systemd-status-mail systemd-mail-status is called by [email protected] if the @@ -73,7 +73,7 @@ %build ./autogen.sh -%configure --enable-vendordir=%{_distconfdir} +%configure %if 0%{?suse_version} < 1500 %define make_build %{__make} -O %{?_smp_mflags} %endif @@ -101,11 +101,8 @@ %files %license COPYING %doc README.md -%if 0%{?suse_version} < 1550 -%config(noreplace) %{_sysconfdir}/os-update.conf -%else -%{_distconfdir}/os-update.conf -%endif +%dir %{_datadir}/os-update +%{_datadir}/os-update/os-update.conf %{_libexecdir}/os-update %{_prefix}/lib/systemd/system/os-update.service %{_prefix}/lib/systemd/system/os-update.timer ++++++ _service ++++++ --- /var/tmp/diff_new_pack.Jm2E7s/_old 2024-11-06 16:57:26.161697613 +0100 +++ /var/tmp/diff_new_pack.Jm2E7s/_new 2024-11-06 16:57:26.165697779 +0100 @@ -5,7 +5,7 @@ <param name="revision">main</param> <param name="changesgenerate">enable</param> <param name="filename">os-update</param> - <param name="versionformat">1.17+git.%cd</param> + <param name="versionformat">1.18+git.%cd</param> </service> <service mode="manual" name="recompress"> <param name="file">*.tar</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.Jm2E7s/_old 2024-11-06 16:57:26.185698611 +0100 +++ /var/tmp/diff_new_pack.Jm2E7s/_new 2024-11-06 16:57:26.189698777 +0100 @@ -1,7 +1,7 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/openSUSE/os-update.git</param> -<param name="changesrevision">6e00975a3a7e46925647a0f3909fa2b6c4dc2815</param></service> +<param name="changesrevision">1a8f0819e7fd55a22eeaeb5077c23c67567df69a</param></service> </servicedata> (No newline at EOF) ++++++ os-update-1.17+git.20241007.tar.xz -> os-update-1.18+git.20241106.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-update-1.17+git.20241007/NEWS new/os-update-1.18+git.20241106/NEWS --- old/os-update-1.17+git.20241007/NEWS 2024-10-07 14:05:12.000000000 +0200 +++ new/os-update-1.18+git.20241106/NEWS 2024-11-06 11:23:50.000000000 +0100 @@ -1,3 +1,7 @@ +Version 1.18 +- Move vendor config to /usr/share/os-update +- Refresh before update, don't update if not all repositories are accessible + Version 1.17 - Implement soft-reboot support for non restartable services diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-update-1.17+git.20241007/README.md new/os-update-1.18+git.20241106/README.md --- old/os-update-1.17+git.20241007/README.md 2024-10-07 14:05:12.000000000 +0200 +++ new/os-update-1.18+git.20241106/README.md 2024-11-06 11:23:50.000000000 +0100 @@ -30,7 +30,7 @@ **SERVICES_TRIGGERING_REBOOT**="dbus" : Specifies a list of services which trigger a reboot ## CONFIGURATION FILES -**/usr/etc/os-update.conf** - Vendor provided configuration file, contains the defaults. +**/usr/share/os-update/os-update.conf** - Vendor provided configuration file, contains the defaults. **/etc/os-update.conf** - Admin provided configuration file, should only contain the variables which were changed by the system administrator compared to the vendor configuration file. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-update-1.17+git.20241007/configure.ac new/os-update-1.18+git.20241106/configure.ac --- old/os-update-1.17+git.20241007/configure.ac 2024-10-07 14:05:12.000000000 +0200 +++ new/os-update-1.18+git.20241106/configure.ac 2024-11-06 11:23:50.000000000 +0100 @@ -1,18 +1,11 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(os-update, 1.17) +AC_INIT(os-update, 1.18) AM_INIT_AUTOMAKE AC_PREFIX_DEFAULT(/usr) AC_SUBST(PACKAGE) AC_SUBST(VERSION) -AC_ARG_ENABLE([vendordir], - AS_HELP_STRING([--enable-vendordir=DIR], [Directory for configuration files provided by the distribution]),, - [] -) -AC_SUBST([vendordir], [$enable_vendordir]) -AM_CONDITIONAL([HAVE_VENDORDIR], [test "x$enable_vendordir" != x]) - PKG_CHECK_VAR([systemdsystemunitdir], [systemd], [systemdsystemunitdir], [], [AC_MSG_ERROR([Could not determine value for 'systemdsystemunitdir' - is the 'systemd.pc' file installed?])]) PKG_CHECK_VAR([systemdsystemgeneratordir], [systemd], [systemdsystemgeneratordir], [], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-update-1.17+git.20241007/src/Makefile.am new/os-update-1.18+git.20241106/src/Makefile.am --- old/os-update-1.17+git.20241007/src/Makefile.am 2024-10-07 14:05:12.000000000 +0200 +++ new/os-update-1.18+git.20241106/src/Makefile.am 2024-11-06 11:23:50.000000000 +0100 @@ -3,11 +3,7 @@ man_MANS = os-update.8 systemd-status-mail.8 -if HAVE_VENDORDIR -configdir=@vendordir@ -else -configdir=${sysconfdir} -endif +configdir=/usr/share/os-update config_DATA = os-update.conf diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-update-1.17+git.20241007/src/os-update.8.md new/os-update-1.18+git.20241106/src/os-update.8.md --- old/os-update-1.17+git.20241007/src/os-update.8.md 2024-10-07 14:05:12.000000000 +0200 +++ new/os-update-1.18+git.20241106/src/os-update.8.md 2024-11-06 11:23:50.000000000 +0100 @@ -57,7 +57,7 @@ # CONFIGURATION FILES -/usr/etc/os-update.conf +/usr/share/os-update/os-update.conf : Vendor provided configuration file, contains the defaults. /etc/os-update.conf diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-update-1.17+git.20241007/src/os-update.in new/os-update-1.18+git.20241106/src/os-update.in --- old/os-update-1.17+git.20241007/src/os-update.in 2024-10-07 14:05:12.000000000 +0200 +++ new/os-update-1.18+git.20241106/src/os-update.in 2024-11-06 11:23:50.000000000 +0100 @@ -36,216 +36,215 @@ log_error() { - echo "$@" >&2 - local LOG_ARGS="--priority user.err" - if [ -n "$LOG_TAG" ]; then - LOG_ARGS="$LOG_ARGS -t $LOG_TAG" - fi - logger ${LOG_ARGS} "$@" + echo "$@" >&2 + local LOG_ARGS="--priority user.err" + if [ -n "$LOG_TAG" ]; then + LOG_ARGS="$LOG_ARGS -t $LOG_TAG" + fi + logger ${LOG_ARGS} "$@" } log_info() { - echo "$@" - local LOG_ARGS="" - if [ -n "$LOG_TAG" ]; then - LOG_ARGS="$LOG_ARGS -t $LOG_TAG" - fi - logger ${LOG_ARGS} "$@" + echo "$@" + local LOG_ARGS="" + if [ -n "$LOG_TAG" ]; then + LOG_ARGS="$LOG_ARGS -t $LOG_TAG" + fi + logger ${LOG_ARGS} "$@" } usage() { - echo "Syntax: os-update" - echo "" - echo "Update the system with automatic reboot if required." - echo "" - echo "Options:" - echo "--help, -h Display this help and exit" - echo "--version Display version and exit" + echo "Syntax: os-update" + echo "" + echo "Update the system with automatic reboot if required." + echo "" + echo "Options:" + echo "--help, -h Display this help and exit" + echo "--version Display version and exit" } print_version() { - echo "os-update @VERSION@" + echo "os-update @VERSION@" } check_and_reboot() { - if [ -x /usr/bin/needs-restarting ]; then - needs-restarting -r - if [ $? -eq 1 ] ; then - reboottrigger="yes" - if [ -f "/run/reboot-needed" ] && [ -s "/run/reboot-needed" ]; then - case $(cat /run/reboot-needed) in - "soft-reboot") - log_info "Update suggests reboot with soft-reboot" - REBOOT_METHOD="soft-reboot" + if [ -x /usr/bin/needs-restarting ]; then + needs-restarting -r + if [ $? -eq 1 ] ; then + reboottrigger="yes" + if [ -f "/run/reboot-needed" ] && [ -s "/run/reboot-needed" ]; then + case $(cat /run/reboot-needed) in + "soft-reboot") + log_info "Update suggests reboot with soft-reboot" + REBOOT_METHOD="soft-reboot" + ;; + *) + log_info "Update suggests reboot with $(cat /run/reboot-needed), using hard reboot" + REBOOT_METHOD="reboot" + ;; + esac + else + log_info "Update suggests reboot" + REBOOT_METHOD="reboot" + fi + fi + else + release=$(uname -r) + flavor=${release##*-} + version=${release%-*} + for rpm in $(rpm -q kernel-${flavor}) ; do + installed=${rpm#kernel-${flavor}-} + if [[ ${installed} > ${version}.1.$(uname -m) ]] ; then + log_info "New kernel detected, trigger reboot" + reboottrigger="yes" + REBOOT_METHOD="reboot" + fi + done + fi + if [ "$reboottrigger" = "yes" ]; then + case "$REBOOT_CMD" in + "auto") + if [ -x /usr/sbin/rebootmgrctl ]; then + if /usr/sbin/rebootmgrctl is-active -q; then + log_info "Trigger reboot with rebootmgrctl $REBOOT_METHOD" + /usr/sbin/rebootmgrctl $REBOOT_METHOD + else + log_info "Trigger reboot with systemctl $REBOOT_METHOD" + systemctl $REBOOT_METHOD + fi + else + log_info "Trigger reboot with systemctl $REBOOT_METHOD" + systemctl $REBOOT_METHOD + fi + ;; + "rebootmgr") + if [ ! -x /usr/sbin/rebootmgrctl ]; then + log_error "ERROR: rebootmgrctl not installed" + exit 1 + fi + if ! /usr/sbin/rebootmgrctl is-active -q; then + log_error "ERROR: rebootmgrd not running" + exit 1 + fi + log_info "Trigger reboot with rebootmgrctl $REBOOT_METHOD" + /usr/sbin/rebootmgrctl $REBOOT_METHOD ;; - *) - log_info "Update suggests reboot with $(cat /run/reboot-needed), using hard reboot" - REBOOT_METHOD="reboot" + "reboot") + log_info "Trigger reboot with systemctl $REBOOT_METHOD" + systemctl $REBOOT_METHOD + ;; + "no"|"none") + log_info "A $REBOOT_METHOD is required" ;; esac - else - log_info "Update suggests reboot" - REBOOT_METHOD="reboot" - fi fi - else - release=$(uname -r) - flavor=${release##*-} - version=${release%-*} - for rpm in $(rpm -q kernel-${flavor}) ; do - installed=${rpm#kernel-${flavor}-} - if [[ ${installed} > ${version}.1.$(uname -m) ]] ; then - log_info "New kernel detected, trigger reboot" - reboottrigger="yes" - REBOOT_METHOD="reboot" - fi - done - fi - if [ "$reboottrigger" = "yes" ]; then - case "$REBOOT_CMD" in - "auto") - if [ -x /usr/sbin/rebootmgrctl ]; then - if /usr/sbin/rebootmgrctl is-active -q; then - log_info "Trigger reboot with rebootmgrctl $REBOOT_METHOD" - /usr/sbin/rebootmgrctl $REBOOT_METHOD - else - log_info "Trigger reboot with systemctl $REBOOT_METHOD" - systemctl $REBOOT_METHOD - fi - else - log_info "Trigger reboot with systemctl $REBOOT_METHOD" - systemctl $REBOOT_METHOD - fi - ;; - "rebootmgr") - if [ ! -x /usr/sbin/rebootmgrctl ]; then - log_error "ERROR: rebootmgrctl not installed" - exit 1 - fi - if ! /usr/sbin/rebootmgrctl is-active -q; then - log_error "ERROR: rebootmgrd not running" - exit 1 - fi - log_info "Trigger reboot with rebootmgrctl $REBOOT_METHOD" - /usr/sbin/rebootmgrctl $REBOOT_METHOD - ;; - "reboot") - log_info "Trigger reboot with systemctl $REBOOT_METHOD" - systemctl $REBOOT_METHOD - ;; - "no"|"none") - log_info "A $REBOOT_METHOD is required" - ;; - esac - fi } eval_zypper_retval() { - RETVAL=$1 + RETVAL=$1 - 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}" - if [ "$RETVAL" -ne 106 ]; then - exit 1 + 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}" + if [ "$RETVAL" -ne 106 ]; then + exit 1 + fi fi - fi } zypper_refresh() { - if ! zypper refresh; then - log_error "ERROR: refresh failed" - exit 1 - fi + if ! zypper refresh; then + log_error "ERROR: refresh failed" + exit 1 + fi } zypper_security() { - zypper_refresh - zypper ${ZYPPER_NOREFRESH} patch ${ZYPPER_NONINTERACTIVE} --category security - eval_zypper_retval $? + zypper_refresh + zypper ${ZYPPER_NOREFRESH} patch ${ZYPPER_NONINTERACTIVE} --category security + eval_zypper_retval $? } zypper_up() { - zypper_refresh - zypper ${ZYPPER_NOREFRESH} up ${ZYPPER_NONINTERACTIVE} - eval_zypper_retval $? + zypper_refresh + zypper ${ZYPPER_NOREFRESH} up ${ZYPPER_NONINTERACTIVE} + eval_zypper_retval $? } zypper_dup() { - zypper_refresh - zypper ${ZYPPER_NOREFRESH} dup ${ZYPPER_NONINTERACTIVE} - eval_zypper_retval $? + zypper_refresh + zypper ${ZYPPER_NOREFRESH} dup ${ZYPPER_NONINTERACTIVE} + eval_zypper_retval $? } zypper_restart_services() { - if [[ $(lsof -w -a -d DEL -p 1 -Ff | grep -c "^fDEL") -gt 0 ]]; then - log_info "Reexecing systemd" - systemctl daemon-reexec; - fi - reboottrigger="no" - for service in $(zypper ps --print %s); do - for rebootservice in $SERVICES_TRIGGERING_SOFT_REBOOT; do - if [ "$rebootservice" = "$service" ]; then - log_info "$service triggers a soft-reboot as it is included in SERVICES_TRIGGERING_SOFT_REBOOT" - reboottrigger="yes" - REBOOT_METHOD="soft-reboot" - break - fi - done - for rebootservice in $SERVICES_TRIGGERING_REBOOT; do - if [ "$rebootservice" = "$service" ]; then - log_info "$service triggers a reboot as it is included in SERVICES_TRIGGERING_REBOOT" - reboottrigger="yes" - REBOOT_METHOD="reboot" - break - fi - done - 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" ] && [ "$service" != "os-update" ]; then - log_info "Restarting $service" - systemctl try-restart "$service".service + if [[ $(lsof -w -a -d DEL -p 1 -Ff | grep -c "^fDEL") -gt 0 ]]; then + log_info "Reexecing systemd" + systemctl daemon-reexec fi - done + reboottrigger="no" + for service in $(zypper ps --print %s); do + for rebootservice in $SERVICES_TRIGGERING_SOFT_REBOOT; do + if [ "$rebootservice" = "$service" ]; then + log_info "$service triggers a soft-reboot as it is included in SERVICES_TRIGGERING_SOFT_REBOOT" + reboottrigger="yes" + REBOOT_METHOD="soft-reboot" + break + fi + done + for rebootservice in $SERVICES_TRIGGERING_REBOOT; do + if [ "$rebootservice" = "$service" ]; then + log_info "$service triggers a reboot as it is included in SERVICES_TRIGGERING_REBOOT" + reboottrigger="yes" + REBOOT_METHOD="reboot" + break + fi + done + 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" ] && [ "$service" != "os-update" ]; then + log_info "Restarting $service" + systemctl try-restart "$service".service + fi + done } run_zypper() { - - case "$UPDATE_CMD" in - auto) - . /etc/os-release - case "$NAME" in - "SLES"|"openSUSE Leap") - zypper_up - ;; - "openSUSE Tumbleweed") - zypper_dup - ;; + case "$UPDATE_CMD" in + auto) + . /etc/os-release + case "$NAME" in + "SLES"|"openSUSE Leap") + zypper_up + ;; + "openSUSE Tumbleweed") + zypper_dup + ;; + *) + log_error "ERROR: your OS is not supported in 'auto' mode" + ;; + esac + ;; + dup) + zypper_dup + ;; + up) + zypper_up + ;; + security) + zypper_security + ;; *) - log_error "ERROR: your OS is not supported in 'auto' mode" - ;; - esac - ;; - dup) - zypper_dup - ;; - up) - zypper_up - ;; - security) - zypper_security - ;; - *) - log_error "ERROR: UPDATE_CMD ($UPDATE_CMD) unknown" - exit 1 - ;; - esac + log_error "ERROR: UPDATE_CMD ($UPDATE_CMD) unknown" + exit 1 + ;; + esac } # @@ -253,47 +252,52 @@ # while true; do - if [ $# -eq 0 ]; then - break - fi - - case "$1" in - -h|--help) - usage - exit 0 - ;; - --version) - print_version - exit 0 - ;; - *) - usage - exit 1 - ;; - esac + if [ $# -eq 0 ]; then + break + fi + + case "$1" in + -h|--help) + usage + exit 0 + ;; + --version) + print_version + exit 0 + ;; + *) + usage + exit 1 + ;; + esac done if [ $# -ne 0 ]; then - usage - exit 1 + usage + exit 1 fi # Read configuration variables # Overwrite with vendor specific values if exist: +# New vendor config +if [ -e /usr/share/os-update/os-update.conf ]; then + . /usr/share/os-update/os-update.conf +fi +# Outdated config directory if [ -e /usr/etc/os-update.conf ]; then - . /usr/etc/os-update.conf + . /usr/etc/os-update.conf fi # Overwrite with admin specific values if exist: if [ -e /etc/os-update.conf ]; then - . /etc/os-update.conf + . /etc/os-update.conf fi run_${PKG_MANAGER} case "$RESTART_SERVICES" in - [yY]*) - zypper_restart_services + [yY]*) + zypper_restart_services ;; esac
