Hello community, here is the log from the commit of package rollback-helper for openSUSE:Factory checked in at 2018-02-01 21:30:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rollback-helper (Old) and /work/SRC/openSUSE:Factory/.rollback-helper.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "rollback-helper" Thu Feb 1 21:30:08 2018 rev:3 rq:571673 version:0.1 Changes: -------- --- /work/SRC/openSUSE:Factory/rollback-helper/rollback-helper.changes 2017-08-10 14:12:09.120040890 +0200 +++ /work/SRC/openSUSE:Factory/.rollback-helper.new/rollback-helper.changes 2018-02-01 21:30:13.138742820 +0100 @@ -1,0 +2,7 @@ +Thu Jan 25 17:35:32 UTC 2018 - iforster@suse.com + +- check if current btrfs snapshot is the production snapshot before + re-registering (bsc#1068947) +- unified branching versions (Jul 27 2017 vs. May 22 2017) + +------------------------------------------------------------------- @@ -5,0 +13,5 @@ + +------------------------------------------------------------------- +Mon May 22 13:56:19 UTC 2017 - jsrain@suse.cz + +- check whether system is registered before rollback (bsc#1032129) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rollback-helper-0.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rollback-helper-0.1/sbin/rollback-reset-registration new/rollback-helper-0.1/sbin/rollback-reset-registration --- old/rollback-helper-0.1/sbin/rollback-reset-registration 2015-10-05 12:34:11.069899943 +0200 +++ new/rollback-helper-0.1/sbin/rollback-reset-registration 2018-01-25 16:35:08.466376751 +0100 @@ -1,21 +1,23 @@ -#!/usr/bin/ruby +#!/bin/sh # -# This script is called at the first boot after a snapper rollback -# The purpose of this script is, to verify, that after an rollback -# the corret products are registered at SCC/SMT. - -require "suse/connect" +# This script is called on first boot after a snapper rollback +# The purpose of this script is to verify that after a rollback +# the correct products are registered at SCC/SMT. VARDIR="/var/lib/rollback" -cmd="rm -f /#{VARDIR}/check-registration" - -system cmd - -begin - # TODO: check if repos were actually changed - SUSE::Connect::Migration.rollback -rescue => e - print "SUSEConnect error: #{e.class}: #{e.message}\n" -end +CURRENT_SNAPSHOT_ID=`grep subvol=/@/.snapshots/ /proc/mounts | grep "/ btrfs" | sed -e 's|.*.snapshots/\(.*\)/snapshot.*|\1|g'` +DEFAULT_SNAPSHOT_ID=`btrfs subvolume get-default / | sed -e 's|.*.snapshots/\(.*\)/snapshot|\1|g'` +# Make sure to trigger re-registration only when the system is running the +# production snapshot (i.e. don't trigger when the user selected some old +# snapshot from GRUB - or at least not until he made it the default one) +if [ "${CURRENT_SNAPSHOT_ID}" -ne "${DEFAULT_SNAPSHOT_ID}" ]; then + exit +fi + +if SUSEConnect --status | grep -q '"Registered"'; then + if SUSEConnect --rollback; then + rm -f ${VARDIR}/check-registration + fi +fi