]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
Pass arg verbose to cleanup functions. 189/head
authorChrister Ekholm <che@chrekh.se>
Sun, 19 Jul 2015 21:19:53 +0000 (23:19 +0200)
committerChrister Ekholm <che@chrekh.se>
Wed, 26 Aug 2015 20:38:59 +0000 (22:38 +0200)
client/cleanup.cc
client/cleanup.h
client/snapper.cc
client/systemd-helper.cc

index d80f1b8ec019237594805ff0dfa1bcfd1b073dca..634c680ddac01fe990b83fdb007d035cbcc53844 100644 (file)
@@ -94,7 +94,7 @@ is_important(XSnapshots::const_iterator it1)
 
 
 bool
-do_cleanup_number(DBus::Connection& conn, const string& config_name)
+do_cleanup_number(DBus::Connection& conn, const string& config_name, bool verbose)
 {
     time_t min_age = 1800;
     size_t limit = 50;
@@ -153,7 +153,7 @@ do_cleanup_number(DBus::Connection& conn, const string& config_name)
     {
        list<unsigned int> nums;
        nums.push_back((*it)->getNum());
-       command_delete_xsnapshots(conn, config_name, nums, false);
+       command_delete_xsnapshots(conn, config_name, nums, verbose);
     }
 
     return true;
@@ -232,7 +232,7 @@ is_first_hourly(list<XSnapshots::const_iterator>::const_iterator first,
 
 
 bool
-do_cleanup_timeline(DBus::Connection& conn, const string& config_name)
+do_cleanup_timeline(DBus::Connection& conn, const string& config_name, bool verbose)
 {
     time_t min_age = 1800;
     size_t limit_hourly = 10;
@@ -318,7 +318,7 @@ do_cleanup_timeline(DBus::Connection& conn, const string& config_name)
     {
        list<unsigned int> nums;
        nums.push_back((*it)->getNum());
-       command_delete_xsnapshots(conn, config_name, nums, false);
+       command_delete_xsnapshots(conn, config_name, nums, verbose);
     }
 
     return true;
@@ -326,7 +326,7 @@ do_cleanup_timeline(DBus::Connection& conn, const string& config_name)
 
 
 bool
-do_cleanup_empty_pre_post(DBus::Connection& conn, const string& config_name)
+do_cleanup_empty_pre_post(DBus::Connection& conn, const string& config_name, bool verbose)
 {
     time_t min_age = 1800;
 
@@ -369,7 +369,7 @@ do_cleanup_empty_pre_post(DBus::Connection& conn, const string& config_name)
     {
        list<unsigned int> nums;
        nums.push_back((*it)->getNum());
-       command_delete_xsnapshots(conn, config_name, nums, false);
+       command_delete_xsnapshots(conn, config_name, nums, verbose);
     }
 
     return true;
index 0c5e3f09299717690eeb69640ede3924300a118b..9d00a4d243a7cc129c571c19422db7fe29b8b920 100644 (file)
 
 
 bool
-do_cleanup_number(DBus::Connection& conn, const string& config_name);
+do_cleanup_number(DBus::Connection& conn, const string& config_name, bool verbose);
 
 bool
-do_cleanup_timeline(DBus::Connection& conn, const string& config_name);
+do_cleanup_timeline(DBus::Connection& conn, const string& config_name, bool verbose);
 
 bool
-do_cleanup_empty_pre_post(DBus::Connection& conn, const string& config_name);
+do_cleanup_empty_pre_post(DBus::Connection& conn, const string& config_name, bool verbose);
index 0ee04311e28abc2612b8c2db3612b885eca0f91d..4c2ad31c9f8f0fd890aa81952b318dac6049a36a 100644 (file)
@@ -1420,15 +1420,15 @@ command_cleanup(DBus::Connection* conn, Snapper* snapper)
 
     if (cleanup == "number")
     {
-       do_cleanup_number(*conn, config_name);
+       do_cleanup_number(*conn, config_name, verbose);
     }
     else if (cleanup == "timeline")
     {
-       do_cleanup_timeline(*conn, config_name);
+       do_cleanup_timeline(*conn, config_name, verbose);
     }
     else if (cleanup == "empty-pre-post")
     {
-       do_cleanup_empty_pre_post(*conn, config_name);
+       do_cleanup_empty_pre_post(*conn, config_name, verbose);
     }
     else
     {
index db0a6687501c40e749a7f2c55c083766c84957f3..3c76371fb3d1d8d1ddee065c8ace930c34311335 100644 (file)
@@ -67,19 +67,19 @@ cleanup(DBus::Connection* conn)
        map<string, string>::const_iterator pos1 = config_info.raw.find("NUMBER_CLEANUP");
        if (pos1 != config_info.raw.end() && pos1->second == "yes")
        {
-           do_cleanup_number(*conn, config_info.config_name);
+           do_cleanup_number(*conn, config_info.config_name, false);
        }
 
        map<string, string>::const_iterator pos2 = config_info.raw.find("TIMELINE_CLEANUP");
        if (pos2 != config_info.raw.end() && pos2->second == "yes")
        {
-           do_cleanup_timeline(*conn, config_info.config_name);
+           do_cleanup_timeline(*conn, config_info.config_name, false);
        }
 
        map<string, string>::const_iterator pos3 = config_info.raw.find("EMPTY_PRE_POST_CLEANUP");
        if (pos3 != config_info.raw.end() && pos3->second == "yes")
        {
-           do_cleanup_empty_pre_post(*conn, config_info.config_name);
+           do_cleanup_empty_pre_post(*conn, config_info.config_name, false);
        }
     }
 }