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 pull in binary pkg handling...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/72a019835c4d
branches:  trunk
changeset: 488878:72a019835c4d
user:      grant <grant%pkgsrc.org@localhost>
date:      Thu Feb 10 23:51:18 2005 +0000

description:
pull in binary pkg handling changes from src:

rework pkg_info(8) operating on binary packages, deprecating the `-.'
argument as it is no longer required (but is retained as a no-op for
backward compatibility).

the behaviour is now what is expected and intended:

        - when the pkg argument is path (absolute or relative) to a
          binary pkg, pkg_info operates on it.
        - when no pkg argument is given, or the argument is not a
          binary pkg path, pkg_info operates on the installed packages.

`pkg_info foo-1.0.tgz', `pkg_info /path/to/foo-1.0.tgz', etc. now work
correctly when foo-1.0.tgz is in the cwd.

bump PKGTOOLS_VERSION to 20050210.

diffstat:

 pkgtools/pkg_install/files/info/info.h     |   3 +--
 pkgtools/pkg_install/files/info/main.c     |  10 ++++------
 pkgtools/pkg_install/files/info/perform.c  |  20 ++++----------------
 pkgtools/pkg_install/files/info/pkg_info.1 |   8 +++-----
 pkgtools/pkg_install/files/lib/version.h   |   4 ++--
 5 files changed, 14 insertions(+), 31 deletions(-)

diffs (175 lines):

diff -r 6f4851c88b86 -r 72a019835c4d pkgtools/pkg_install/files/info/info.h
--- a/pkgtools/pkg_install/files/info/info.h    Thu Feb 10 23:49:25 2005 +0000
+++ b/pkgtools/pkg_install/files/info/info.h    Thu Feb 10 23:51:18 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: info.h,v 1.6 2004/08/20 20:09:53 jlam Exp $ */
+/* $NetBSD: info.h,v 1.7 2005/02/10 23:51:18 grant Exp $ */
 
 /* from FreeBSD Id: info.h,v 1.10 1997/02/22 16:09:40 peter Exp */
 
@@ -64,7 +64,6 @@
 extern char *CheckPkg;
 extern size_t termwidth;
 extern lpkg_head_t pkgs;
-extern int usedot;
 
 extern void show_file(char *, char *);
 extern void show_var(const char *, const char *);
diff -r 6f4851c88b86 -r 72a019835c4d pkgtools/pkg_install/files/info/main.c
--- a/pkgtools/pkg_install/files/info/main.c    Thu Feb 10 23:49:25 2005 +0000
+++ b/pkgtools/pkg_install/files/info/main.c    Thu Feb 10 23:51:18 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.12 2004/12/29 12:16:56 agc Exp $    */
+/*     $NetBSD: main.c,v 1.13 2005/02/10 23:51:18 grant Exp $  */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #if 0
 static char *rcsid = "from FreeBSD Id: main.c,v 1.14 1997/10/08 07:47:26 charnier Exp";
 #else
-__RCSID("$NetBSD: main.c,v 1.12 2004/12/29 12:16:56 agc Exp $");
+__RCSID("$NetBSD: main.c,v 1.13 2005/02/10 23:51:18 grant Exp $");
 #endif
 #endif
 
@@ -63,13 +63,12 @@
 char   *CheckPkg = NULL;
 size_t  termwidth = 0;
 lpkg_head_t pkgs;
-int    usedot;
 
 static void
 usage(void)
 {
        fprintf(stderr, "%s\n%s\n%s\n%s\n",
-           "usage: pkg_info [-.BbcDdFfhIikLmNnpqRrSsVv] [-e package] [-K pkg_dbdir] [-l prefix]",
+           "usage: pkg_info [-BbcDdFfhIikLmNnpqRrSsVv] [-e package] [-K pkg_dbdir] [-l prefix]",
            "                pkg-name [pkg-name ...]",
            "       pkg_info -a [flags]",
            "       pkg_info -Q variable pkg-name [pkg-name ...]");
@@ -86,8 +85,7 @@
        setprogname(argv[0]);
        while ((ch = getopt(argc, argv, Options)) != -1)
                switch (ch) {
-               case '.':
-                       usedot = 1;
+               case '.':       /* for backward compatibility */
                        break;
 
                case 'a':
diff -r 6f4851c88b86 -r 72a019835c4d pkgtools/pkg_install/files/info/perform.c
--- a/pkgtools/pkg_install/files/info/perform.c Thu Feb 10 23:49:25 2005 +0000
+++ b/pkgtools/pkg_install/files/info/perform.c Thu Feb 10 23:51:18 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: perform.c,v 1.19 2005/02/04 01:19:04 jlam Exp $        */
+/*     $NetBSD: perform.c,v 1.20 2005/02/10 23:51:18 grant Exp $       */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #if 0
 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.23 1997/10/13 15:03:53 jkh Exp";
 #else
-__RCSID("$NetBSD: perform.c,v 1.19 2005/02/04 01:19:04 jlam Exp $");
+__RCSID("$NetBSD: perform.c,v 1.20 2005/02/10 23:51:18 grant Exp $");
 #endif
 #endif
 
@@ -76,7 +76,7 @@
                        strlcpy(fname, cp, sizeof(fname));
                        isTMP = TRUE;
                }
-       } else if (usedot && fexists(pkg) && isfile(pkg)) {
+       } else if (fexists(pkg) && isfile(pkg)) {
                int     len;
 
                if (*pkg != '/') {
@@ -90,10 +90,6 @@
                        strlcpy(fname, pkg, sizeof(fname));
                }
                cp = fname;
-       } else if (usedot) {
-               if ((cp = fileFindByPath(pkg)) != NULL) {
-                       strncpy(fname, cp, MaxPathSize);
-               }
        }
 
        if (cp) {
@@ -113,13 +109,6 @@
                                }
                                strcpy(PlayPen, cp2);
                        } else {
-                               if (!usedot) {
-                                       /* only recognise a local uninstalled package if usedot was given */
-                                       warnx("can't find package file '%s'", fname);
-                                       code = 1;
-                                       goto bail;
-                               }
-
                                /*
                                 * Apply a crude heuristic to see how much space the package will
                                 * take up once it's unpacked.  I've noticed that most packages
@@ -179,8 +168,7 @@
                        }
 
                        /* No match */
-                       warnx("can't find package `%s' installed%s!", pkg,
-                                 usedot ? " or in a file" : "");
+                       warnx("can't find package `%s'", pkg);
                        return 1;
                }
                if (chdir(log_dir) == FAIL) {
diff -r 6f4851c88b86 -r 72a019835c4d pkgtools/pkg_install/files/info/pkg_info.1
--- a/pkgtools/pkg_install/files/info/pkg_info.1        Thu Feb 10 23:49:25 2005 +0000
+++ b/pkgtools/pkg_install/files/info/pkg_info.1        Thu Feb 10 23:51:18 2005 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_info.1,v 1.14 2004/11/10 17:50:10 agc Exp $
+.\" $NetBSD: pkg_info.1,v 1.15 2005/02/10 23:51:18 grant Exp $
 .\"
 .\" FreeBSD install - a package for the installation and maintenance
 .\" of non-core utilities.
@@ -17,7 +17,7 @@
 .\"
 .\"     @(#)pkg_info.1
 .\"
-.Dd November 10, 2004
+.Dd February 10, 2005
 .Dt PKG_INFO 1
 .Os
 .Sh NAME
@@ -25,7 +25,7 @@
 .Nd a utility for displaying information on software packages
 .Sh SYNOPSIS
 .Nm
-.Op Fl .BbcDdFfhIikLmNnpqRrSsVv
+.Op Fl BbcDdFfhIikLmNnpqRrSsVv
 .Bk -words
 .Op Fl e Ar package
 .Ek
@@ -67,8 +67,6 @@
 .Pp
 The following command-line options are supported:
 .Bl -tag -width indent
-.It Fl .
-Recognise uninstalled binary packages in the current working directory.
 .It Fl a
 Show information for all currently installed packages.
 .It Fl B
diff -r 6f4851c88b86 -r 72a019835c4d pkgtools/pkg_install/files/lib/version.h
--- a/pkgtools/pkg_install/files/lib/version.h  Thu Feb 10 23:49:25 2005 +0000
+++ b/pkgtools/pkg_install/files/lib/version.h  Thu Feb 10 23:51:18 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.40 2005/02/04 09:10:13 jlam Exp $        */
+/*     $NetBSD: version.h,v 1.41 2005/02/10 23:51:18 grant Exp $       */
 
 /*
  * Copyright (c) 2001 Thomas Klausner.  All rights reserved.
@@ -33,6 +33,6 @@
 #ifndef _INST_LIB_VERSION_H_
 #define _INST_LIB_VERSION_H_
 
-#define PKGTOOLS_VERSION "20050204"
+#define PKGTOOLS_VERSION "20050210"
 
 #endif /* _INST_LIB_VERSION_H_ */



Home | Main Index | Thread Index | Old Index