pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_install/files/lib pkg_install-20091015:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/4a471965ce66
branches:  trunk
changeset: 400280:4a471965ce66
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Thu Oct 15 12:41:41 2009 +0000

description:
pkg_install-20091015:
Use directory index caching by default.

diffstat:

 pkgtools/pkg_install/files/lib/parse-config.c           |  19 ++++++++++++++--
 pkgtools/pkg_install/files/lib/pkg_install.conf.5.in    |   8 +++++-
 pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in |   6 ++++-
 pkgtools/pkg_install/files/lib/version.h                |   4 +-
 4 files changed, 29 insertions(+), 8 deletions(-)

diffs (127 lines):

diff -r 4e1c477cd988 -r 4a471965ce66 pkgtools/pkg_install/files/lib/parse-config.c
--- a/pkgtools/pkg_install/files/lib/parse-config.c     Thu Oct 15 12:39:42 2009 +0000
+++ b/pkgtools/pkg_install/files/lib/parse-config.c     Thu Oct 15 12:41:41 2009 +0000
@@ -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@localhost>.
@@ -54,6 +54,7 @@
 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 @@
 } 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 @@
 void
 pkg_install_config(void)
 {
+       int do_cache_index;
        char *value;
        parse_pkg_install_conf();
 
@@ -175,7 +178,17 @@
        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 -r 4e1c477cd988 -r 4a471965ce66 pkgtools/pkg_install/files/lib/pkg_install.conf.5.in
--- a/pkgtools/pkg_install/files/lib/pkg_install.conf.5.in      Thu Oct 15 12:39:42 2009 +0000
+++ b/pkgtools/pkg_install/files/lib/pkg_install.conf.5.in      Thu Oct 15 12:41:41 2009 +0000
@@ -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 @@
 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 -r 4e1c477cd988 -r 4a471965ce66 pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in
--- a/pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in   Thu Oct 15 12:39:42 2009 +0000
+++ b/pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in   Thu Oct 15 12:41:41 2009 +0000
@@ -21,6 +21,10 @@
      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 @@
 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 -r 4e1c477cd988 -r 4a471965ce66 pkgtools/pkg_install/files/lib/version.h
--- a/pkgtools/pkg_install/files/lib/version.h  Thu Oct 15 12:39:42 2009 +0000
+++ b/pkgtools/pkg_install/files/lib/version.h  Thu Oct 15 12:41:41 2009 +0000
@@ -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_ */



Home | Main Index | Thread Index | Old Index