libopkg: add support for signature checking through usign
[oweals/opkg-lede.git] / libopkg / opkg_install.c
index 2c61a5fccd7b12f8d1598098030aaa702cf1b792..7e0e17e8262768e9b6025d65108e27c47009768f 100644 (file)
@@ -1288,7 +1288,7 @@ opkg_install_pkg(pkg_t *pkg, int from_upgrade)
      }
 
      /* check that the repository is valid */
-     #if defined(HAVE_GPGME) || defined(HAVE_OPENSSL)
+     #if defined(HAVE_GPGME) || defined(HAVE_OPENSSL) || defined(HAVE_USIGN)
      char *list_file_name, *sig_file_name, *lists_dir;
 
      /* check to ensure the package has come from a repository */
@@ -1405,9 +1405,11 @@ opkg_install_pkg(pkg_t *pkg, int from_upgrade)
          opkg_state_changed++;
          pkg->state_flag |= SF_FILELIST_CHANGED;
 
-         if (old_pkg)
+         if (old_pkg) {
                pkg_remove_orphan_dependent(pkg, old_pkg);
-
+              old_pkg->is_upgrade = 1;
+              pkg->is_upgrade = 1;
+         }
          /* XXX: BUG: we really should treat replacement more like an upgrade
           *      Instead, we're going to remove the replacees
           */
@@ -1466,7 +1468,7 @@ opkg_install_pkg(pkg_t *pkg, int from_upgrade)
          }
 
 
-         opkg_msg(INFO, "Installing maintainer scripts.\n");
+         opkg_msg(INFO, "%s maintainer scripts.\n", (pkg->is_upgrade) ? ("Upgrading") : ("Installing"));
          if (install_maintainer_scripts(pkg, old_pkg)) {
                opkg_msg(ERROR, "Failed to extract maintainer scripts for %s."
                               " Package debris may remain!\n",