r4488 - trunk/src/target/opkg/libopkg

thomas at docs.openmoko.org thomas at docs.openmoko.org
Fri Jun 13 12:15:21 CEST 2008


Author: thomas
Date: 2008-06-13 12:15:19 +0200 (Fri, 13 Jun 2008)
New Revision: 4488

Modified:
   trunk/src/target/opkg/libopkg/opkg_install.c
Log:
opkg: Don't attempt to check the validity of a repository if package did not
      come from a known source


Modified: trunk/src/target/opkg/libopkg/opkg_install.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_install.c	2008-06-12 18:58:45 UTC (rev 4487)
+++ trunk/src/target/opkg/libopkg/opkg_install.c	2008-06-13 10:15:19 UTC (rev 4488)
@@ -828,22 +828,26 @@
      #if HAVE_GPGME
      char *list_file_name, *sig_file_name, *lists_dir;
 
-     sprintf_alloc (&lists_dir, "%s",
-                   (conf->restrict_to_default_dest)
-                    ? conf->default_dest->lists_dir
-                    : conf->lists_dir);
-     sprintf_alloc (&list_file_name, "%s/%s", lists_dir, pkg->src->name);
-     sprintf_alloc (&sig_file_name, "%s/%s.sig", lists_dir, pkg->src->name);
+     /* check to ensure the package has come from a repository */
+     if (pkg->src)
+     {
+       sprintf_alloc (&lists_dir, "%s",
+                     (conf->restrict_to_default_dest)
+                      ? conf->default_dest->lists_dir
+                      : conf->lists_dir);
+       sprintf_alloc (&list_file_name, "%s/%s", lists_dir, pkg->src->name);
+       sprintf_alloc (&sig_file_name, "%s/%s.sig", lists_dir, pkg->src->name);
 
-     if (file_exists (sig_file_name))
-     {
-       if (opkg_verify_file (conf, list_file_name, sig_file_name))
-         return OPKG_INSTALL_ERR_SIGNATURE;
+       if (file_exists (sig_file_name))
+       {
+         if (opkg_verify_file (conf, list_file_name, sig_file_name))
+           return OPKG_INSTALL_ERR_SIGNATURE;
+       }
+
+       free (lists_dir);
+       free (list_file_name);
+       free (sig_file_name);
      }
-
-     free (lists_dir);
-     free (list_file_name);
-     free (sig_file_name);
      #endif
 
      /* Check for md5 values */





More information about the commitlog mailing list