[Goodies-commits] r3405 - in xfce4-smartpm-plugin/trunk: . icons/48x48 src

Anders F Bjorklund afb at xfce.org
Sat Oct 20 10:39:57 CEST 2007


Author: afb
Date: 2007-10-20 08:39:57 +0000 (Sat, 20 Oct 2007)
New Revision: 3405

Added:
   xfce4-smartpm-plugin/trunk/description-pak
   xfce4-smartpm-plugin/trunk/icons/48x48/xfce4-gslapt.png
Modified:
   xfce4-smartpm-plugin/trunk/ChangeLog
   xfce4-smartpm-plugin/trunk/Makefile.am
   xfce4-smartpm-plugin/trunk/README
   xfce4-smartpm-plugin/trunk/configure.in.in
   xfce4-smartpm-plugin/trunk/icons/48x48/Makefile.am
   xfce4-smartpm-plugin/trunk/src/xfcesmart.c
Log:
support for slapt-get/gslapt package manager

Modified: xfce4-smartpm-plugin/trunk/ChangeLog
===================================================================
--- xfce4-smartpm-plugin/trunk/ChangeLog	2007-10-20 08:39:06 UTC (rev 3404)
+++ xfce4-smartpm-plugin/trunk/ChangeLog	2007-10-20 08:39:57 UTC (rev 3405)
@@ -75,4 +75,5 @@
 2007-10-07	Anders F Bjorklund <afb at users.sourceforge.net>
 
 	* Move RPM Specfile to a "redhat" subdirectory instead
+	* Add support for slapt-get and gslapt, for Vector Linux
 

Modified: xfce4-smartpm-plugin/trunk/Makefile.am
===================================================================
--- xfce4-smartpm-plugin/trunk/Makefile.am	2007-10-20 08:39:06 UTC (rev 3404)
+++ xfce4-smartpm-plugin/trunk/Makefile.am	2007-10-20 08:39:57 UTC (rev 3405)
@@ -9,6 +9,7 @@
 
 distclean-local:
 	rm -rf *.cache *~
+	@rm -rf doc-pak
 
 rpm: dist
 	rpmbuild -ta $(PACKAGE)-$(VERSION).tar.gz
@@ -16,7 +17,26 @@
 deb:
 	dpkg-buildpackage -uc -us -rfakeroot -i.svn
 
+PKGFLAGS = --default \
+	--pkgname=$(PACKAGE) \
+	--pkgversion=$(VERSION) \
+	--pkgrelease=0 \
+	--pkglicense="GNU GPL" \
+	--pkggroup="xfce"
+
+doc-pak: README COPYING NEWS ChangeLog AUTHORS THANKS TODO
+	mkdir -p $@
+	cp -p $^ $@
+
+tgz: doc-pak
+	checkinstall -t slackware -S $(PKGFLAGS)
+tbz: doc-pak
+	checkinstall -t slackware -B $(PKGFLAGS)
+tlz: doc-pak
+	checkinstall -t slackware -L $(PKGFLAGS)
+
 EXTRA_DIST =								\
+	description-pak							\
 	intltool-extract.in						\
 	intltool-merge.in						\
 	intltool-update.in

Modified: xfce4-smartpm-plugin/trunk/README
===================================================================
--- xfce4-smartpm-plugin/trunk/README	2007-10-20 08:39:06 UTC (rev 3404)
+++ xfce4-smartpm-plugin/trunk/README	2007-10-20 08:39:57 UTC (rev 3405)
@@ -10,6 +10,9 @@
 It can also be configured, though with less features and functionality,
 to use either the Yum (+Extender) or APT (+Synaptic) package managers.
 
+Alternatively you can try the Slapt package manager (slapt-get and gslapt)
+for Slackware and Vector Linux, although these are highly experimental...
+
 Installation
 ============
 
@@ -21,6 +24,9 @@
 If compiling directly from the trunk, you need to run `./autogen.sh`
 To make an RPM package, you can use "make rpm". For DEB, "make deb".
 
+To make a Slackware tar package, use one of the tgz/tbz/tlz targets.
+(You will probably need to run that make command as the root user.)
+
 Usage
 =====
 
@@ -48,6 +54,8 @@
 Yum   | yum -C check-update                 | su -c "yum check-update"         |
       |-------------------------------------|----------------------------------|
 APT   | apt-get --simulate dist-upgrade     | sudo apt-get update              |
+      |-------------------------------------|----------------------------------|
+Slapt | slapt-get --simulate --dist-upgrade | su -c "slapt-get --update"       |
       +-------------------------------------+----------------------------------+
 
 How to report bugs?

Modified: xfce4-smartpm-plugin/trunk/configure.in.in
===================================================================
--- xfce4-smartpm-plugin/trunk/configure.in.in	2007-10-20 08:39:06 UTC (rev 3404)
+++ xfce4-smartpm-plugin/trunk/configure.in.in	2007-10-20 08:39:57 UTC (rev 3405)
@@ -98,6 +98,12 @@
 AC_CHECK_PROG(APT_GET, apt-get, apt-get)
 AC_CHECK_PROG(SYNAPTIC, synaptic, synaptic)
 
+dnl ********************************
+dnl *** Check for Slapt programs ***
+dnl ********************************
+AC_CHECK_PROG(SLAPT_GET, slapt-get, slapt-get)
+AC_CHECK_PROG(GSLAPT, gslapt, gslapt)
+
 dnl ***********************************
 dnl *** Check for required packages ***
 dnl ***********************************

Added: xfce4-smartpm-plugin/trunk/description-pak
===================================================================
--- xfce4-smartpm-plugin/trunk/description-pak	                        (rev 0)
+++ xfce4-smartpm-plugin/trunk/description-pak	2007-10-20 08:39:57 UTC (rev 3405)
@@ -0,0 +1,8 @@
+xfce4-smartpm-plugin (Smart Package Manager plugin for the Xfce panel)
+
+Plugin for the Xfce 4 panel that checks for package upgrades using the 
+Smart Package Manager, or optionally using some other package manager.
+
+Website: http://goodies.xfce.org/projects/panel-plugins/xfce4-smartpm-plugin
+License: GNU GPL
+Author: Anders F Bjorklund <afb at users.sourceforge.net>

Modified: xfce4-smartpm-plugin/trunk/icons/48x48/Makefile.am
===================================================================
--- xfce4-smartpm-plugin/trunk/icons/48x48/Makefile.am	2007-10-20 08:39:06 UTC (rev 3404)
+++ xfce4-smartpm-plugin/trunk/icons/48x48/Makefile.am	2007-10-20 08:39:57 UTC (rev 3405)
@@ -5,6 +5,7 @@
 	xfce4-smart.png							\
 	xfce4-yumex.png							\
 	xfce4-synaptic.png						\
+	xfce4-gslapt.png						\
 	xfce-nopackage.png						\
 	xfce-newpackage.png
 

Added: xfce4-smartpm-plugin/trunk/icons/48x48/xfce4-gslapt.png
===================================================================
(Binary files differ)


Property changes on: xfce4-smartpm-plugin/trunk/icons/48x48/xfce4-gslapt.png
___________________________________________________________________
Name: svn:mime-type
   + image/png

Modified: xfce4-smartpm-plugin/trunk/src/xfcesmart.c
===================================================================
--- xfce4-smartpm-plugin/trunk/src/xfcesmart.c	2007-10-20 08:39:06 UTC (rev 3404)
+++ xfce4-smartpm-plugin/trunk/src/xfcesmart.c	2007-10-20 08:39:57 UTC (rev 3405)
@@ -55,6 +55,7 @@
   PACKAGE_MANAGER_SMART	= 0, /* use Smart Package Manager */
   PACKAGE_MANAGER_YUM	= 1, /* use Yum+Extender (Fedora) */
   PACKAGE_MANAGER_APT	= 2, /* use APT+Synaptic (Ubuntu) */
+  PACKAGE_MANAGER_SLAPT	= 3, /* use slapt+gslapt (Vector) */
 };
 
 #define SMART_WEBSITE "http://smartpm.org/"
@@ -71,6 +72,10 @@
 #define APT_PROGRAM   "synaptic"
 #define APT_UPDATE    "apt-get"
 
+#define SLAPT_WEBSITE "http://software.jaos.org/#gslapt"
+#define SLAPT_PROGRAM "gslapt"
+#define SLAPT_UPDATE  "slapt-get"
+
 #define TIMEOUT_TIME  1000 /* milliseconds */
 
 #define PROGRESS_TIME 5*60 /* seconds */
@@ -99,6 +104,9 @@
 static void
 smart_sudo_smart_gui(SmartPlugin *smart, gchar *args);
 
+static void
+smart_launch_program(SmartPlugin *smart);
+
 static gboolean
 smart_size_changed (XfcePanelPlugin *plugin,
                      gint             size,
@@ -196,6 +204,9 @@
         case PACKAGE_MANAGER_APT:
           /* TODO: determine number of new packages in APT channels */
           break;
+        case PACKAGE_MANAGER_SLAPT:
+          /* TODO: determine number of new packages in Slapt channels */
+          break;
       }
     }
     fclose(file);
@@ -310,6 +321,13 @@
       argv[2] = "update";
       terminal = TRUE;
       break;
+    case PACKAGE_MANAGER_SLAPT:
+      argv[0] = PATH_SU;
+      argv[1] = "-c";
+      argv[2] = "\"" SLAPT_UPDATE " "\
+                "--update" "\"" ;
+      terminal = TRUE;
+      break;
     default:
       return 0;
   }
@@ -323,6 +341,7 @@
   
     if (smart->package_manager == PACKAGE_MANAGER_YUM) title = YUM_UPDATE;
     if (smart->package_manager == PACKAGE_MANAGER_APT) title = APT_UPDATE;
+    if (smart->package_manager == PACKAGE_MANAGER_SLAPT) title = SLAPT_UPDATE;
   
     args = g_strdup_printf("%s %s %s",
                  argv[0], argv[1], argv[2]);
@@ -368,6 +387,7 @@
     {
       /* smart-update not available */
       smart_sudo_smart_gui(smart, "update");
+      gtk_tooltips_set_tip(smart->tooltip, smart->button, _("Channels updated."), NULL);
     }
     else
     {
@@ -466,7 +486,13 @@
               /* TODO: read package names */
             }
             break;
-        }
+           case PACKAGE_MANAGER_SLAPT:
+            /* 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. */
+            if (strstr(p, " upgraded,") != NULL)
+              packages = atoi(p);
+            /* TODO: read package names */
+            break;
+       }
       }
       else
         seen_header = TRUE;
@@ -589,6 +615,11 @@
       argv[7] = "--option"; /* only root is able to get a lock on the cache */
       argv[8] = "Debug::nolocking=true";
       break;
+    case PACKAGE_MANAGER_SLAPT:
+      argv[0] = SLAPT_UPDATE;
+      argv[1] = "--simulate";
+      argv[2] = (smart->dist_upgrade) ? "--dist-upgrade" : "--upgrade";
+      break;
     default:
       return 0;
   }
@@ -674,6 +705,12 @@
       else
         program = g_strdup(APT_PROGRAM); /* it is using consolehelper */
       break;
+    case PACKAGE_MANAGER_SLAPT:
+      if (smart_program_exists(SMART_SUDOBIN))
+        program = g_strdup_printf("%s %s", SMART_SUDOBIN, SLAPT_PROGRAM);
+      else
+        program = g_strdup(SLAPT_PROGRAM);
+      break;
     default:
       return;
   }
@@ -693,6 +730,16 @@
   g_free(command);
 }
 
+static void
+smart_launch_program(SmartPlugin *smart)
+{
+  if (smart->upgrade_directly && smart->updates_available > 0)
+    smart_sudo_smart_gui(smart,
+      (smart->package_manager == PACKAGE_MANAGER_SLAPT) ? "--upgrade" : "upgrade");
+   else
+     smart_sudo_smart_gui(smart, NULL);
+}
+
 void
 smart_save (XfcePanelPlugin *plugin,
              SmartPlugin    *smart)
@@ -800,10 +847,7 @@
     switch(evt->button)
     {
       case 1:  /* left */
-        if (smart->upgrade_directly && smart->updates_available > 0)
-          smart_sudo_smart_gui(smart, "upgrade");
-        else
-          smart_sudo_smart_gui(smart, NULL);
+        smart_launch_program(smart);
         break;
       case 2:  /* middle */
         if (smart->in_progress)
@@ -859,7 +903,9 @@
   button = g_object_get_data (G_OBJECT (smart->plugin), "dist-upgrade");
 
   if (button != NULL)
-  gtk_widget_set_sensitive (button, smart->package_manager == PACKAGE_MANAGER_APT);
+  gtk_widget_set_sensitive (button,
+     smart->package_manager == PACKAGE_MANAGER_APT ||
+     smart->package_manager == PACKAGE_MANAGER_SLAPT);
 
   if (smart->show_application) /* change the application icon too */
   smart_size_changed (smart->plugin, smart->current_icon_size, smart);
@@ -1059,6 +1105,9 @@
     case PACKAGE_MANAGER_APT:
       iconname = "xfce4-" APT_PROGRAM;
       break;
+    case PACKAGE_MANAGER_SLAPT:
+      iconname = "xfce4-" SLAPT_PROGRAM;
+      break;
     default:
       iconname = "xfce-unknown";
       break;
@@ -1151,6 +1200,9 @@
     case PACKAGE_MANAGER_APT:
       website = APT_WEBSITE;
       break;
+    case PACKAGE_MANAGER_SLAPT:
+      website = SLAPT_WEBSITE;
+      break;
     default:
       website = "http://goodies.xfce.org/";
       break;
@@ -1290,6 +1342,7 @@
   gtk_combo_box_append_text (GTK_COMBO_BOX(combo), _("Smart"));
   gtk_combo_box_append_text (GTK_COMBO_BOX(combo), _("Yum+Extender"));
   gtk_combo_box_append_text (GTK_COMBO_BOX(combo), _("APT+Synaptic"));
+  gtk_combo_box_append_text (GTK_COMBO_BOX(combo), _("slapt/gslapt"));
   gtk_combo_box_set_active (GTK_COMBO_BOX(combo), smart->package_manager);
   gtk_widget_show (combo);
   g_signal_connect (G_OBJECT(combo),"changed", G_CALLBACK(smart_combobox_changed_cb), smart);
@@ -1330,7 +1383,9 @@
   gtk_box_pack_start (GTK_BOX(vbox),button,TRUE,TRUE,0);
 
   g_object_set_data (G_OBJECT (plugin), "dist-upgrade", button);
-  gtk_widget_set_sensitive (button, smart->package_manager == PACKAGE_MANAGER_APT);
+  gtk_widget_set_sensitive (button,
+     smart->package_manager == PACKAGE_MANAGER_APT ||
+     smart->package_manager == PACKAGE_MANAGER_SLAPT);
 
   /* center dialog on the screen */
   gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);




More information about the Goodies-commits mailing list