Package: timemachine
Version: 0.3.0-1
Severity: important
Tags: patch

It is unclear to me how that happened, but for some reason
the code in the debian source package for timemachine-0.3.0
is missing an essential piece of code to make the command-line
mode work.

I just checked with the original source package at
http://www.plugin.org.uk/timemachine/timemachine-0.3.0.tar.gz

And here is the diff I get when diffing src/main.c from
Debian against original 0.3.0 sources.  This code needs
to be re-added to make the "-i" option work as expected:

--- src/main.c  2005-02-23 16:32:05.000000000 +0100
+++ /tmp/timemachine-0.3.0/src/main.c   2004-10-28 15:48:09.000000000 +0200
@@ -208,29 +208,56 @@
     /* Start the disk thread */
     pthread_create(&dt, NULL, (void *)&writer_thread, NULL);
 
-    gtk_init(&argc, &argv);
+#ifdef HAVE_LIBREADLINE
+    if (console || !getenv("DISPLAY") || getenv("DISPLAY")[0] == '\0') {
+      int done = 0;
+      while (!done) {
+       char *line = readline("TimeMachine> ");
+       if (!line) {
+         printf("EOF\n");
+         break;
+       }
+       if (line && *line) {
+         add_history(line);
+         if (strncmp(line, "q", 1) == 0) done = 1;
+         else if (strncmp(line, "start", 3) == 0) recording_start();
+         else if (strncmp(line, "stop", 3) == 0) recording_stop();
+         else if (strncmp(line, "help", 3) == 0) {
+           printf("Commands: start stop\n");
+         } else {
+           printf("Unknown command\n");
+          }
+       }
+       free(line);
+      }
+    } else
+#endif
+    {
+      gtk_init(&argc, &argv);
 
-    add_pixmap_directory(PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps");
-    add_pixmap_directory("pixmaps");
-    add_pixmap_directory("../pixmaps");
-
-    img_on = create_pixbuf("on.png");
-    img_off = create_pixbuf("off.png");
-    img_busy = create_pixbuf("busy.png");
-    icon_on = create_pixbuf("on-icon.png");
-    icon_off = create_pixbuf("off-icon.png");
-
-    main_window = create_window(client_name);
-    gtk_window_set_icon(GTK_WINDOW(main_window), icon_off);
-    gtk_widget_show(main_window);
+      add_pixmap_directory(PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps");
+      add_pixmap_directory("pixmaps");
+      add_pixmap_directory("../pixmaps");
+
+      img_on = create_pixbuf("on.png");
+      img_off = create_pixbuf("off.png");
+      img_busy = create_pixbuf("busy.png");
+      icon_on = create_pixbuf("on-icon.png");
+      icon_off = create_pixbuf("off-icon.png");
+
+      main_window = create_window(client_name);
+      gtk_window_set_icon(GTK_WINDOW(main_window), icon_off);
+      gtk_widget_show(main_window);
+
+      bind_meters();
+      g_timeout_add(100, meter_tick, NULL);
 
-    bind_meters();
-    g_timeout_add(100, meter_tick, NULL);
 #ifdef HAVE_LADCCA
-    gtk_idle_add(idle_cb, cca_client);
+      gtk_idle_add(idle_cb, cca_client);
 #endif
 
-    gtk_main();
+      gtk_main();
+    }
 
     cleanup();
 


-- 
Regards,
      Mario Lang

Graz University of Technology     mailto:[EMAIL PROTECTED]
Department Computing               http://www.ZID.TUGraz.at/lang/
Phone: +43 (0) 316 / 873 - 6897


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to