diff options
author | joerg <joerg@pkgsrc.org> | 2009-10-15 12:41:41 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2009-10-15 12:41:41 +0000 |
commit | 7436f37809c7dec9fe3549f5cbdc9ed62b6a7db7 (patch) | |
tree | 8ab1e526ac408ebb026e112b8a28c6cbdd20ba5f /pkgtools | |
parent | 14d0156fdac4202dda72031a54d50242d280b24f (diff) | |
download | pkgsrc-7436f37809c7dec9fe3549f5cbdc9ed62b6a7db7.tar.gz |
pkg_install-20091015:
Use directory index caching by default.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkg_install/files/lib/parse-config.c | 19 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/lib/pkg_install.conf.5.in | 8 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in | 6 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/lib/version.h | 4 |
4 files changed, 29 insertions, 8 deletions
diff --git a/pkgtools/pkg_install/files/lib/parse-config.c b/pkgtools/pkg_install/files/lib/parse-config.c index 341b56093d0..b6fe359cd4f 100644 --- a/pkgtools/pkg_install/files/lib/parse-config.c +++ b/pkgtools/pkg_install/files/lib/parse-config.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse-config.c,v 1.10 2009/10/07 12:53:27 joerg Exp $ */ +/* $NetBSD: parse-config.c,v 1.11 2009/10/15 12:41:41 joerg Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -7,7 +7,7 @@ #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif -__RCSID("$NetBSD: parse-config.c,v 1.10 2009/10/07 12:53:27 joerg Exp $"); +__RCSID("$NetBSD: parse-config.c,v 1.11 2009/10/15 12:41:41 joerg Exp $"); /*- * Copyright (c) 2008, 2009 Joerg Sonnenberger <joerg@NetBSD.org>. @@ -54,6 +54,7 @@ char fetch_flags[10] = ""; /* Workaround Mac OS X linker issues with BSS */ static const char *active_ftp; static const char *verbose_netio; static const char *ignore_proxy; +const char *cache_index = "yes"; const char *cert_chain_file; const char *certs_packages; const char *certs_pkg_vulnerabilities; @@ -79,6 +80,7 @@ static struct config_variable { } config_variables[] = { { "ACCEPTABLE_LICENSES", &acceptable_licenses }, { "ACTIVE_FTP", &active_ftp }, + { "CACHE_INDEX", &cache_index }, { "CERTIFICATE_ANCHOR_PKGS", &certs_packages }, { "CERTIFICATE_ANCHOR_PKGVULN", &certs_pkg_vulnerabilities }, { "CERTIFICATE_CHAIN", &cert_chain_file }, @@ -152,6 +154,7 @@ parse_pkg_install_conf(void) void pkg_install_config(void) { + int do_cache_index; char *value; parse_pkg_install_conf(); @@ -175,7 +178,17 @@ pkg_install_config(void) if ((value = getenv("PKG_PATH")) != NULL) config_pkg_path = value; - snprintf(fetch_flags, sizeof(fetch_flags), "%s%s%s", + if (strcasecmp(cache_index, "yes") == 0) + do_cache_index = 1; + else { + if (strcasecmp(cache_index, "no")) + warnx("Invalid value for configuration option " + "CACHE_INDEX"); + do_cache_index = 0; + } + + snprintf(fetch_flags, sizeof(fetch_flags), "%s%s%s%s", + (do_cache_index) ? "c" : "", (verbose_netio && *verbose_netio) ? "v" : "", (active_ftp && *active_ftp) ? "a" : "", (ignore_proxy && *ignore_proxy) ? "d" : ""); diff --git a/pkgtools/pkg_install/files/lib/pkg_install.conf.5.in b/pkgtools/pkg_install/files/lib/pkg_install.conf.5.in index dfdd4d0d652..a55f189f06d 100644 --- a/pkgtools/pkg_install/files/lib/pkg_install.conf.5.in +++ b/pkgtools/pkg_install/files/lib/pkg_install.conf.5.in @@ -1,4 +1,4 @@ -.\" $NetBSD: pkg_install.conf.5.in,v 1.10 2009/10/07 12:53:27 joerg Exp $ +.\" $NetBSD: pkg_install.conf.5.in,v 1.11 2009/10/15 12:41:41 joerg Exp $ .\" .\" Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 6, 2009 +.Dd October 15, 2009 .Dt PKG_INSTALL.CONF 5 .Os .Sh NAME @@ -53,6 +53,10 @@ List of licenses packages are allowed to carry. License names are case-sensitive. .It Dv ACTIVE_FTP Force the use of active FTP. +.It Dv CACHE_INDEX +Cache directory listenings in memory. +This avoids retransfers of the large directory index for HTTP and is +enabled by default. .It Dv CERTIFICATE_ANCHOR_PKGS Path to the file containing the certificates used for validating binary packages. diff --git a/pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in b/pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in index 91d8e5dde5b..9ad75bcc147 100644 --- a/pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in +++ b/pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in @@ -21,6 +21,10 @@ DDEESSCCRRIIPPTTIIOONN ACTIVE_FTP Force the use of active FTP. + CACHE_INDEX + Cache directory listenings in memory. This avoids retransfers of + the large directory index for HTTP and is enabled by default. + CERTIFICATE_ANCHOR_PKGS Path to the file containing the certificates used for validating binary packages. A package is trusted when a certificate chain @@ -142,4 +146,4 @@ FFIILLEESS SSEEEE AALLSSOO pkg_add(1), pkg_admin(1) -NetBSD 5.0 August 6, 2009 NetBSD 5.0 +NetBSD 5.0 October 15, 2009 NetBSD 5.0 diff --git a/pkgtools/pkg_install/files/lib/version.h b/pkgtools/pkg_install/files/lib/version.h index 552fa892e3c..54cdeb7503d 100644 --- a/pkgtools/pkg_install/files/lib/version.h +++ b/pkgtools/pkg_install/files/lib/version.h @@ -1,4 +1,4 @@ -/* $NetBSD: version.h,v 1.139 2009/10/08 16:16:12 joerg Exp $ */ +/* $NetBSD: version.h,v 1.140 2009/10/15 12:41:41 joerg Exp $ */ /* * Copyright (c) 2001 Thomas Klausner. All rights reserved. @@ -27,6 +27,6 @@ #ifndef _INST_LIB_VERSION_H_ #define _INST_LIB_VERSION_H_ -#define PKGTOOLS_VERSION "20091008" +#define PKGTOOLS_VERSION "20091015" #endif /* _INST_LIB_VERSION_H_ */ |