parent
21d2934f38
commit
e8ce7fab52
@ -1,105 +0,0 @@ |
||||
diff -urN opkg-4993/configure.ac opkg-4993.new/configure.ac |
||||
--- opkg-4993/configure.ac 2009-05-17 18:15:52.000000000 +0200 |
||||
+++ opkg-4993.new/configure.ac 2009-05-17 18:17:09.000000000 +0200 |
||||
@@ -26,9 +26,16 @@ |
||||
|
||||
# Checks for libraries |
||||
|
||||
-# check for libcurl |
||||
-PKG_CHECK_MODULES(CURL, libcurl) |
||||
+AC_ARG_ENABLE(curl, |
||||
+ AC_HELP_STRING([--enable-curl], [Enable use of libcurl instead of wget |
||||
+ [[default=yes]] ]), |
||||
+ [want_curl="$enableval"], [want_curl="yes"]) |
||||
|
||||
+if test "x$want_curl" = "xyes"; then |
||||
+ # check for libcurl |
||||
+ PKG_CHECK_MODULES(CURL, libcurl) |
||||
+ AC_DEFINE(HAVE_CURL, 1, [Define if you want to use libcurl instead of wget]) |
||||
+fi |
||||
|
||||
|
||||
dnl ********** |
||||
diff -urN opkg-4993/libopkg/opkg.c opkg-4993.new/libopkg/opkg.c |
||||
--- opkg-4993/libopkg/opkg.c 2009-05-17 18:15:50.000000000 +0200 |
||||
+++ opkg-4993.new/libopkg/opkg.c 2009-05-17 18:17:09.000000000 +0200 |
||||
@@ -1019,8 +1019,9 @@ |
||||
|
||||
return package; |
||||
} |
||||
- |
||||
+#ifdef HAVE_CURL |
||||
#include <curl/curl.h> |
||||
+#endif |
||||
/** |
||||
* @brief Check the accessibility of repositories. It will try to access the repository to check if the respository is accessible throught current network status. |
||||
* @param opkg The opkg_t |
||||
@@ -1070,6 +1071,7 @@ |
||||
repositories--; |
||||
|
||||
err = opkg_download(opkg->conf, iter1->data, "/dev/null", NULL, NULL); |
||||
+ #ifdef HAVE_CURL |
||||
if (!(err == CURLE_OK || |
||||
err == CURLE_HTTP_RETURNED_ERROR || |
||||
err == CURLE_FILE_COULDNT_READ_FILE || |
||||
@@ -1078,6 +1080,7 @@ |
||||
)) { |
||||
ret++; |
||||
} |
||||
+ #endif |
||||
str_list_elt_deinit(iter1); |
||||
free(iter1); |
||||
} |
||||
diff -urN opkg-4993/libopkg/opkg_download.c opkg-4993.new/libopkg/opkg_download.c |
||||
--- opkg-4993/libopkg/opkg_download.c 2009-05-17 18:15:50.000000000 +0200 |
||||
+++ opkg-4993.new/libopkg/opkg_download.c 2009-05-17 18:17:09.000000000 +0200 |
||||
@@ -17,7 +17,9 @@ |
||||
General Public License for more details. |
||||
*/ |
||||
#include "config.h" |
||||
+#ifdef HAVE_CURL |
||||
#include <curl/curl.h> |
||||
+#endif |
||||
#ifdef HAVE_GPGME |
||||
#include <gpgme.h> |
||||
#endif |
||||
@@ -77,6 +79,7 @@ |
||||
setenv("no_proxy", conf->no_proxy, 1); |
||||
} |
||||
|
||||
+#ifdef HAVE_CURL |
||||
CURL *curl; |
||||
CURLcode res; |
||||
FILE * file = fopen (tmp_file_location, "w"); |
||||
@@ -123,6 +126,31 @@ |
||||
free(src_basec); |
||||
return -1; |
||||
} |
||||
+#else /* if wget is selected */ |
||||
+ char *cmd; |
||||
+ /* XXX: BUG rewrite to use execvp or else busybox's internal wget -Jamey 7/23/2002 */ |
||||
+ sprintf_alloc(&cmd, "wget --passive-ftp %s %s%s %s%s -P %s %s", |
||||
+ (conf->http_proxy || conf->ftp_proxy) ? "--proxy=on" : "", |
||||
+ conf->proxy_user ? "--proxy-user=" : "", |
||||
+ conf->proxy_user ? conf->proxy_user : "", |
||||
+ conf->proxy_passwd ? "--proxy-passwd=" : "", |
||||
+ conf->proxy_passwd ? conf->proxy_passwd : "", |
||||
+ conf->tmp_dir, |
||||
+ src); |
||||
+ err = xsystem(cmd); |
||||
+ if (err) { |
||||
+ if (err != -1) { |
||||
+ opkg_message(conf,OPKG_ERROR, "%s: ERROR: Command failed with return value %d: `%s'\n", |
||||
+ __FUNCTION__, err, cmd); |
||||
+ } |
||||
+ unlink(tmp_file_location); |
||||
+ free(tmp_file_location); |
||||
+ free(src_basec); |
||||
+ free(cmd); |
||||
+ return EINVAL; |
||||
+ } |
||||
+ free(cmd); |
||||
+#endif |
||||
|
||||
err = file_move(tmp_file_location, dest_file_name); |
||||
|
@ -1,24 +0,0 @@ |
||||
diff -urN opkg-4993/libopkg/opkg_cmd.c opkg-4993.new/libopkg/opkg_cmd.c |
||||
--- opkg-4993/libopkg/opkg_cmd.c 2009-05-17 18:15:50.000000000 +0200 |
||||
+++ opkg-4993.new/libopkg/opkg_cmd.c 2009-05-17 18:19:50.000000000 +0200 |
||||
@@ -289,9 +289,6 @@ |
||||
unlink (tmp_file_name); |
||||
free (tmp_file_name); |
||||
free (url); |
||||
-#else |
||||
- opkg_message (conf, OPKG_NOTICE, "Signature check for %s skipped " |
||||
- "because GPG support was not enabled in this build\n", src->name); |
||||
#endif |
||||
free(list_file_name); |
||||
} |
||||
diff -urN opkg-4993/libopkg/opkg_download.c opkg-4993.new/libopkg/opkg_download.c |
||||
--- opkg-4993/libopkg/opkg_download.c 2009-05-17 18:20:17.000000000 +0200 |
||||
+++ opkg-4993.new/libopkg/opkg_download.c 2009-05-17 18:19:10.000000000 +0200 |
||||
@@ -374,7 +374,6 @@ |
||||
|
||||
return status; |
||||
#else |
||||
- opkg_message (conf, OPKG_NOTICE, "Signature check for %s was skipped because GPG support was not enabled in this build\n"); |
||||
return 0; |
||||
#endif |
||||
} |
Loading…
Reference in new issue