diff options
author | Christian Hesse <mail@eworm.de> | 2016-12-02 11:53:53 +0100 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2017-01-13 03:52:50 +0100 |
commit | c635f185ba86967cd8de9c31890b57e558f65e9b (patch) | |
tree | 8a41eb52b90e9afc595b5d08016f3f4102ccf646 /src | |
parent | 64bd242863504b6ffe138dc8af2b7c6d7a353f76 (diff) | |
download | pacman-c635f185ba86967cd8de9c31890b57e558f65e9b.tar.gz pacman-c635f185ba86967cd8de9c31890b57e558f65e9b.tar.xz |
Introduce a 'disable-download-timeout' option
Add command line option ('--disable-download-timeout') and config file
option ('DisableDownloadTimeout') to disable defaults for low speed
limit and timeout on downloads. Use this if you have issues downloading
files with proxy and/or security gateway.
Signed-off-by: Christian Hesse <mail@eworm.de>
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/pacman/conf.c | 4 | ||||
-rw-r--r-- | src/pacman/conf.h | 4 | ||||
-rw-r--r-- | src/pacman/pacman.c | 6 |
3 files changed, 13 insertions, 1 deletions
diff --git a/src/pacman/conf.c b/src/pacman/conf.c index 52151c56..49b21366 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -498,6 +498,8 @@ static int _parse_options(const char *key, char *value, config->color = isatty(fileno(stdout)) ? PM_COLOR_ON : PM_COLOR_OFF; enable_colors(config->color); } + } else if(strcmp(key, "DisableDownloadTimeout") == 0) { + config->disable_dl_timeout = 1; } else { pm_printf(ALPM_LOG_WARNING, _("config file %s, line %d: directive '%s' in section '%s' not recognized.\n"), @@ -815,6 +817,8 @@ static int setup_libalpm(void) alpm_option_set_noupgrades(handle, config->noupgrade); alpm_option_set_noextracts(handle, config->noextract); + alpm_option_set_disable_dl_timeout(handle, config->disable_dl_timeout); + for(i = config->assumeinstalled; i; i = i->next) { char *entry = i->data; alpm_depend_t *dep = alpm_dep_from_string(entry); diff --git a/src/pacman/conf.h b/src/pacman/conf.h index 636fec61..bd8cd77a 100644 --- a/src/pacman/conf.h +++ b/src/pacman/conf.h @@ -55,6 +55,7 @@ typedef struct __config_t { unsigned short checkspace; unsigned short usesyslog; unsigned short color; + unsigned short disable_dl_timeout; double deltaratio; char *arch; char *print_format; @@ -203,7 +204,8 @@ enum { OP_VERBOSE, OP_DOWNLOADONLY, OP_REFRESH, - OP_ASSUMEINSTALLED + OP_ASSUMEINSTALLED, + OP_DISABLEDLTIMEOUT }; /* clean method */ diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index a459cf00..a66bf585 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -222,6 +222,8 @@ static void usage(int op, const char * const myname) addlist(_(" --logfile <path> set an alternate log file\n")); addlist(_(" --noconfirm do not ask for any confirmation\n")); addlist(_(" --confirm always ask for confirmation\n")); + addlist(_(" --disable-download-timeout\n" + " use relaxed timeouts for download\n")); } list = alpm_list_msort(list, alpm_list_count(list), options_cmp); for(i = list; i; i = alpm_list_next(i)) { @@ -444,6 +446,9 @@ static int parsearg_global(int opt) free(config->rootdir); config->rootdir = strdup(optarg); break; + case OP_DISABLEDLTIMEOUT: + config->disable_dl_timeout = 1; + break; case OP_VERBOSE: case 'v': (config->verbose)++; @@ -939,6 +944,7 @@ static int parseargs(int argc, char *argv[]) {"gpgdir", required_argument, 0, OP_GPGDIR}, {"dbonly", no_argument, 0, OP_DBONLY}, {"color", required_argument, 0, OP_COLOR}, + {"disable-download-timeout", no_argument, 0, OP_DISABLEDLTIMEOUT}, {0, 0, 0, 0} }; |