]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- ignore everything in .snapshots not matching a number (grub renamed it's file) 138/head
authorArvin Schnell <aschnell@suse.de>
Mon, 15 Dec 2014 14:15:58 +0000 (15:15 +0100)
committerArvin Schnell <aschnell@suse.de>
Mon, 15 Dec 2014 14:15:58 +0000 (15:15 +0100)
package/snapper.changes
snapper/Snapshot.cc

index f4b152164d11f2f7e66ffca263b1c060bd48d266..83559257f010550906c2ad0d1e90cdd76b5d9517 100644 (file)
@@ -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
 
index 7e23d5a6bb6ecd3490021cf08853cfcab07916bc..ce14f0a08db37ae8303fe057c7aa93ac28552c02 100644 (file)
@@ -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<string> infos = infos_dir.entries();
        for (vector<string>::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