| 2389 | } |
| 2390 | |
| 2391 | bool HandleUploadCommand(std::vector<std::string> const& args, |
| 2392 | cmExecutionStatus& status) |
| 2393 | { |
| 2394 | #if !defined(CMAKE_BOOTSTRAP) |
| 2395 | if (args.size() < 3) { |
| 2396 | status.SetError("UPLOAD must be called with at least three arguments."); |
| 2397 | return false; |
| 2398 | } |
| 2399 | auto i = args.begin(); |
| 2400 | ++i; |
| 2401 | std::string filename = *i; |
| 2402 | ++i; |
| 2403 | std::string url = *i; |
| 2404 | ++i; |
| 2405 | |
| 2406 | long timeout = 0; |
| 2407 | long inactivity_timeout = 0; |
| 2408 | std::string logVar; |
| 2409 | std::string statusVar; |
| 2410 | bool showProgress = false; |
| 2411 | cm::optional<std::string> tlsVersionOpt; |
| 2412 | cm::optional<bool> tlsVerifyOpt; |
| 2413 | cmValue cainfo = status.GetMakefile().GetDefinition("CMAKE_TLS_CAINFO"); |
| 2414 | std::string userpwd; |
| 2415 | std::string netrc_level = |
| 2416 | status.GetMakefile().GetSafeDefinition("CMAKE_NETRC"); |
| 2417 | std::string netrc_file = |
| 2418 | status.GetMakefile().GetSafeDefinition("CMAKE_NETRC_FILE"); |
| 2419 | |
| 2420 | std::vector<std::string> curl_headers; |
| 2421 | |
| 2422 | while (i != args.end()) { |
| 2423 | if (*i == "TIMEOUT") { |
| 2424 | ++i; |
| 2425 | if (i != args.end()) { |
| 2426 | timeout = atol(i->c_str()); |
| 2427 | } else { |
| 2428 | status.SetError("UPLOAD missing time for TIMEOUT."); |
| 2429 | return false; |
| 2430 | } |
| 2431 | } else if (*i == "INACTIVITY_TIMEOUT") { |
| 2432 | ++i; |
| 2433 | if (i != args.end()) { |
| 2434 | inactivity_timeout = atol(i->c_str()); |
| 2435 | } else { |
| 2436 | status.SetError("UPLOAD missing time for INACTIVITY_TIMEOUT."); |
| 2437 | return false; |
| 2438 | } |
| 2439 | } else if (*i == "LOG") { |
| 2440 | ++i; |
| 2441 | if (i == args.end()) { |
| 2442 | status.SetError("UPLOAD missing VAR for LOG."); |
| 2443 | return false; |
| 2444 | } |
| 2445 | logVar = *i; |
| 2446 | } else if (*i == "STATUS") { |
| 2447 | ++i; |
| 2448 | if (i == args.end()) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…