summaryrefslogtreecommitdiff
blob: a71663805cb5a9027f7ee93d30d364d03a7b58bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
--- rhythmbox-0.4.1/shell/main.c.orig	2002-12-27 01:52:38.000000000 +0200
+++ rhythmbox-0.4.1/shell/main.c	2002-12-27 01:56:06.000000000 +0200
@@ -29,6 +29,10 @@
 #include <glade/glade-init.h>
 #include <monkey-media.h>
 #include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
 #include <time.h>
 #include <string.h>
 
@@ -48,20 +52,66 @@
 static gboolean quit            = FALSE;
 static gboolean no_registration = FALSE;
 
+#define GENTOO_TOGGLE "/.rhythmbox-gentoo"
+
 static void
 check_gentoo (void)
 {
+	char *gentoo_toggle = NULL;
+	int fd;
+
+	/*
+	 * Malloc enouth memory for our needs ...
+	 */
+	gentoo_toggle = (char *)malloc(strlen(GENTOO_TOGGLE) + strlen(g_getenv("HOME")) + 1);
+
+	if ((gentoo_toggle) && ((strlen(g_getenv("HOME"))) > 1))
+	{
+		/*
+		 * Setup gentoo_toggle to contain "$HOME/.rhythmbox-gentoo"
+		 */
+		strncpy(gentoo_toggle, g_getenv("HOME"), strlen(g_getenv("HOME")));
+		strncpy(gentoo_toggle + strlen(g_getenv("HOME")), GENTOO_TOGGLE,
+				strlen(GENTOO_TOGGLE));
+	}
+	else
+		return;
+	
+
 	/*
 	 * Dear Gentoo packager,
 	 *
 	 * I would like to ask you to respect our decision to display this
 	 * message and not hack this out.
 	 */
+/*
 	if (g_file_test ("/etc/gentoo-release", G_FILE_TEST_EXISTS) == TRUE)
 	{
 		rb_warning_dialog (_("Well well well...\n\n"
-			             "Gentoo eh? You'll run into problems. We know. Don't bug us.\n\n"
+						"Gentoo eh? You'll run into problems. We know. Don't bug us.\n\n"
+						"Have a nice day."));
+	}
+ */
+	/*
+	 * While I do feel that we should not disrespect their request, this
+	 * is really a bit harsh.  Thus tone it down, and only display it once.
+	 */
+	if ((g_file_test ("/etc/gentoo-release", G_FILE_TEST_EXISTS) == TRUE) &&
+	    (g_file_test (gentoo_toggle, G_FILE_TEST_EXISTS) == FALSE))
+	{
+		rb_warning_dialog (_("Dear Gentoo User...\n\n"
+			             "Please report problems to http://bugs.gentoo.org/\n"
+						 "and NOT to the developers of Rhythmbox.\n\n"
 			             "Have a nice day."));
+
+		/* 
+		 * Create our "toggle" to check if the message should be
+		 * displayed or not ...
+		 */
+		fd = open(gentoo_toggle, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR);
+		if (fd != -1)
+			close(fd);
+		
 	}
 }