From 9d789068cbb88bcd386b131dbc4b362425844ff8 Mon Sep 17 00:00:00 2001 From: Arvin Schnell Date: Mon, 15 Dec 2014 15:15:58 +0100 Subject: [PATCH] - ignore everything in .snapshots not matching a number (grub renamed it's file) --- package/snapper.changes | 5 +++++ snapper/Snapshot.cc | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/package/snapper.changes b/package/snapper.changes index f4b15216..83559257 100644 --- a/package/snapper.changes +++ b/package/snapper.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Dec 15 15:14:39 CET 2014 - aschnell@suse.de + +- ignore everything in .snapshots not matching a number + ------------------------------------------------------------------- Fri Dec 12 10:34:37 CET 2014 - aschnell@suse.de diff --git a/snapper/Snapshot.cc b/snapper/Snapshot.cc index 7e23d5a6..ce14f0a0 100644 --- a/snapper/Snapshot.cc +++ b/snapper/Snapshot.cc @@ -41,6 +41,7 @@ #include "snapper/SnapperDefines.h" #include "snapper/Exception.h" #include "snapper/SystemCmd.h" +#include "snapper/Regex.h" namespace snapper @@ -187,15 +188,14 @@ namespace snapper void Snapshots::read() { + Regex rx("^[0-9]+$"); + SDir infos_dir = snapper->openInfosDir(); vector infos = infos_dir.entries(); for (vector::const_iterator it1 = infos.begin(); it1 != infos.end(); ++it1) { - if (*it1 == "snapshot_submenu.cfg") - continue; - - if (boost::starts_with(*it1, "tmp-mnt")) + if (!rx.match(*it1)) continue; try -- 2.47.3