diff -u tvtime-1.0.2/debian/changelog tvtime-1.0.2/debian/changelog --- tvtime-1.0.2/debian/changelog +++ tvtime-1.0.2/debian/changelog @@ -1,3 +1,10 @@ +tvtime (1.0.2-7ubuntu9.1) precise-proposed; urgency=low + + * debian/patches/tvtime-1.0.2-saveconfig.patch: Prevents needless creation of + $HOME/.tvtime by tvtime-configure. (LP: #92752) + + -- POJAR GEORGE Sun, 09 Dec 2012 22:44:22 +0000 + tvtime (1.0.2-7ubuntu9) precise; urgency=low * debian/patches/tvtime-1.0.2-volume.patch: Leave volume muted when decreasing diff -u tvtime-1.0.2/debian/patches/series tvtime-1.0.2/debian/patches/series --- tvtime-1.0.2/debian/patches/series +++ tvtime-1.0.2/debian/patches/series @@ -33,0 +34 @@ +tvtime-1.0.2-saveconfig.patch only in patch2: unchanged: --- tvtime-1.0.2.orig/debian/patches/tvtime-1.0.2-saveconfig.patch +++ tvtime-1.0.2/debian/patches/tvtime-1.0.2-saveconfig.patch @@ -0,0 +1,183 @@ +## Description: Prevents needless creation of $HOME/.tvtime by tvtime-configure. +## Origin: Debian + http://patch-tracker.debian.org/patch/series/view/tvtime/1.0.2-10/saveconfig.diff +## Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=694892 +## Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/tvtime/+bug/92752 +## Author: Bart Martens +## Forwarded: not-needed +Index: tvtime-1.0.2/src/tvtimeconf.c +=================================================================== +--- tvtime-1.0.2.orig/src/tvtimeconf.c 2012-12-09 22:43:11.779485973 +0000 ++++ tvtime-1.0.2/src/tvtimeconf.c 2012-12-09 22:43:44.907484989 +0000 +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + #ifdef HAVE_CONFIG_H + # include "config.h" + #endif +@@ -587,7 +588,30 @@ + } + + xmlKeepBlanksDefault( 0 ); +- xmlSaveFormatFile( config_filename, doc, 1 ); ++ ++ if( create_file ) ++ { ++ char *temp_config_filename = strdup( config_filename ); ++ ++ if( ! temp_config_filename ) ++ { ++ fprintf( stderr, "strdup failed for config_filename %s\n", config_filename ); ++ xmlFreeDoc( doc ); ++ return 0; ++ } ++ ++ mkdir_and_force_owner( dirname( temp_config_filename ), getuid(), getgid() ); ++ ++ free( temp_config_filename ); ++ } ++ ++ if( xmlSaveFormatFile( config_filename, doc, 1 ) == -1 ) ++ { ++ fprintf( stderr, "xmlSaveFormatFile returned -1 for config_filename %s\n", config_filename ); ++ xmlFreeDoc( doc ); ++ return 0; ++ } ++ + if( create_file ) { + if( chown( config_filename, getuid(), getgid() ) < 0 ) { + lfprintf( stderr, _("Cannot change owner of %s: %s.\n"), +@@ -879,14 +903,6 @@ + ct->buttonmapmenu[ 4 ] = TVTIME_MENU_UP; + ct->buttonmapmenu[ 5 ] = TVTIME_MENU_DOWN; + +- /* Make the ~/.tvtime directory every time on startup, to be safe. */ +- if( asprintf( &temp_dirname, "%s/.tvtime", getenv( "HOME" ) ) < 0 ) { +- /* FIXME: Clean up ?? */ +- return 0; +- } +- mkdir_and_force_owner( temp_dirname, ct->uid, getgid() ); +- free( temp_dirname ); +- + /* First read in global settings. */ + asprintf( &base, "%s/tvtime.xml", CONFDIR ); + if( file_is_openable_for_read( base ) ) { +@@ -1086,6 +1102,7 @@ + int option_index = 0; + int filename_specified = 0; + int c; ++ int config_needs_saving = 0; + + if( argc == 1 ) { + print_config_usage( argv ); +@@ -1095,10 +1112,10 @@ + while( (c = getopt_long( argc, argv, "aAhmMF:g:I:d:b:i:c:n:D:f:x:t:l:R:", + long_options, &option_index )) != -1 ) { + switch( c ) { +- case 'a': ct->aspect = 1; break; +- case 'A': ct->aspect = 0; break; +- case 'm': ct->fullscreen = 1; break; +- case 'M': ct->fullscreen = 0; break; ++ case 'a': ct->aspect = 1; config_needs_saving = 1; break; ++ case 'A': ct->aspect = 0; config_needs_saving = 1; break; ++ case 'm': ct->fullscreen = 1; config_needs_saving = 1; break; ++ case 'M': ct->fullscreen = 0; config_needs_saving = 1; break; + case 'F': if( ct->config_filename ) free( ct->config_filename ); + filename_specified = 1; + ct->config_filename = expand_user_path( optarg ); +@@ -1108,18 +1125,20 @@ + ct->config_filename ); + conf_xml_parse( ct, ct->config_filename ); + } ++ // intentionally not : config_needs_saving = 1; + break; + case 'x': if( ct->mixerdev ) { free( ct->mixerdev ); } +- ct->mixerdev = strdup( optarg ); break; ++ ct->mixerdev = strdup( optarg ); config_needs_saving = 1; break; + case 'g': if( ct->geometry ) { free( ct->geometry ); } +- ct->geometry = strdup( optarg ); break; +- case 'I': ct->inputwidth = atoi( optarg ); break; ++ ct->geometry = strdup( optarg ); config_needs_saving = 1; break; ++ case 'I': ct->inputwidth = atoi( optarg ); config_needs_saving = 1; break; + case 'd': if( !optarg ) { + fprintf( stdout, "V4LDevice:%s\n", + config_get_v4l_device( ct ) ); + } else { + free( ct->v4ldev ); + ct->v4ldev = strdup( optarg ); ++ config_needs_saving = 1; + } + break; + case 'b': if( !optarg ) { +@@ -1128,6 +1147,7 @@ + } else { + free( ct->vbidev ); + ct->vbidev = strdup( optarg ); ++ config_needs_saving = 1; + } + break; + case 'i': if( !optarg ) { +@@ -1135,16 +1155,18 @@ + config_get_inputnum( ct ) ); + } else { + ct->inputnum = atoi( optarg ); ++ config_needs_saving = 1; + } + break; + case 'c': ct->prev_channel = ct->start_channel; +- ct->start_channel = atoi( optarg ); break; ++ ct->start_channel = atoi( optarg ); config_needs_saving = 1; break; + case 't': if( !optarg ) { + fprintf( stdout, "XMLTVFile:%s\n", + config_get_xmltv_file( ct ) ); + } else { + if( ct->xmltvfile ) free( ct->xmltvfile ); + ct->xmltvfile = expand_user_path( optarg ); ++ config_needs_saving = 1; + } + break; + case 'l': if( !optarg ) { +@@ -1153,6 +1175,7 @@ + } else { + if( ct->xmltvlanguage ) free( ct->xmltvlanguage ); + ct->xmltvlanguage = strdup( optarg ); ++ config_needs_saving = 1; + } + break; + case 'n': if( !optarg ) { +@@ -1160,6 +1183,7 @@ + } else { + free( ct->norm ); + ct->norm = strdup( optarg ); ++ config_needs_saving = 1; + } + break; + case 'f': if( !optarg ) { +@@ -1168,6 +1192,7 @@ + } else { + free( ct->freq ); + ct->freq = strdup( optarg ); ++ config_needs_saving = 1; + } + break; + case 'R': if( !optarg ) { +@@ -1175,6 +1200,7 @@ + config_get_priority( ct ) ); + } else { + ct->priority = atoi( optarg ); ++ config_needs_saving = 1; + } + break; + default: +@@ -1183,6 +1209,9 @@ + } + } + ++ if( ! config_needs_saving ) ++ return 1; ++ + if( !filename_specified ) { + char *fifofile = get_tvtime_fifo_filename( config_get_uid( ct ) ); + int fifofd;