rpms/xmms/devel xmms-1.2.10-configfile-safe-write.patch, NONE, 1.1 xmms-1.2.10-reposition.patch, NONE, 1.1 xmms.spec, 1.28, 1.29

Paul F. Johnson (pfj) fedora-extras-commits at redhat.com
Thu Jan 18 23:33:26 UTC 2007


Author: pfj

Update of /cvs/extras/rpms/xmms/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1094/devel

Modified Files:
	xmms.spec 
Added Files:
	xmms-1.2.10-configfile-safe-write.patch 
	xmms-1.2.10-reposition.patch 
Log Message:
auto-import xmms-1.2.10-31 on branch devel from xmms-1.2.10-31.src.rpm

xmms-1.2.10-configfile-safe-write.patch:

--- NEW FILE xmms-1.2.10-configfile-safe-write.patch ---
--- xmms-1.2.10/libxmms/configfile.c.bak	2003-05-20 00:22:07.000000000 +0300
+++ xmms-1.2.10/libxmms/configfile.c	2006-12-30 15:08:31.045540619 +0200
@@ -123,12 +123,27 @@ gboolean xmms_cfg_write_file(ConfigFile 
 	GList *section_list, *line_list;
 	ConfigSection *section;
 	ConfigLine *line;
+	gchar *tmpfn;
+	int tmpfnfd;
 
 	g_return_val_if_fail(cfg != NULL, FALSE);
 	g_return_val_if_fail(filename != NULL, FALSE);
 
-	if (!(file = fopen(filename, "w")))
+	tmpfn = g_strconcat(filename, ".XXXXXX", NULL);
+	if (!tmpfn)
 		return FALSE;
+	tmpfnfd = mkstemp(tmpfn);
+	if (tmpfnfd == -1) {
+		free (tmpfn);
+		return FALSE;
+	}
+	file = fdopen(tmpfnfd, "w");
+	if (!file) {
+		unlink (tmpfn);
+		g_free (tmpfn);
+		close (tmpfnfd);		
+		return FALSE;
+	}
 
 	section_list = cfg->sections;
 	while (section_list)
@@ -136,20 +151,36 @@ gboolean xmms_cfg_write_file(ConfigFile 
 		section = (ConfigSection *) section_list->data;
 		if (section->lines)
 		{
-			fprintf(file, "[%s]\n", section->name);
+			if (fprintf(file, "[%s]\n", section->name) < 0)
+				goto err;
 			line_list = section->lines;
 			while (line_list)
 			{
 				line = (ConfigLine *) line_list->data;
-				fprintf(file, "%s=%s\n", line->key, line->value);
+				if (fprintf(file, "%s=%s\n", line->key, line->value) < 0)
+					goto err;
 				line_list = g_list_next(line_list);
 			}
-			fprintf(file, "\n");
+			if (fprintf(file, "\n") < 0)
+				goto err;
 		}
 		section_list = g_list_next(section_list);
 	}
-	fclose(file);
+	if (fflush (file) == EOF)
+		goto err;
+	if (fsync (tmpfnfd) == -1) /* dir not synced */
+		goto err;
+	if (fclose(file) == EOF)
+		goto err;
+	if (rename (tmpfn, filename) == -1)
+		goto err;
 	return TRUE;
+
+err:
+	fclose(file);
+	unlink(tmpfn);
+	g_free (tmpfn);
+	return FALSE;
 }
 
 gboolean xmms_cfg_write_default_file(ConfigFile * cfg)

xmms-1.2.10-reposition.patch:

--- NEW FILE xmms-1.2.10-reposition.patch ---
--- xmms-1.2.10/xmms/dock.c.bak	2001-03-08 07:48:38.000000000 +0200
+++ xmms-1.2.10/xmms/dock.c	2007-01-12 22:32:36.156705327 +0200
@@ -625,6 +625,17 @@
 	
 void dock_set_uposition(GtkWidget *w, gint x, gint y)
 {
+	gint maxx, maxy;
+
+	maxx = gdk_screen_width();
+	maxy = gdk_screen_height();	
+	if ((maxx < (x + 15)) || (maxy < (y + 15))) {
+		x = maxx / 2;
+		y = maxy / 2;
+		g_warning("%s: current screen size %dx%d smaller than "
+			  "window position specified in config file, resetting to "
+			  "x=%d y=%d\n", __FUNCTION__, maxx, maxy, x, y);
+	}
 	gtk_widget_set_uposition(w, x, y);
 	gtk_object_set_data(GTK_OBJECT(w), "window_x", GINT_TO_POINTER(x));
 	gtk_object_set_data(GTK_OBJECT(w), "window_y", GINT_TO_POINTER(y));


Index: xmms.spec
===================================================================
RCS file: /cvs/extras/rpms/xmms/devel/xmms.spec,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- xmms.spec	2 Jan 2007 01:05:01 -0000	1.28
+++ xmms.spec	18 Jan 2007 23:32:56 -0000	1.29
@@ -31,6 +31,8 @@
 Patch11:        %{name}-1.2.10-gcc4.patch
 Patch12:        %{name}-1.2.10-crossfade-0.3.9.patch
 Patch13:        %{name}-1.2.10-pls-188603.patch
+Patch14:	%{name}-1.2.10-configfile-safe-write.patch
+Patch15:	%{name}-1.2.10-reposition.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  gtk+-devel
@@ -60,6 +62,7 @@
 %package        libs
 Summary:        XMMS engine and core plugins
 Group:          System Environment/Libraries
+Requires:	%{name} = %{epoch}:%{version}-%{release}
 
 %description    libs
 The X MultiMedia System player engine and core plugins.
@@ -113,6 +116,8 @@
 %patch12 -p1 -b .crossfade
 # Randomize playlists better
 %patch13 -p1 -b .pls
+%patch14 -p1
+%patch15 -p1
 # Avoid standard rpaths on lib64 archs, --disable-rpath doesn't do it
 sed -i -e 's|"/lib /usr/lib"|"/%{_lib} %{_libdir}"|' configure
 
@@ -223,8 +228,8 @@
 
 
 %changelog
-* Tue Jan  2 2007 Paul F. Johnson <paul at all-the-johnsons.co.uk> 1:1.2.10-31
-- removed R from libs
+* Thu Jan 18 2007 Paul F. Johnson <paul at all-the-johnsons.co.uk> 1:1.2.10-31
+- fixes for repositioning on mode change and .xmms file
 
 * Mon Jan  1 2007 Paul F. Johnson <paul at all-the-johnsons.co.uk> 1:1.2.10-30
 - new package owner




More information about the fedora-extras-commits mailing list