- Add the 'b' option which causes BLOCKSIZE to be hornored when

the 'q' or 'Q' options are present.
- Document BLOCKSIZE.
This commit is contained in:
Matthew N. Dodd 2003-03-25 01:22:42 +00:00
parent ca26e8ba85
commit a9cd061a2a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=112579
4 changed files with 29 additions and 8 deletions

View File

@ -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;

View File

@ -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' */

View File

@ -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

View File

@ -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 */