opkg_message(conf,OPKG_NOTICE,"Downloading %s\n", src);
if (str_starts_with(src, "file:")) {
- int ret;
const char *file_src = src + 5;
opkg_message(conf,OPKG_INFO,"Copying %s to %s...", file_src, dest_file_name);
- ret = file_copy(src + 5, dest_file_name);
+ err = file_copy(file_src, dest_file_name);
opkg_message(conf,OPKG_INFO,"Done\n");
free(src_basec);
- return ret;
+ return err;
}
sprintf_alloc(&tmp_file_location, "%s/%s", conf->tmp_dir, src_base);
__FUNCTION__, tmp_file_location, strerror(errno));
free(tmp_file_location);
free(src_basec);
- return errno;
+ return -1;
}
if (conf->http_proxy) {
free(tmp_file_location);
free(src_basec);
- if (err) {
- return err;
- }
-
- return 0;
+ return err;
}
static int opkg_download_cache(opkg_conf_t *conf, const char *src,
opkg_message(conf, OPKG_ERROR,
"%s: Failed to create temporary directory '%s': %s\n",
__FUNCTION__, pkg->tmp_unpack_dir, strerror(errno));
- return errno;
+ return -1;
}
err = pkg_extract_control_files_to_dir(pkg, pkg->tmp_unpack_dir);
fprintf(stderr, "%s: failed to open %s: %s\n",
__FUNCTION__, conffiles_file_name, strerror(errno));
free(conffiles_file_name);
- return errno;
+ return -1;
}
free(conffiles_file_name);