Remove str_util.{c,h}
[oweals/opkg-lede.git] / libopkg / opkg_download.c
index 953627b026cede5646a4c18c2b44837c23a7130d..49a48a08631cdbfa308026c615abd962dfa1453d 100644 (file)
@@ -46,7 +46,6 @@
 #include "sprintf_alloc.h"
 #include "xsystem.h"
 #include "file_util.h"
-#include "str_util.h"
 #include "opkg_defines.h"
 #include "libbb/libbb.h"
 
@@ -71,6 +70,12 @@ static CURL *curl = NULL;
 static CURL *opkg_curl_init(opkg_conf_t *conf, curl_progress_func cb, void *data);
 #endif
 
+static int
+str_starts_with(const char *str, const char *prefix)
+{
+    return (strncmp(str, prefix, strlen(prefix)) == 0);
+}
+
 int opkg_download(opkg_conf_t *conf, const char *src,
   const char *dest_file_name, curl_progress_func cb, void *data)
 {
@@ -276,7 +281,7 @@ int opkg_prepare_url_for_install(opkg_conf_t *conf, const char *url, char **name
          if (err)
               return err;
 
-         err = pkg_init_from_file(pkg, tmp_file);
+         err = pkg_init_from_file(conf, pkg, tmp_file);
          if (err)
               return err;
 
@@ -287,7 +292,7 @@ int opkg_prepare_url_for_install(opkg_conf_t *conf, const char *url, char **name
                 || strcmp(&url[strlen(url) - 4], IPKG_PKG_EXTENSION) == 0
                || strcmp(&url[strlen(url) - 4], DPKG_PKG_EXTENSION) == 0) {
 
-         err = pkg_init_from_file(pkg, url);
+         err = pkg_init_from_file(conf, pkg, url);
          if (err)
               return err;
          opkg_message(conf, OPKG_DEBUG2, "Package %s provided by hand (%s).\n", pkg->name,pkg->local_filename);