r4192 - trunk/src/target/opkg/libopkg

thomas at sita.openmoko.org thomas at sita.openmoko.org
Tue Mar 11 14:48:31 CET 2008


Author: thomas
Date: 2008-03-11 14:48:29 +0100 (Tue, 11 Mar 2008)
New Revision: 4192

Modified:
   trunk/src/target/opkg/libopkg/opkg_configure.c
   trunk/src/target/opkg/libopkg/opkg_download.c
   trunk/src/target/opkg/libopkg/opkg_install.c
   trunk/src/target/opkg/libopkg/opkg_state.c
   trunk/src/target/opkg/libopkg/opkg_state.h
Log:
opkg: output state change messages only at info verbosity level


Modified: trunk/src/target/opkg/libopkg/opkg_configure.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_configure.c	2008-03-11 07:39:12 UTC (rev 4191)
+++ trunk/src/target/opkg/libopkg/opkg_configure.c	2008-03-11 13:48:29 UTC (rev 4192)
@@ -32,7 +32,7 @@
 
     char *pkgid;
     sprintf_alloc (&pkgid, "%s;%s;%s;", pkg->name, pkg->version, pkg->architecture);
-    opkg_set_current_state (OPKG_STATE_CONFIGURING_PKG, pkgid);
+    opkg_set_current_state (conf, OPKG_STATE_CONFIGURING_PKG, pkgid);
     free (pkgid);
 
     err = pkg_run_script(conf, pkg, "postinst", "configure");
@@ -42,7 +42,7 @@
     }
 
     opkg_state_changed++;
-    opkg_set_current_state (OPKG_STATE_NONE, NULL);
+    opkg_set_current_state (conf, OPKG_STATE_NONE, NULL);
     return 0;
 }
 

Modified: trunk/src/target/opkg/libopkg/opkg_download.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_download.c	2008-03-11 07:39:12 UTC (rev 4191)
+++ trunk/src/target/opkg/libopkg/opkg_download.c	2008-03-11 13:48:29 UTC (rev 4192)
@@ -213,7 +213,7 @@
     }
 
     sprintf_alloc (&pkgid, "%s;%s;%s;", pkg->name, pkg->version, pkg->architecture);
-    opkg_set_current_state (OPKG_STATE_DOWNLOADING_PKG, pkgid);
+    opkg_set_current_state (conf, OPKG_STATE_DOWNLOADING_PKG, pkgid);
     free (pkgid);
 
     sprintf_alloc(&url, "%s/%s", pkg->src->value, pkg->filename);
@@ -227,7 +227,7 @@
     err = opkg_download(conf, url, pkg->local_filename);
     free(url);
 
-    opkg_set_current_state (OPKG_STATE_NONE, NULL);
+    opkg_set_current_state (conf, OPKG_STATE_NONE, NULL);
     return err;
 }
 

Modified: trunk/src/target/opkg/libopkg/opkg_install.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_install.c	2008-03-11 07:39:12 UTC (rev 4191)
+++ trunk/src/target/opkg/libopkg/opkg_install.c	2008-03-11 13:48:29 UTC (rev 4192)
@@ -854,7 +854,7 @@
      pkg_get_installed_replacees(conf, pkg, replacees);
 
      sprintf_alloc (&pkgid, "%s;%s;%s;", pkg->name, pkg->version, pkg->architecture);
-     opkg_set_current_state (OPKG_STATE_INSTALLING_PKG, pkgid);
+     opkg_set_current_state (conf, OPKG_STATE_INSTALLING_PKG, pkgid);
      free (pkgid);
 
      /* this next section we do with SIGINT blocked to prevent inconsistency between opkg database and filesystem */
@@ -997,7 +997,7 @@
 
 	  return err;
      }
-     opkg_set_current_state (OPKG_STATE_NONE, NULL);
+     opkg_set_current_state (conf, OPKG_STATE_NONE, NULL);
 }
 
 static int prerm_upgrade_old_pkg(opkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg)

Modified: trunk/src/target/opkg/libopkg/opkg_state.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_state.c	2008-03-11 07:39:12 UTC (rev 4191)
+++ trunk/src/target/opkg/libopkg/opkg_state.c	2008-03-11 13:48:29 UTC (rev 4192)
@@ -39,7 +39,7 @@
 static char *opkg_state_data = NULL;
 
 void
-opkg_set_current_state (opkg_state_t state, const char *data)
+opkg_set_current_state (opkg_conf_t *conf, opkg_state_t state, const char *data)
 {
   if (opkg_state_data)
     free (opkg_state_data);
@@ -60,7 +60,10 @@
   }
 
 
-  printf ("opkg state set to %s: %s\n", state_strings[state], data);
+  if (data == NULL)
+    opkg_message (conf, OPKG_INFO, "opkg state set to %s\n", state_strings[state]);
+  else
+    opkg_message (conf, OPKG_INFO, "opkg state set to %s: %s\n", state_strings[state], data);
 }
 
 void

Modified: trunk/src/target/opkg/libopkg/opkg_state.h
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_state.h	2008-03-11 07:39:12 UTC (rev 4191)
+++ trunk/src/target/opkg/libopkg/opkg_state.h	2008-03-11 13:48:29 UTC (rev 4192)
@@ -18,6 +18,8 @@
 #ifndef OPKG_STATE_H
 #define OPKG_STATE_H
 
+#include <opkg_message.h>
+
 typedef enum _opkg_state {
   OPKG_STATE_NONE,
   OPKG_STATE_DOWNLOADING_PKG,
@@ -30,7 +32,7 @@
 } opkg_state_t;
 
 
-void opkg_set_current_state (opkg_state_t state, const char *data);
+void opkg_set_current_state (opkg_conf_t *conf, opkg_state_t state, const char *data);
 
 
 #endif /* OPKG_STATE_H */





More information about the commitlog mailing list