summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/info
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pkg_install/info')
-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 c2d5eed..21563ca 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 a3ba4fc..344c5b2 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 347367f..a166ba2 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 e26888d..4d397d8 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 */
OpenPOWER on IntegriCloud