General Public License for more details.
*/
#include "config.h"
+#ifdef HAVE_CURL
#include <curl/curl.h>
+#endif
#ifdef HAVE_GPGME
#include <gpgme.h>
#endif
setenv("no_proxy", conf->no_proxy, 1);
}
+#ifdef HAVE_CURL
CURL *curl;
CURLcode res;
FILE * file = fopen (tmp_file_location, "w");
{
long error_code;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &error_code);
- opkg_message(conf, OPKG_ERROR, "Failed to download %s, error %d\n", src, error_code);
+ opkg_message(conf, OPKG_ERROR, "Failed to download %s. \nerror detail: %s\n", src, curl_easy_strerror(res));
free(tmp_file_location);
free(src_basec);
curl_easy_cleanup (curl);
free(src_basec);
return -1;
}
+#else
+ {
+ int res;
+ char *wgetcmd;
+ char *wgetopts;
+ wgetopts = getenv("OPKG_WGETOPTS");
+ sprintf_alloc(&wgetcmd, "wget -q %s%s -O \"%s\" \"%s\"",
+ (conf->http_proxy || conf->ftp_proxy) ? "-Y on " : "",
+ (wgetopts!=NULL) ? wgetopts : "",
+ tmp_file_location, src);
+ opkg_message(conf, OPKG_INFO, "Executing: %s\n", wgetcmd);
+ res = xsystem(wgetcmd);
+ free(wgetcmd);
+ if (res) {
+ opkg_message(conf, OPKG_ERROR, "Failed to download %s, error %d\n", src, res);
+ free(tmp_file_location);
+ free(src_basec);
+ return res;
+ }
+ }
+#endif
err = file_move(tmp_file_location, dest_file_name);
opkg_verify_file (opkg_conf_t *conf, char *text_file, char *sig_file)
{
#ifdef HAVE_GPGME
+ if (conf->check_signature == 0 )
+ return 0;
int status = -1;
gpgme_ctx_t ctx;
gpgme_data_t sig, text, key;
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
}