aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew N. Dodd <mdodd@FreeBSD.org>2003-03-25 01:22:42 +0000
committerMatthew N. Dodd <mdodd@FreeBSD.org>2003-03-25 01:22:42 +0000
commita9cd061a2a23b94667f7fa962fc18512be223625 (patch)
tree4d971f25cab9b5e2cce6f5b3ea104c100fda1934
parentca26e8ba851315b7666f540e70f9a9ce64cccabc (diff)
Notes
-rw-r--r--usr.sbin/pkg_install/info/info.h1
-rw-r--r--usr.sbin/pkg_install/info/main.c7
-rw-r--r--usr.sbin/pkg_install/info/pkg_info.124
-rw-r--r--usr.sbin/pkg_install/info/show.c5
4 files changed, 29 insertions, 8 deletions
diff --git a/usr.sbin/pkg_install/info/info.h b/usr.sbin/pkg_install/info/info.h
index c2d5eed72c017..21563ca0c0a16 100644
--- a/usr.sbin/pkg_install/info/info.h
+++ b/usr.sbin/pkg_install/info/info.h
@@ -62,6 +62,7 @@ TAILQ_HEAD(which_head, which_entry);
extern int Flags;
extern Boolean Quiet;
extern Boolean QUIET;
+extern Boolean UseBlkSz;
extern char *InfoPrefix;
extern char PlayPen[];
extern char *CheckPkg;
diff --git a/usr.sbin/pkg_install/info/main.c b/usr.sbin/pkg_install/info/main.c
index a3ba4fc7f7c19..344c5b233b493 100644
--- a/usr.sbin/pkg_install/info/main.c
+++ b/usr.sbin/pkg_install/info/main.c
@@ -26,12 +26,13 @@ __FBSDID("$FreeBSD$");
#include "info.h"
#include <err.h>
-static char Options[] = "acdDe:fgGhiIkl:LmoO:pPqQrRst:vVW:x";
+static char Options[] = "abcdDe:fgGhiIkl:LmoO:pPqQrRst:vVW:x";
int Flags = 0;
match_t MatchType = MATCH_GLOB;
Boolean Quiet = FALSE;
Boolean QUIET = FALSE;
+Boolean UseBlkSz = FALSE;
char *InfoPrefix = (char *)(uintptr_t)"";
char PlayPen[FILENAME_MAX];
char *CheckPkg = NULL;
@@ -63,6 +64,10 @@ main(int argc, char **argv)
MatchType = MATCH_ALL;
break;
+ case 'b':
+ UseBlkSz = TRUE;
+ break;
+
case 'v':
Verbose = TRUE;
/* Reasonable definition of 'everything' */
diff --git a/usr.sbin/pkg_install/info/pkg_info.1 b/usr.sbin/pkg_install/info/pkg_info.1
index 347367fa65061..a166ba226f8f8 100644
--- a/usr.sbin/pkg_install/info/pkg_info.1
+++ b/usr.sbin/pkg_install/info/pkg_info.1
@@ -25,7 +25,7 @@
.Nd a utility for displaying information on software packages
.Sh SYNOPSIS
.Nm
-.Op Fl cdDfgGiIkLmopPqQrRsvVx
+.Op Fl bcdDfgGiIkLmopPqQrRsvVx
.Op Fl e Ar package
.Op Fl l Ar prefix
.Op Fl t Ar template
@@ -60,6 +60,12 @@ an installed package, the pathname to a package distribution file or a
URL to an FTP available package.
.It Fl a
Show all currently installed packages.
+.It Fl b
+Use the BLOCKSIZE environment variable for output even when the
+.Fl q
+or
+.Fl Q
+flag is present.
.It Fl v
Turn on verbose output.
.It Fl p
@@ -189,16 +195,22 @@ command line, or from already installed package information
in
.Pa /var/db/pkg/ Ns Aq Ar pkg-name .
.Sh ENVIRONMENT
-.Ev PKG_TMPDIR
-points to the directory where
+.Bl -tag -width PKG_TMPDIR
+.It Ev BLOCKSIZE
+If the environment variable
+.Ev BLOCKSIZE
+is set the block counts will be displayed in units of that
+size block.
+.Pp
+.It Ev PKG_TMPDIR
+Points to the directory where
.Nm
creates its temporary files.
If this variable is not set,
.Ev TMPDIR
is used. If both are unset, the builtin defaults are used.
-.Pp
-.Ev PKG_DBDIR
-specifies an alternative location for the installed package database.
+.It Ev PKG_DBDIR
+Specifies an alternative location for the installed package database.
.Sh FILES
.Bl -tag -width /var/db/pkg -compact
.It Pa /var/tmp
diff --git a/usr.sbin/pkg_install/info/show.c b/usr.sbin/pkg_install/info/show.c
index e26888d1a89c6..4d397d8071c0d 100644
--- a/usr.sbin/pkg_install/info/show.c
+++ b/usr.sbin/pkg_install/info/show.c
@@ -269,7 +269,10 @@ show_size(const char *title, Package *plist)
if (!Quiet)
printf("%lu\t(%s)\n", howmany(size, blksize), descr);
else
- printf("%lu\n", size);
+ if (UseBlkSz)
+ printf("%lu\n", howmany(size, blksize));
+ else
+ printf("%lu\n", size);
}
/* Show files that don't match the recorded checksum */