Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
config: Fix the autorec entries migration
  • Loading branch information
perexg committed Sep 8, 2014
1 parent 4c01042 commit c2680b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
15 changes: 12 additions & 3 deletions src/config.c
Expand Up @@ -745,10 +745,11 @@ config_modify_autorec( htsmsg_t *c, uint32_t id, const char *uuid, void *aux )
uint32_t u32;
htsmsg_delete_field(c, "index");
if (!htsmsg_get_u32(c, "approx_time", &u32)) {
if (u32 == 0)
u32 = -1;
htsmsg_delete_field(c, "approx_time");
htsmsg_add_u32(c, "start", u32);
if (u32 != 0)
htsmsg_add_u32(c, "start", u32);
else
htsmsg_add_str(c, "start", "");
}
if (!htsmsg_get_u32(c, "contenttype", &u32)) {
htsmsg_delete_field(c, "contenttype");
Expand Down Expand Up @@ -827,6 +828,14 @@ config_migrate_v9 ( void )
}
htsmsg_destroy(c);
}

if ((c = hts_settings_load("autorec")) != NULL) {
HTSMSG_FOREACH(f, c) {
if (!(e = htsmsg_field_get_map(f))) continue;
hts_settings_remove("autorec/%s", f->hmf_name);
hts_settings_save(e, "dvr/autorec/%s", f->hmf_name);
}
}
}

static void
Expand Down
1 change: 0 additions & 1 deletion src/dvr/dvr_autorec.c
Expand Up @@ -398,7 +398,6 @@ dvr_autorec_entry_class_time_set(void *o, const void *v, int *tm)
const char *s = v;
int t;

printf("time set: '%s'\n", (char *)v);
if(s == NULL || s[0] == '\0')
t = -1;
else if(strchr(s, ':') != NULL)
Expand Down

6 comments on commit c2680b5

@ksooo
Copy link
Contributor

@ksooo ksooo commented on c2680b5 Sep 8, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, "tar" always exits with error code 1, tvh does not start at all.

@ksooo
Copy link
Contributor

@ksooo ksooo commented on c2680b5 Sep 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log output:
2014-09-09 17:27:08.188 [ INFO] main: Log started
2014-09-09 17:27:08.202 [ INFO] config: backup: migrating config from unknown (running 3.9.1427~g05783ac)
2014-09-09 17:27:08.202 [ INFO] config: backup: running, output file /storage/.xbmc/userdata/addon_data/service.multimedia.tvheadend/backup/unknown.tar.bz2
2014-09-09 17:27:08.222 [ ERROR] config: command '/bin/tar cjf /storage/.xbmc/userdata/addon_data/service.multimedia.tvheadend/backup/unknown.tar.bz2 --exclude backup .' returned error code 1

@perexg
Copy link
Contributor Author

@perexg perexg commented on c2680b5 Sep 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try 'cd /storage/.xbmc/userdata/addon_data/service.multimedia.tvheadend' in shell.
Then '/bin/tar cjf /storage/.xbmc/userdata/addon_data/service.multimedia.tvheadend/backup/unknown.tar.bz2 --exclude backup .' and show the reported error...

@ksooo
Copy link
Contributor

@ksooo ksooo commented on c2680b5 Sep 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine.

OpenELEC:~ # cd /storage/.xbmc/userdata/addon_data/service.multimedia.tvheadend
OpenELEC:/.xbmc/userdata/addon_data/service.multimedia.tvheadend # rm -rf backup/
OpenELEC:
/.xbmc/userdata/addon_data/service.multimedia.tvheadend # mkdir backup
OpenELEC:/.xbmc/userdata/addon_data/service.multimedia.tvheadend # /bin/tar cjf /storage/.xbmc/userdata/addon_data/service.multimedia.tvheadend/backup/unknown.tar.bz2 --exclude backup .
OpenELEC:
/.xbmc/userdata/addon_data/service.multimedia.tvheadend # ls -la backup/
total 15648
drwxr-xr-x 2 root root 4096 Sep 9 19:53 .
drwxr-xr-x 15 root root 4096 Sep 9 19:53 ..
-rw-r--r-- 1 root root 16013908 Sep 9 19:53 unknown.tar.bz2
OpenELEC:~/.xbmc/userdata/addon_data/service.multimedia.tvheadend #

@ksooo
Copy link
Contributor

@ksooo ksooo commented on c2680b5 Sep 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it be the case the writing to service.log while tar-ing the directory containing service.log is problematic? Just guessing.

@ProfYaffle
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that's the case - that tar is backing up a file that's changing - then 'quite possibly'. If OpenElec tar follows GNU tar (from https://www.gnu.org/software/tar/manual/html_section/tar_19.html) then exit 1 suggests that some files differ - although that should only be if certain command line options are used.

Please sign in to comment.