pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/pkg_install/files



Module Name:    pkgsrc
Committed By:   joerg
Date:           Wed Apr 25 12:20:54 UTC 2018

Modified Files:
        pkgsrc/pkgtools/pkg_install/files/info: main.c
        pkgsrc/pkgtools/pkg_install/files/lib: version.h

Log Message:
pkg_install-20180425: correctly detect package names in PKG_DBDIR

If PKG_DBDIR is /foo and a path like /foobar is given, it is not below
PKG_DBDIR, so don't translate it into a package name look up. The old
logic for giving a path to PKG_DBDIR remains for legacy compat.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 pkgsrc/pkgtools/pkg_install/files/info/main.c
cvs rdiff -u -r1.175 -r1.176 pkgsrc/pkgtools/pkg_install/files/lib/version.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/pkg_install/files/info/main.c
diff -u pkgsrc/pkgtools/pkg_install/files/info/main.c:1.31 pkgsrc/pkgtools/pkg_install/files/info/main.c:1.32
--- pkgsrc/pkgtools/pkg_install/files/info/main.c:1.31  Mon Dec 17 04:34:02 2012
+++ pkgsrc/pkgtools/pkg_install/files/info/main.c       Wed Apr 25 12:20:53 2018
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.31 2012/12/17 04:34:02 agc Exp $    */
+/*     $NetBSD: main.c,v 1.32 2018/04/25 12:20:53 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: main.c,v 1.31 2012/12/17 04:34:02 agc Exp $");
+__RCSID("$NetBSD: main.c,v 1.32 2018/04/25 12:20:53 joerg Exp $");
 
 /*
  *
@@ -299,12 +299,16 @@ main(int argc, char **argv)
                                        errx(EXIT_FAILURE, "Error during search in pkgdb for %s", *argv);
                                }
                        } else {
-                               const char   *dbdir;
+                               const char *dbdir;
+                               size_t dbdirlen;
 
                                dbdir = pkgdb_get_dir();
-                               if (**argv == '/' && strncmp(*argv, dbdir, strlen(dbdir)) == 0) {
-                                       *argv += strlen(dbdir) + 1;
-                                       if ((*argv)[strlen(*argv) - 1] == '/') {
+                               dbdirlen = strlen(dbdir);
+                               if (**argv == '/' &&
+                                   strncmp(*argv, dbdir, dbdirlen) == 0 &&
+                                   (*argv)[dbdirlen] == '/') {
+                                       *argv += dbdirlen + 1;
+                                       if (**argv && (*argv)[strlen(*argv) - 1] == '/') {
                                                (*argv)[strlen(*argv) - 1] = 0;
                                        }
                                }

Index: pkgsrc/pkgtools/pkg_install/files/lib/version.h
diff -u pkgsrc/pkgtools/pkg_install/files/lib/version.h:1.175 pkgsrc/pkgtools/pkg_install/files/lib/version.h:1.176
--- pkgsrc/pkgtools/pkg_install/files/lib/version.h:1.175       Tue Apr 17 12:52:35 2018
+++ pkgsrc/pkgtools/pkg_install/files/lib/version.h     Wed Apr 25 12:20:54 2018
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.175 2018/04/17 12:52:35 jperkin Exp $    */
+/*     $NetBSD: version.h,v 1.176 2018/04/25 12:20:54 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 20180417
+#define PKGTOOLS_VERSION 20180425
 
 #endif /* _INST_LIB_VERSION_H_ */



Home | Main Index | Thread Index | Old Index