libopkg: drop support for Release files
[oweals/opkg-lede.git] / libopkg / opkg_cmd.c
index 1a8f8573a290de2f85452ebda53cd4d0e6671c94..60ffee3e25de51c4d4502bfac4a52b7905e58cf3 100644 (file)
@@ -27,7 +27,6 @@
 #include "opkg_conf.h"
 #include "opkg_cmd.h"
 #include "opkg_message.h"
-#include "release.h"
 #include "pkg.h"
 #include "pkg_dest.h"
 #include "pkg_parse.h"
@@ -114,39 +113,6 @@ opkg_update_cmd(int argc, char **argv)
      }
 
 
-     for (iter = void_list_first(&conf->dist_src_list); iter; iter = void_list_next(&conf->dist_src_list, iter)) {
-         char *url, *list_file_name;
-
-         src = (pkg_src_t *)iter->data;
-
-         sprintf_alloc(&url, "%s/dists/%s/Release", src->value, src->name);
-
-         sprintf_alloc(&list_file_name, "%s/%s", lists_dir, src->name);
-         err = opkg_download(url, list_file_name, NULL, NULL, 0);
-         if (!err) {
-              opkg_msg(NOTICE, "Downloaded release files for dist %s.\n",
-                           src->name);
-              release_t *release = release_new(); 
-              err = release_init_from_file(release, list_file_name);
-              if (!err) {
-                   if (!release_comps_supported(release, src->extra_data))
-                        err = -1;
-              }
-              if (!err) {
-                   err = release_download(release, src, lists_dir, tmp);
-              }
-              release_deinit(release); 
-              if (err)
-                   unlink(list_file_name);
-         }
-
-         if (err)
-              failures++;
-
-         free(list_file_name);
-         free(url);
-     }
-
      for (iter = void_list_first(&conf->pkg_src_list); iter; iter = void_list_next(&conf->pkg_src_list, iter)) {
          char *url, *list_file_name;
 
@@ -162,37 +128,14 @@ opkg_update_cmd(int argc, char **argv)
              sprintf_alloc(&url, "%s/%s", src->value, src->gzip ? "Packages.gz" : "Packages");
 
          sprintf_alloc(&list_file_name, "%s/%s", lists_dir, src->name);
-         if (src->gzip) {
-             char *tmp_file_name;
-             FILE *in, *out;
-
-             sprintf_alloc (&tmp_file_name, "%s/%s.gz", tmp, src->name);
-             err = opkg_download(url, tmp_file_name, NULL, NULL, 0);
-             if (err == 0) {
-                  opkg_msg(NOTICE, "Inflating %s.\n", url);
-                  in = fopen (tmp_file_name, "r");
-                  out = fopen (list_file_name, "w");
-                  if (in && out)
-                       unzip (in, out);
-                  else
-                       err = 1;
-                  if (in)
-                       fclose (in);
-                  if (out)
-                       fclose (out);
-                  unlink (tmp_file_name);
-             }
-             free(tmp_file_name);
-         } else
-             err = opkg_download(url, list_file_name, NULL, NULL, 0);
-         if (err) {
+         if (opkg_download(url, list_file_name, NULL, NULL, 0)) {
               failures++;
          } else {
               opkg_msg(NOTICE, "Updated list of available packages in %s.\n",
                            list_file_name);
          }
          free(url);
-#if defined(HAVE_GPGME) || defined(HAVE_OPENSSL)
+#if defined(HAVE_GPGME) || defined(HAVE_OPENSSL) || defined(HAVE_USIGN)
           if (conf->check_signature) {
               /* download detached signitures to verify the package lists */
               /* get the url for the sig file */
@@ -219,7 +162,7 @@ opkg_update_cmd(int argc, char **argv)
                   else
                       opkg_msg(NOTICE, "Signature check failed.\n");
               }
-              if (err) {
+              if (err && !conf->force_signature) {
                   /* The signature was wrong so delete it */
                   opkg_msg(NOTICE, "Remove wrong Signature file.\n");
                   unlink (tmp_file_name);