From d123c74e768d84756599bd5b0d56f0703c3104c3 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Thu, 30 Aug 2018 13:33:02 +0200 Subject: [PATCH] Remove fetchurl Fetchurl has been moved to the libports repository. --- run/fetchurl.run | 87 ------------------ src/app/fetchurl/README | 18 ---- src/app/fetchurl/component.cc | 161 ---------------------------------- src/app/fetchurl/target.mk | 3 - 4 files changed, 269 deletions(-) delete mode 100644 run/fetchurl.run delete mode 100644 src/app/fetchurl/README delete mode 100644 src/app/fetchurl/component.cc delete mode 100644 src/app/fetchurl/target.mk diff --git a/run/fetchurl.run b/run/fetchurl.run deleted file mode 100644 index fcec557..0000000 --- a/run/fetchurl.run +++ /dev/null @@ -1,87 +0,0 @@ -# -# \brief Test of 'fetchurl -# \author Emery Hemingway -# \date 2016-06-05 -# - -set build_components { - core init - app/fetchurl - drivers/nic - drivers/timer -} - -source ${genode_dir}/repos/base/run/platform_drv.inc -append_platform_drv_build_components - -build $build_components - -create_boot_directory - -append config { - - - - - - - - - - - - - - - - } - -append_platform_drv_config - -append config { - - - - - - - - - - - - - - - - - -} - -install_config $config - -# generic modules -set boot_modules { - core init ld.lib.so - curl.lib.so - fetchurl - libc.lib.so vfs.lib.so - libc.lib.so vfs.lib.so - libcrypto.lib.so - libm.lib.so - libssh.lib.so - libssl.lib.so - lwip_legacy.lib.so - nic_drv - timer - zlib.lib.so -} - -# platform-specific modules -append_platform_drv_boot_modules - -build_boot_image $boot_modules - -append qemu_args " -nographic -net nic,model=e1000 -net user" - -run_genode_until {child "fetchurl" exited with exit value 0} 120 diff --git a/src/app/fetchurl/README b/src/app/fetchurl/README deleted file mode 100644 index 740bcf8..0000000 --- a/src/app/fetchurl/README +++ /dev/null @@ -1,18 +0,0 @@ -A small frontend to the libcURL library. - -Configuration -------------- - -! -! -! -! -! -! -! -! - -Optionally, you can use a proxy: - -! url; - Genode::Path<256> path; - CURLcode res = CURLE_OK; - - curl_global_init(CURL_GLOBAL_DEFAULT); - - Genode::Xml_node config_node = config.xml(); - - bool verbose = config_node.attribute_value("verbose", false); - - config_node.for_each_sub_node("fetch", [&] (Genode::Xml_node node) { - - if (res != CURLE_OK) return; - try { - node.attribute("url").value(&url); - node.attribute("path").value(path.base(), path.capacity()); - } catch (...) { Genode::error("error reading 'fetch' node"); return; } - - char const *out_path = path.base(); - - int fd = open(out_path, O_CREAT | O_RDWR); - if (fd == -1) { - switch (errno) { - case EACCES: - Genode::error("permission denied at ", out_path); break; - case EEXIST: - Genode::error(out_path, " already exists"); break; - case EISDIR: - Genode::error(out_path, " is a directory"); break; - case ENOSPC: - Genode::error("cannot create ", out_path, ", out of space"); break; - } - env.parent().exit(errno); - return; - } - - CURL *curl = curl_easy_init(); - if (!curl) { - Genode::error("failed to initialize libcurl"); - res = CURLE_FAILED_INIT; - return; - } - - Stats stats(timer, url.string()); - - curl_easy_setopt(curl, CURLOPT_URL, url.string()); - curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, true); - - curl_easy_setopt(curl, CURLOPT_VERBOSE, verbose); - curl_easy_setopt(curl, CURLOPT_NOSIGNAL, true); - - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, &fd); - - curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback); - curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, &stats); - curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L); - - curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); - curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); - - /* check for optional proxy configuration */ - try { - Genode::String<256> proxy; - node.attribute("proxy").value(&proxy); - curl_easy_setopt(curl, CURLOPT_PROXY, proxy.string()); - } catch (...) { } - - Libc::with_libc([&]() { - res = curl_easy_perform(curl); - }); - close(fd); - if (res != CURLE_OK) - Genode::error(curl_easy_strerror(res)); - - curl_easy_cleanup(curl); - }); - - curl_global_cleanup(); - - Genode::warning("SSL certificates not verified"); - - env.parent().exit(res ^ CURLE_OK); -} - diff --git a/src/app/fetchurl/target.mk b/src/app/fetchurl/target.mk deleted file mode 100644 index cce4d49..0000000 --- a/src/app/fetchurl/target.mk +++ /dev/null @@ -1,3 +0,0 @@ -TARGET = fetchurl -LIBS += curl lwip libc_lwip libc_lwip_nic_dhcp libc -SRC_CC = component.cc \ No newline at end of file