From: Arvin Schnell Date: Mon, 15 Dec 2014 14:15:58 +0000 (+0100) Subject: - ignore everything in .snapshots not matching a number (grub renamed it's file) X-Git-Tag: v0.2.5~3^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9d789068cbb88bcd386b131dbc4b362425844ff8;p=thirdparty%2Fsnapper.git - ignore everything in .snapshots not matching a number (grub renamed it's file) --- 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