Hello community,

here is the log from the commit of package transactional-update for 
openSUSE:Factory checked in at 2019-03-08 11:59:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/transactional-update (Old)
 and      /work/SRC/openSUSE:Factory/.transactional-update.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "transactional-update"

Fri Mar  8 11:59:18 2019 rev:39 rq:681245 version:2.13.2

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/transactional-update/transactional-update.changes    
    2019-02-17 12:18:48.104242419 +0100
+++ 
/work/SRC/openSUSE:Factory/.transactional-update.new.28833/transactional-update.changes
     2019-03-08 11:59:20.887975758 +0100
@@ -1,0 +2,6 @@
+Mon Mar  4 10:40:21 CET 2019 - ku...@suse.de
+
+- Update to version 2.13.2
+  - add hooks for telemetrics
+
+-------------------------------------------------------------------

Old:
----
  transactional-update-2.13.1.tar.gz

New:
----
  transactional-update-2.13.2.tar.gz

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

Other differences:
------------------
++++++ transactional-update.spec ++++++
--- /var/tmp/diff_new_pack.P7nrVK/_old  2019-03-08 11:59:21.427975667 +0100
+++ /var/tmp/diff_new_pack.P7nrVK/_new  2019-03-08 11:59:21.427975667 +0100
@@ -12,12 +12,12 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
 Name:           transactional-update
-Version:        2.13.1
+Version:        2.13.2
 Release:        0
 Summary:        Transactional Updates with btrfs and snapshots
 License:        GPL-2.0-or-later

++++++ transactional-update-2.13.1.tar.gz -> transactional-update-2.13.2.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/transactional-update-2.13.1/NEWS 
new/transactional-update-2.13.2/NEWS
--- old/transactional-update-2.13.1/NEWS        2019-02-14 15:58:41.000000000 
+0100
+++ new/transactional-update-2.13.2/NEWS        2019-03-04 10:39:12.000000000 
+0100
@@ -1,6 +1,9 @@
 transactional-update NEWS -- history of user-visible changes.
 
-Copyright (C) 2016, 2017, 2018 Thorsten Kukuk
+Copyright (C) 2016-2019 Thorsten Kukuk
+
+Version 2.13.2
+* Add hooks for telemetrics
 
 Version 2.13.1
 * Bugfix: Clean up empty /etc snapshot directories again
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/transactional-update-2.13.1/configure.ac 
new/transactional-update-2.13.2/configure.ac
--- old/transactional-update-2.13.1/configure.ac        2019-02-14 
15:58:41.000000000 +0100
+++ new/transactional-update-2.13.2/configure.ac        2019-03-04 
10:39:12.000000000 +0100
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(transactional-update, 2.13.1)
+AC_INIT(transactional-update, 2.13.2)
 AM_INIT_AUTOMAKE
 AC_CONFIG_SRCDIR([sbin/transactional-update.in])
 AC_PREFIX_DEFAULT(/usr)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/transactional-update-2.13.1/sbin/transactional-update.in 
new/transactional-update-2.13.2/sbin/transactional-update.in
--- old/transactional-update-2.13.1/sbin/transactional-update.in        
2019-02-14 15:58:41.000000000 +0100
+++ new/transactional-update-2.13.2/sbin/transactional-update.in        
2019-03-04 10:39:12.000000000 +0100
@@ -3,7 +3,7 @@
 # transactional-update - apply updates to the system in an atomic way
 #
 # Author: Thorsten Kukuk <ku...@suse.com>
-# Copyright (C) 2016, 2017, 2018 SUSE Linux GmbH
+# Copyright (C) 2016, 2017, 2018, 2019 SUSE Linux GmbH
 #
 # 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
@@ -42,6 +42,9 @@
 REBOOT_METHOD="auto"
 RUN_SHELL=0
 USE_SALT_GRAINS=0
+USE_TELEMETRICS=0
+TELEM_PAYLOAD="PACKAGE_NAME=transactional-update\nPACKAGE_VERSION=@VERSION@"
+TELEM_CLASS=""
 CONFFILE="@sysconfdir@/transactional-update.conf"
 SYSTEMCONFFILE="@prefix@@sysconfdir@/transactional-update.conf"
 LOGFILE="/var/log/transactional-update.log"
@@ -93,13 +96,15 @@
            quit 1
        fi
        export TA_UPDATE_TMPFILE
-       cd "${TA_UPDATE_TMPFILE}"
+       pushd "${TA_UPDATE_TMPFILE}" >/dev/null
        zypper --non-interactive --pkg-cache-dir "${TA_UPDATE_TMPFILE}" 
download transactional-update
        find . -name transactional-update*.rpm -exec rpm2cpio {} \; | cpio 
-idmv 2>/dev/null
        if [ $? -ne 0 ]; then
            log_error "ERROR: Couldn't extract the update."
            quit 1
        fi
+       # Reset CWD before restart
+       popd >/dev/null
        exec "${TA_UPDATE_TMPFILE}/usr/sbin/transactional-update" "$@"
     fi
 }
@@ -214,6 +219,30 @@
     fi
 }
 
+# start telemetry system if installed
+telem_start() {
+    if [ -x /usr/bin/telem-record-gen ]; then
+       USE_TELEMETRICS=1
+       TELEM_START_TIME=`echo $(($(date +%s%N)/1000000))`
+       source <(grep VERSION_ID /etc/os-release)
+       
TELEM_PAYLOAD="${TELEM_PAYLOAD}\noptions=${ORIG_ARGS[@]}\ncurrent_version=${VERSION_ID}"
+    fi
+}
+
+telem_finish () {
+    if [ ${USE_TELEMETRICS} -eq 1 ]; then
+       TELEM_END_TIME=`echo $(($(date +%s%N)/1000000))`
+       ELAPSED_TIME=`echo "($TELEM_END_TIME - $TELEM_START_TIME)/1000" | bc -l`
+       TELEM_PAYLOAD="${TELEM_PAYLOAD}\ntime=${ELAPSED_TIME} Seconds"
+       if [ $1 -gt 0 ]; then
+         TELEM_SEVERITY=3
+       else
+         TELEM_SEVERITY=1
+       fi
+       echo -e "${TELEM_PAYLOAD}" | telem-record-gen -s ${TELEM_SEVERITY} -c 
"org.opensuse/txupdate/$TELEM_CLASS"
+    fi
+}
+
 # Only called in error case; reverts everything to previous state.
 quit() {
     teardown
@@ -232,7 +261,9 @@
     fi
     if [ -n "${ETC_OVERLAY_DIR}" ] ; then
        log_error "Removing overlay directory ${ETC_OVERLAY_DIR%/*}..."
-       umount "${ETC_OVERLAY_DIR}"
+       if findmnt "${ETC_OVERLAY_DIR}" >/dev/null; then
+           umount "${ETC_OVERLAY_DIR}"
+       fi
        rm -rf "${ETC_OVERLAY_DIR%/*}" |& tee -a ${LOGFILE}
     fi
     if [ $USE_SALT_GRAINS -eq 1 ]; then
@@ -249,6 +280,7 @@
            echo "tx_update_failed: true" > /etc/salt/grains
        fi
     fi
+    telem_finish $1
     log_info "transactional-update finished"
     exit $1
 }
@@ -332,6 +364,8 @@
     fi
     # Reset tx_update_failed if exist
     sed -i -e 's|tx_update_failed:.*|tx_update_failed: false|g' 
/etc/salt/grains
+    TELEM_PAYLOAD="${TELEM_PAYLOAD}\nreboot=salt"
+    telem_finish 0
     exit 0
 }
 
@@ -339,6 +373,8 @@
     /usr/sbin/rebootmgrctl is-active --quiet
     if [ $? -eq 0 ]; then
        # rebootmgrctl is running
+       TELEM_PAYLOAD="${TELEM_PAYLOAD}\nreboot=rebootmgr"
+       telem_finish 0
        /usr/sbin/rebootmgrctl reboot
        log_info "transactional-update finished - informed rebootmgr"
        exit 0
@@ -346,6 +382,8 @@
 }
 
 reboot_via_systemd() {
+    TELEM_PAYLOAD="${TELEM_PAYLOAD}\nreboot=systemctl reboot"
+    telem_finish 0
     log_info "transactional-update finished - rebooting machine"
     sync
     systemctl reboot |& tee -a ${LOGFILE}
@@ -354,12 +392,16 @@
 
 reboot_via_kured() {
     log_info "transactional-update finished - informed kured"
+    TELEM_PAYLOAD="${TELEM_PAYLOAD}\nreboot=kured"
+    telem_finish 0
     touch /var/run/reboot-required
     exit 0
 }
 
 reboot_via_kexec() {
     log_info "transactional-update finished - re-initializing system with 
kexec"
+    TELEM_PAYLOAD="${TELEM_PAYLOAD}\nreboot=kexec"
+    telem_finish 0
     kexec -l /boot/vmlinuz --initrd=/boot/initrd --reuse-cmdline
     sync
     systemctl kexec |& tee -a ${LOGFILE}
@@ -480,6 +522,7 @@
 # If no option is given, assume "up"
 if [ $# -eq 0 ]; then
     ZYPPER_ARG="up"
+    TELEM_CLASS="update"
 fi
 
 while [ 1 ]; do
@@ -496,12 +539,15 @@
            DO_DUP=1
            ZYPPER_ARG="--no-cd dup"
            shift
+           TELEM_CLASS="upgrade"
            ;;
         up|patch)
            ZYPPER_ARG=$1
            shift
+           TELEM_CLASS="update"
            ;;
        ptf|pkg|package)
+           TELEM_CLASS="package"
            shift
            if [ $# -eq 0 ]; then
                usage 1
@@ -543,6 +589,7 @@
            done
            ;;
        migration)
+           TELEM_CLASS="migration"
            __NO_RESET=0
            DO_MIGRATION=1
            ZYPPER_ARG="migration --no-snapshots --no-selfupdate"
@@ -556,24 +603,29 @@
            shift
            ;;
        bootloader)
+           test -z "$TELEM_CLASS" && TELEM_CLASS="bootloader"
            REWRITE_BOOTLOADER=1
            REWRITE_GRUB_CFG=1
            shift
            ;;
        grub.cfg)
+           test -z "$TELEM_CLASS" && TELEM_CLASS="bootloader"
            REWRITE_GRUB_CFG=1
            shift
            ;;
        shell)
+           test -z "$TELEM_CLASS" && TELEM_CLASS="shell"
            RUN_SHELL=1
            shift
            ;;
        initrd)
+           test -z "$TELEM_CLASS" && TELEM_CLASS="initrd"
            REWRITE_INITRD=1
            REBUILD_KDUMP_INITRD=1
            shift
            ;;
        kdump)
+           test -z "$TELEM_CLASS" && TELEM_CLASS="kdump"
            REBUILD_KDUMP_INITRD=1
            shift
            ;;
@@ -582,6 +634,7 @@
            shift
            ;;
        rollback)
+           TELEM_CLASS="rollback"
            DO_ROLLBACK=1
            DO_SELF_UPDATE=0
            shift
@@ -672,15 +725,21 @@
 log_info "transactional-update @VERSION@ started"
 log_info "Options: ${ORIG_ARGS[@]}"
 
+telem_start
+
 if [ "`stat -f -c %T /`" != "btrfs" ]; then
   log_error "ERROR: not using btrfs as root file system!"
   log_info "transactional-update finished"
+  TELEM_PAYLOAD="${TELEM_PAYLOAD}\nmsg=No btrfs"
+  telem_finish 1
   exit 1
 fi
 
 if [ ! -d /.snapshots ]; then
   log_error "ERROR: no snapshots for root file system configured!"
   log_info "transactional-update finished"
+  TELEM_PAYLOAD="${TELEM_PAYLOAD}\nmsg=No snapshots configured"
+  telem_finish 1
   exit 1
 fi
 
@@ -754,6 +813,7 @@
     if [ ${NEED_REBOOT_WARNING} -eq 1 ]; then
        echo "Please reboot to finish rollback!"
     fi
+    telem_finish 0
     exit 0
 fi
 
@@ -871,6 +931,7 @@
        SIZE_OF_UPDATES=`grep "install-summary.*space-usage-diff" ${TMPFILE} | 
sed -e 's|.*install-summary.*space-usage-diff=\"\([^"]*\)\".*|\1|g'`
        NUM_OF_UPDATES=`grep "install-summary.*packages-to-change" ${TMPFILE} | 
sed -e 's|.*install-summary.*packages-to-change=\"\([^"]*\)\".*|\1|g'`
        rm -f ${TMPFILE}
+       
TELEM_PAYLOAD="${TELEM_PAYLOAD}\npackages=${NUM_OF_UPDATES}\ndownload_size=${PACKAGE_UPDATES}\nspace-usage=${SIZE_OF_UPDATES}"
        if [ "${NUM_OF_UPDATES}" = "0" ] || [ -z "${NUM_OF_UPDATES}" -a 
"${PACKAGE_UPDATES}" = "0" -a "${SIZE_OF_UPDATES}" = "0" ]; then
            log_info "zypper: nothing to update"
            log_info "transactional-update finished"
@@ -882,6 +943,7 @@
                    sed -i -e 's|tx_update_failed:.*|tx_update_failed: false|g' 
/etc/salt/grains
                fi
            fi
+           telem_finish 0
            exit 0
        fi
     fi
@@ -1119,8 +1181,11 @@
            if [ $? -ne 0 ]; then
                REWRITE_GRUB_CFG=1
            fi
+           source <(grep VERSION_ID ${MOUNT_DIR}/etc/os-release)
+           TELEM_PAYLOAD="${TELEM_PAYLOAD}\nnext_version=${VERSION_ID}"
        else
            log_error "ERROR: zypper ${ZYPPER_ARG} on ${MOUNT_DIR} failed with 
exit code ${RETVAL}!"
+           TELEM_PAYLOAD="${TELEM_PAYLOAD}\nzypper_exitcode=${RETVAL}"
            EXITCODE=1
        fi
     fi
@@ -1242,4 +1307,6 @@
 
 log_info "transactional-update finished"
 
+telem_finish $EXITCODE
+
 exit $EXITCODE


Reply via email to