Opened 11 years ago

Closed 10 years ago

#5659 closed patch (fixed)

Add full path for XMLTV config file to database

Reported by: laga@… Owned by: stuartm
Priority: minor Milestone: 0.22
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Changes:

libs/libmythtv/dbcheck.cpp: adds a new column to the videosource table which holds the full path to the XMLTV config file. For some reason, mythtv segfaults when upgrading the DB with this patch. Maybe someone can spot what's wrong, the BT seems useless to me.

libs/libmythtv/videosource.cpp: insert full path to the XMLTV config file when adding/modifying a video source

programs/mythfilldatabase/filldata.cpp: get full path to XMLTV config file from database. Fall back to old behavior if there's no entry.

This patch is not as well tested as I'd like it to be. It's posted for review. A version against trunk will be posted once the underlying logic has been approved.

Attachments (5)

xmltv_config_path_in_database.diff (3.9 KB) - added by anonymous 11 years ago.
fix_dbcheck_segfault.diff (650 bytes) - added by anonymous 11 years ago.
apply on top of previous patch
xmltv_config_path_trunk.diff (5.6 KB) - added by laga@… 11 years ago.
Patch against trunk
xmltv_config_path_fixes.diff (1.6 KB) - added by laga@… 11 years ago.
5659_trunk_2.diff (4.1 KB) - added by laga 10 years ago.
New patch

Download all attachments as: .zip

Change History (15)

Changed 11 years ago by anonymous

comment:1 Changed 11 years ago by stuartm

Milestone: unknown0.21.1
Owner: changed from Isaac Richards to stuartm
Status: newassigned

comment:2 Changed 11 years ago by paulh

libs/libmythtv/dbcheck.cpp: adds a new column to the videosource table which holds the full path to the XMLTV config file. For some reason, mythtv segfaults when upgrading the DB with this patch. Maybe someone can spot what's wrong, the BT seems useless to me.

I think you need to terminate the updates[] array with a NULL like this

const QString updates[] = { "ALTER TABLE videosource ADD COLUMN configpath VARCHAR(4096) DEFAULT NULL;", NULL }; 

comment:3 Changed 11 years ago by laga+mythtv@…

That seems to have fixed it! Thanks!

Changed 11 years ago by anonymous

Attachment: fix_dbcheck_segfault.diff added

apply on top of previous patch

Changed 11 years ago by laga@…

Patch against trunk

Changed 11 years ago by laga@…

comment:4 Changed 11 years ago by anonymous

Two new patches attached:

xmltv_config_path_fixes.diff:

Save the path to the config file in the settings table to avoid database schema updates in -fixes.

xmltv_config_path_trunk.diff:

Add configpath column to videosource table. Also add magic to dbcheck.cpp to carry over config file path from settings table.

Could use more testing. Committer takes all plane ;)

comment:5 Changed 11 years ago by stuartm

(In [18314]) Store the xmltv config file path in the database, this allows mythfilldatabase to be run by a different user to mythtv-setup, which helps out Ubuntu/Mythbuntu? packagers apparently. Patch by Michael Haas. Applying the -fixes version of the patch first since an Ubuntu deadline is close, trunk version will be reviewed and applied in a few hours. Refs #5659

comment:6 Changed 11 years ago by stuartm

Status: assignedinfoneeded

The trunk patch needs some work, there are coding standards issues e.g. braces not on new lines, unused vars, code commented out and a comparison against an empty string where isEmpty() should be used instead.

It also needs updating for current trunk.

comment:7 Changed 11 years ago by stuartm

Milestone: 0.21.10.22
Version: 0.21-fixeshead

comment:8 Changed 10 years ago by danielk

Resolution: invalid
Status: infoneededclosed

info not provided

comment:9 Changed 10 years ago by laga

Resolution: invalid
Status: closednew

Updated patch against trunk attached.

Changed 10 years ago by laga

Attachment: 5659_trunk_2.diff added

New patch

comment:10 Changed 10 years ago by stuartm

Resolution: fixed
Status: newclosed

(In [20980) Optionally read the full path to the xmltv configuration files from the database for the benefit of Ubuntu which runs mythfilldatabase under a different user to mythtv-setup or something. Patch from Michael Haas. Closes #5659

Note: See TracTickets for help on using tickets.