The *.sr (libsigrok session) file format has changed since the last
libsigrok release. Frontends using older libsigrok versions will not
be able to read *.sr files created by frontends using the new file format.
Thus, bump the version number of the file format to 2.
Current libsigrok will read both version 1 and version 2 files
correctly, and always write version 2 files.
zip_fclose(zf);
s[ret] = 0;
version = strtoull(s, NULL, 10);
- if (version != 1) {
+ if (version > 2) {
sr_dbg("Cannot handle sigrok session file version %d.", version);
return SR_ERR;
}
+ sr_spew("Detected sigrok session file version %d.", version);
/* read "metadata" */
if (zip_stat(archive, "metadata", 0, &zs) == -1) {
return SR_ERR;
/* "version" */
- version[0] = '1';
+ version[0] = '2';
if (!(versrc = zip_source_buffer(zipfile, version, 1, 0)))
return SR_ERR;
if (zip_add(zipfile, "version", versrc) == -1) {