Allow blacklisting a package in the status file.
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Wed, 18 Aug 2010 05:40:17 +0000 (05:40 +0000)
committergraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Wed, 18 Aug 2010 05:40:17 +0000 (05:40 +0000)
To blacklist a particular package, add the following status entry for the
package to be blacklisted:
Status: deinstall hold not-installed

Should fix the opkg end of Issue #46. OpenEmbedded will need to correctly
prime the status file.

git-svn-id: http://opkg.googlecode.com/svn/trunk@553 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libopkg/opkg_conf.c
libopkg/pkg_vec.c

index f1ef0d0..bffeb84 100644 (file)
@@ -359,7 +359,8 @@ opkg_conf_write_status_files(void)
          /* We don't need most uninstalled packages in the status file */
          if (pkg->state_status == SS_NOT_INSTALLED
              && (pkg->state_want == SW_UNKNOWN
-                 || pkg->state_want == SW_DEINSTALL
+                 || (pkg->state_want == SW_DEINSTALL
+                         && pkg->state_flag != SF_HOLD)
                  || pkg->state_want == SW_PURGE)) {
               continue;
          }
index 3cdc7fc..472962c 100644 (file)
@@ -59,9 +59,13 @@ void pkg_vec_insert_merge(pkg_vec_t *vec, pkg_t *pkg, int set_status)
                        pkg->name, pkg->version, pkg->architecture,
                        vec->pkgs[i]->name, vec->pkgs[i]->version,
                        vec->pkgs[i]->architecture);
-         if ((strcmp(pkg->name, vec->pkgs[i]->name) == 0)
-             && (pkg_compare_versions(pkg, vec->pkgs[i]) == 0)
-             && (strcmp(pkg->architecture, vec->pkgs[i]->architecture) == 0)) {
+        /* if the name,ver,arch matches, or the name matches and the
+         * package is marked deinstall/hold  */
+         if ((!strcmp(pkg->name, vec->pkgs[i]->name))
+             && ((pkg->state_want == SW_DEINSTALL
+                 && (pkg->state_flag & SF_HOLD))
+             || ((pkg_compare_versions(pkg, vec->pkgs[i]) == 0)
+             && (!strcmp(pkg->architecture, vec->pkgs[i]->architecture))))) {
               found  = 1;
                opkg_msg(DEBUG2, "Duplicate for pkg=%s version=%s arch=%s.\n",
                        pkg->name, pkg->version, pkg->architecture);