Commits

jjacky committed 8f5dad5

bump to 1.1.0 & updated HISTORY; minor code changes

Some variables in main.c weren't used with DISABLE_GUI, put them within #ifdef
Some variables in news.c (relating to GDK stuff, for tooltip on links) weren't properly put within #ifdef blocks, fixed

Comments (0)

Files changed (5)

+
+# 08/10/2012, v1.1.0
+
+- Added options --manual-checks (-m) and --auto-checks (-a) to run manual/auto
+checks from command line. No GUI used at all, everything gets printed on
+stderr/stdout (using the same templates as for notifications). 
+
+This can be done without the need for a DISPLAY (no GTK init performed), thus
+works from a tty or through SSH. This can also be useful to use kalu from scripts.
+
+- A configure option --disable-gui is also available, to make kalu a small
+CLI-only binary (i.e. no dependency to GTK nor libnotify), which could be useful
+on GUIless box (e.g. servers), where kalu can then still be used to check for
+upgrades, watched packages, etc
+
+Running this CLI kalu without arguments will do the same a using --manual-checks
+
+- News parser: a few fixes: LF inside <code> blocks are preserved, correct
+processing of &minus;, &lsquo;, &rsquo;, &amp;, &lt; and &gt;
+
+- News parser: links are now supported: showed blue & underlined, URL as tooltip,
+click to open in default browser (via xdg-open)
+
 
 # 05/10/2012, v1.0.0
 
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.68])
-AC_INIT([kalu], [1.0.0], [i.am.jack.mail@gmail.com])
+AC_INIT([kalu], [1.1.0], [i.am.jack.mail@gmail.com])
 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
 AC_CONFIG_SRCDIR([kalu.h])
 AC_CONFIG_HEADERS([config.h])
 will show the complete news. Note that this is done through kalu's own
 rendering (i.e. there is no HTML engine used) and as such the rendering
 might differ.
-For instance, neither images nor links are supported.
+For example, images are not supported.
+
+Links are processed through B<xdg-open(1)> to be opened in your default browser.
 
 =back
 
 
 Note that GTK+ and other dependencies are obviously still required, although
 there is a I<configure> option available to disable all GUI completely during
-compilation, in order to produce a CLI-version of kalu.
+compilation, in order to produce a CLI version of kalu.
 
 =head1 BUGS
 
     double      size_h;
     replacement_t *replacements[7];
     
+    #ifdef DISABLE_GUI
+    (void) xml_news;
+    #endif
+    
     templates_t *t, *tt;
     /* tpl_upgrades is the ref/fallback for pretty much everything */
     t = config->tpl_upgrades;
     gchar *xml_news;
     gboolean got_something =  FALSE;
     gint nb_syncdbs     = -1;
+    #ifndef DISABLE_GUI
     gint nb_upgrades    = -1;
     gint nb_watched     = -1;
     gint nb_aur         = -1;
     gint nb_watched_aur = -1;
     gint nb_news        = -1;
+    #endif /* DISABLE_GUI */
     unsigned int checks = (is_auto) ? config->checks_auto : config->checks_manual;
     
     if (checks & CHECK_NEWS)
         if (news_has_updates (&packages, &xml_news, &error))
         {
             got_something = TRUE;
+            #ifndef DISABLE_GUI
             nb_news = (gint) alpm_list_count (packages);
+            #endif /* DISABLE_GUI */
             notify_updates (packages, CHECK_NEWS, xml_news);
             FREELIST (packages);
             /* we dont free xml_news because it might be used by the notification
             if (kalu_alpm_has_updates (&packages, &error))
             {
                 got_something = TRUE;
+                #ifndef DISABLE_GUI
                 nb_upgrades = (gint) alpm_list_count (packages);
+                #endif /* DISABLE_GUI */
                 notify_updates (packages, CHECK_UPGRADES, NULL);
                 FREE_PACKAGE_LIST (packages);
             }
+            #ifndef DISABLE_GUI
             else if (error == NULL)
             {
                 nb_upgrades = 0;
             }
             else
+            #else
+            else if (error != NULL)
+            #endif /* DISABLE_GUI */
             {
                 got_something = TRUE;
                 /* means the error is likely to come from a dependency issue/conflict */
             if (kalu_alpm_has_updates_watched (&packages, config->watched, &error))
             {
                 got_something = TRUE;
+                #ifndef DISABLE_GUI
                 nb_watched = (gint) alpm_list_count (packages);
+                #endif
                 notify_updates (packages, CHECK_WATCHED, NULL);
                 /* watched are a special case, because the list of packages must not be
                  * free-d right now, but later when the notification is over. this is
                  * because the notification might use it to show the "mark packages"
                  * window/list */
             }
+            #ifndef DISABLE_GUI
             else if (error == NULL)
             {
                 nb_watched = 0;
             }
             else
+            #else
+            else if (error != NULL)
+            #endif
             {
                 got_something = TRUE;
                 do_notify_error ("Unable to check for updates of watched packages",
                 if (aur_has_updates (&packages, aur_pkgs, FALSE, &error))
                 {
                     got_something = TRUE;
+                    #ifndef DISABLE_GUI
                     nb_aur = (gint) alpm_list_count (packages);
+                    #endif
                     notify_updates (packages, CHECK_AUR, NULL);
                     FREE_PACKAGE_LIST (packages);
                 }
+                #ifndef DISABLE_GUI
                 else if (error == NULL)
                 {
                     nb_aur = 0;
                 }
                 else
+                #else
+                else if (error != NULL)
+                #endif
                 {
                     got_something = TRUE;
                     do_notify_error ("Unable to check for AUR packages", error->message);
                 }
                 alpm_list_free (aur_pkgs);
             }
+            #ifndef DISABLE_GUI
             else if (error == NULL)
             {
                 nb_aur = 0;
             }
             else
+            #else
+            else if (error != NULL)
+            #endif
             {
                 got_something = TRUE;
                 do_notify_error ("Unable to check for AUR packages", error->message);
         if (aur_has_updates (&packages, config->watched_aur, TRUE, &error))
         {
             got_something = TRUE;
+            #ifndef DISABLE_GUI
             nb_watched_aur = (gint) alpm_list_count (packages);
+            #endif
             notify_updates (packages, CHECK_WATCHED_AUR, NULL);
             /* watched are a special case, because the list of packages must not be
              * free-d right now, but later when the notification is over. this is
              * because the notification might use it to show the "mark packages"
              * window/list */
         }
+        #ifndef DISABLE_GUI
         else if (error == NULL)
         {
             nb_watched_aur = 0;
         }
         else
+        #else
+        else if (error != NULL)
+        #endif
         {
             got_something = TRUE;
             do_notify_error ("Unable to check for updates of watched AUR packages",
                       GError             **error _UNUSED_);
 
 
-#endif /* DISABLE_GUI */
-
 /* TRUE when hovering over a link */
 static gboolean hovering_link = FALSE;
 /* standard & hover-link cursors */
 /* nb of windows open */
 static gint nb_windows = 0;
 
+#endif /* DISABLE_GUI */
+
 static void
 xml_parser_updates_text (GMarkupParseContext   *context,
                          const gchar           *text,