Commit 0e8615eb authored by Bart Martens's avatar Bart Martens Committed by Tobias Frost

Import Debian changes 1.0.2-10

tvtime (1.0.2-10) unstable; urgency=low

  * debian/patches/saveconfig.diff: Added.  Prevents needless creation of
    $HOME/.tvtime by tvtime-configure.  Closes: #694892, #445192.
parent 5a0bc722
......@@ -4,7 +4,7 @@
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012 Free Software Foundation, Inc.
timestamp='2012-02-10'
timestamp='2012-04-18'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
......@@ -225,6 +225,12 @@ case $os in
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-lynx*178)
os=-lynxos178
;;
-lynx*5)
os=-lynxos5
;;
-lynx*)
os=-lynxos
;;
......@@ -1537,6 +1543,9 @@ case $basic_machine in
c4x-* | tic4x-*)
os=-coff
;;
hexagon-*)
os=-elf
;;
tic54x-*)
os=-coff
;;
......
tvtime (1.0.2-10) unstable; urgency=low
* debian/patches/saveconfig.diff: Added. Prevents needless creation of
$HOME/.tvtime by tvtime-configure. Closes: #694892, #445192.
-- Bart Martens <bartm@debian.org> Fri, 07 Dec 2012 08:44:21 +0000
tvtime (1.0.2-9) unstable; urgency=low
* debian/patches/libpng.diff: Added. Closes: #650582.
......
--- ../orig/tvtime-1.0.2/./src/tvtimeconf.c 2005-09-08 04:07:56.000000000 +0000
+++ ./src/tvtimeconf.c 2012-12-07 11:05:25.000000000 +0000
@@ -34,6 +34,7 @@
#include <errno.h>
#include <libxml/parser.h>
#include <math.h>
+#include <libgen.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
@@ -565,7 +566,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"),
@@ -844,14 +868,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 ) ) {
@@ -1043,6 +1059,7 @@
int option_index = 0;
int filename_specified = 0;
int c;
+ int config_needs_saving = 0;
if( argc == 1 ) {
print_config_usage( argv );
@@ -1052,10 +1069,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 );
@@ -1065,18 +1082,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 ) {
@@ -1085,6 +1104,7 @@
} else {
free( ct->vbidev );
ct->vbidev = strdup( optarg );
+ config_needs_saving = 1;
}
break;
case 'i': if( !optarg ) {
@@ -1092,16 +1112,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 ) {
@@ -1110,6 +1132,7 @@
} else {
if( ct->xmltvlanguage ) free( ct->xmltvlanguage );
ct->xmltvlanguage = strdup( optarg );
+ config_needs_saving = 1;
}
break;
case 'n': if( !optarg ) {
@@ -1117,6 +1140,7 @@
} else {
free( ct->norm );
ct->norm = strdup( optarg );
+ config_needs_saving = 1;
}
break;
case 'f': if( !optarg ) {
@@ -1125,6 +1149,7 @@
} else {
free( ct->freq );
ct->freq = strdup( optarg );
+ config_needs_saving = 1;
}
break;
case 'R': if( !optarg ) {
@@ -1132,6 +1157,7 @@
config_get_priority( ct ) );
} else {
ct->priority = atoi( optarg );
+ config_needs_saving = 1;
}
break;
default:
@@ -1140,6 +1166,9 @@
}
}
+ if( ! config_needs_saving )
+ return 1;
+
if( !filename_specified ) {
char *fifofile = get_tvtime_fifo_filename( config_get_uid( ct ) );
int fifofd;
fullscreen.diff
typo.diff
libpng.diff
saveconfig.diff
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment