#include <boost/algorithm/string.hpp>
#include <openssl/sha.h>
+#include <snapper/AppUtil.h>
#include <snapper/Enum.h>
#include <snapper/LoggerImpl.h>
#include <snapper/SystemCmd.h>
const xmlNode* node = file.getRootElement();
string tmp;
+ time_t tmp_date;
+ if (!getChildValue(node, "date", tmp) ||
+ (tmp_date = scan_datetime(tmp, true)) == (time_t)(-1))
+ {
+ y2err("The date attribute is missing or invalid from " << path);
+ SN_THROW(Exception(_("Failed to parse the date attribute from `info.xml`")));
+ }
+ else
+ {
+ meta.date = tmp_date;
+ }
+
if (!getChildValue(node, "type", tmp) || !toValue(tmp, meta.type, true))
{
y2err("The type attribute is missing from " << path);
};
State state = State::INVALID;
+
+ time_t date = 0;
SnapshotType type = SnapshotType::SINGLE;
unsigned int pre_num = 0;
string cleanup;
"/" SNAPSHOT_NAME);
TheBigThing the_big_thing(num);
- the_big_thing.date = source_snapshot.getDate();
+ the_big_thing.meta.date = source_snapshot.getDate();
the_big_thing.source_state = extra.is_read_only() ? TheBigThing::SourceState::READ_ONLY :
TheBigThing::SourceState::READ_WRITE;
the_big_thing.source_uuid = extra.get_uuid();
void remove(const BackupConfig& backup_config, bool quiet);
unsigned int num;
- time_t date = 0; // as reported by snapper
SourceState source_state = SourceState::MISSING;
TargetState target_state = TargetState::MISSING;
return the_big_thing.num;
case Column::DATE:
- if (the_big_thing.date == 0)
+ if (the_big_thing.meta.date == 0)
return nullptr;
- return datetime(the_big_thing.date, output_options.utc, output_options.iso);
+ return datetime(the_big_thing.meta.date, output_options.utc,
+ output_options.iso);
case Column::SOURCE_STATE:
if (the_big_thing.source_state == TheBigThing::SourceState::MISSING)