Running a script does not change the state, modifying the state flags does.
[oweals/opkg-lede.git] / libopkg / opkg_cmd.c
index 30d312637ceaa6d25f29a35f0ceb636f95c9ecb5..88a0b5f13fb5e8baae7200dbb78b9ce83e6ef478 100644 (file)
@@ -38,7 +38,6 @@
 #include "opkg_upgrade.h"
 #include "opkg_remove.h"
 #include "opkg_configure.h"
-#include "libopkg.h"
 #include "xsystem.h"
 
 static void
@@ -302,7 +301,7 @@ opkg_recurse_pkgs_in_order(pkg_t *pkg, pkg_vec_t *all,
     /* If the  package has already been visited (by this function), skip it */
     for(j = 0; j < visited->len; j++) 
         if ( ! strcmp(visited->pkgs[j]->name, pkg->name)) {
-            opkg_msg(INFO, "pkg %s already visited, skipping.\n", pkg->name);
+            opkg_msg(DEBUG, "pkg %s already visited, skipping.\n", pkg->name);
             return 0;
         }
     
@@ -311,7 +310,7 @@ opkg_recurse_pkgs_in_order(pkg_t *pkg, pkg_vec_t *all,
     count = pkg->pre_depends_count + pkg->depends_count + \
         pkg->recommends_count + pkg->suggests_count;
 
-    opkg_msg(INFO, "pkg %s.\n", pkg->name);
+    opkg_msg(DEBUG, "pkg %s.\n", pkg->name);
 
     /* Iterate over all the dependencies of pkg. For each one, find a package 
        that is either installed or unpacked and satisfies this dependency.
@@ -326,7 +325,7 @@ opkg_recurse_pkgs_in_order(pkg_t *pkg, pkg_vec_t *all,
             l = 0;
             if (dependents != NULL)
                 while (l < abpkg->provided_by->len && dependents[l] != NULL) {
-                    opkg_msg(INFO, "Descending on pkg %s.\n", 
+                    opkg_msg(DEBUG, "Descending on pkg %s.\n", 
                                  dependents [l]->name);
     
                     /* find whether dependent l is installed or unpacked,
@@ -401,6 +400,7 @@ opkg_configure_packages(char *pkg_name)
                    pkg->state_status = SS_INSTALLED;
                    pkg->parent->state_status = SS_INSTALLED;
                    pkg->state_flag &= ~SF_PREFER;
+                   opkg_state_changed++;
               } else {
                    if (!err)
                        err = r;
@@ -1213,12 +1213,5 @@ opkg_cmd_find(const char *name)
 int
 opkg_cmd_exec(opkg_cmd_t *cmd, int argc, const char **argv)
 {
-       int result;
-
-       result = (cmd->fun)(argc, argv);
-
-       print_error_list();
-       free_error_list();
-
-       return result;
+       return (cmd->fun)(argc, argv);
 }