summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/info
diff options
context:
space:
mode:
authorflz <flz@FreeBSD.org>2006-01-09 18:27:21 +0000
committerflz <flz@FreeBSD.org>2006-01-09 18:27:21 +0000
commitc97d1806500049ffe6c3e8091ab4cfb4c997281e (patch)
tree1d907422a2b7e64739038fb6d8d33e072dc613d3 /usr.sbin/pkg_install/info
parent93d7e294fcdb0d064bd15e9208026d662d5c43ce (diff)
downloadFreeBSD-src-c97d1806500049ffe6c3e8091ab4cfb4c997281e.zip
FreeBSD-src-c97d1806500049ffe6c3e8091ab4cfb4c997281e.tar.gz
Add -K option to pkg_add and pkg_info.
This option saves packages to PKGDIR (if defined or current directory by default) as they are downloaded. Silent a warning when -n is used and package has a +DISPLAY file. Approved by: krion MFC after: 1 week
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.c9
-rw-r--r--usr.sbin/pkg_install/info/perform.c2
-rw-r--r--usr.sbin/pkg_install/info/pkg_info.110
4 files changed, 17 insertions, 5 deletions
diff --git a/usr.sbin/pkg_install/info/info.h b/usr.sbin/pkg_install/info/info.h
index 6554db5..46e29b1 100644
--- a/usr.sbin/pkg_install/info/info.h
+++ b/usr.sbin/pkg_install/info/info.h
@@ -64,6 +64,7 @@ TAILQ_HEAD(which_head, which_entry);
extern int Flags;
extern Boolean QUIET;
extern Boolean UseBlkSz;
+extern Boolean KeepPackage;
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 b22c54c..76fcaa8 100644
--- a/usr.sbin/pkg_install/info/main.c
+++ b/usr.sbin/pkg_install/info/main.c
@@ -26,7 +26,7 @@ __FBSDID("$FreeBSD$");
#include "info.h"
#include <err.h>
-static char Options[] = "abcdDe:EfgGhiIjkl:LmoO:pPqQrRst:vVW:xX";
+static char Options[] = "abcdDe:EfgGhiIjkKl:LmoO:pPqQrRst:vVW:xX";
int Flags = 0;
match_t MatchType = MATCH_GLOB;
@@ -36,6 +36,7 @@ char *InfoPrefix = (char *)(uintptr_t)"";
char PlayPen[FILENAME_MAX];
char *CheckPkg = NULL;
char *LookUpOrigin = NULL;
+Boolean KeepPackage = FALSE;
struct which_head *whead;
static void usage __P((void));
@@ -122,6 +123,10 @@ main(int argc, char **argv)
Flags |= SHOW_DEINSTALL;
break;
+ case 'K':
+ KeepPackage = TRUE;
+ break;
+
case 'r':
Flags |= SHOW_DEPEND;
break;
@@ -261,7 +266,7 @@ static void
usage()
{
fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n",
- "usage: pkg_info [-bcdDEfgGiIjkLmopPqQrRsvVxX] [-e package] [-l prefix]",
+ "usage: pkg_info [-bcdDEfgGiIjkKLmopPqQrRsvVxX] [-e package] [-l prefix]",
" [-t template] -a | pkg-name ...",
" pkg_info [-qQ] -W filename",
" pkg_info [-qQ] -O origin",
diff --git a/usr.sbin/pkg_install/info/perform.c b/usr.sbin/pkg_install/info/perform.c
index 960641b..3f3ceb0 100644
--- a/usr.sbin/pkg_install/info/perform.c
+++ b/usr.sbin/pkg_install/info/perform.c
@@ -100,7 +100,7 @@ pkg_do(char *pkg)
int code = 0;
if (isURL(pkg)) {
- if ((cp = fileGetURL(NULL, pkg)) != NULL) {
+ if ((cp = fileGetURL(NULL, pkg, KeepPackage)) != NULL) {
strcpy(fname, cp);
isTMP = TRUE;
}
diff --git a/usr.sbin/pkg_install/info/pkg_info.1 b/usr.sbin/pkg_install/info/pkg_info.1
index db1c431..86caa7a 100644
--- a/usr.sbin/pkg_install/info/pkg_info.1
+++ b/usr.sbin/pkg_install/info/pkg_info.1
@@ -17,7 +17,7 @@
.\" @(#)pkg_info.1
.\" $FreeBSD$
.\"
-.Dd November 23, 2005
+.Dd January 9, 2006
.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 bcdDEfgGijIkLmopPqQrRsvVxX
+.Op Fl bcdDEfgGijIkKLmopPqQrRsvVxX
.Op Fl e Ar package
.Op Fl l Ar prefix
.Op Fl t Ar template
@@ -106,6 +106,10 @@ precedence over all other package formatting options.
Show the requirements script (if any) for each package.
.It Fl k
Show the de-install script (if any) for each package.
+.It Fl K
+Keep any downloaded package in
+.Ev PKGDIR
+if it is defined or in current directory by default.
.It Fl r
Show the list of packages on which each package depends.
.It Fl R
@@ -242,6 +246,8 @@ Specifies an alternative location for the installed package database.
.It Ev PKG_PATH
Specifies an alternative package location, if a given package cannot be
found.
+.It Ev PKGDIR
+Specifies an alternative location to save downloaded packages to.
.El
.Sh FILES
.Bl -tag -width /var/db/pkg -compact
OpenPOWER on IntegriCloud