summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/info
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2002-09-09 19:43:30 +0000
committersobomax <sobomax@FreeBSD.org>2002-09-09 19:43:30 +0000
commit60298c96b3140b0f37e93f57243acd917f72c629 (patch)
tree003054543223e3603d315e1b39d4432eda313744 /usr.sbin/pkg_install/info
parent8a8d92cece0845d63268c8ad2bff66cebb33d4aa (diff)
downloadFreeBSD-src-60298c96b3140b0f37e93f57243acd917f72c629.zip
FreeBSD-src-60298c96b3140b0f37e93f57243acd917f72c629.tar.gz
Introduce notion of the package tools revision and allow to wrap all tools
included into pkg_install according to the content of /var/db/pkg_install.conf file, which specifies version and alternative location of the tools. Format of the said file is very simple: one line which specifies revision of the alternative version of the tools and their location separated by space, i.e.: 20030102 /usr/local/sbin This would allow bsd.port.mk to install and use up to date version of tools on older system from ports. Also add new `-P' flag to pkg_info, which causes it to report currently installed version of package tools. Discussed with: will
Diffstat (limited to 'usr.sbin/pkg_install/info')
-rw-r--r--usr.sbin/pkg_install/info/info.h33
-rw-r--r--usr.sbin/pkg_install/info/main.c13
-rw-r--r--usr.sbin/pkg_install/info/pkg_info.14
3 files changed, 32 insertions, 18 deletions
diff --git a/usr.sbin/pkg_install/info/info.h b/usr.sbin/pkg_install/info/info.h
index 9f4b52f..94a8b5b 100644
--- a/usr.sbin/pkg_install/info/info.h
+++ b/usr.sbin/pkg_install/info/info.h
@@ -33,22 +33,23 @@
#define MAXNAMESIZE 20
#endif
-#define SHOW_COMMENT 0x0001
-#define SHOW_DESC 0x0002
-#define SHOW_PLIST 0x0004
-#define SHOW_INSTALL 0x0008
-#define SHOW_DEINSTALL 0x0010
-#define SHOW_REQUIRE 0x0020
-#define SHOW_PREFIX 0x0040
-#define SHOW_INDEX 0x0080
-#define SHOW_FILES 0x0100
-#define SHOW_DISPLAY 0x0200
-#define SHOW_REQBY 0x0400
-#define SHOW_MTREE 0x0800
-#define SHOW_SIZE 0x1000
-#define SHOW_ORIGIN 0x2000
-#define SHOW_CKSUM 0x4000
-#define SHOW_FMTREV 0x8000
+#define SHOW_COMMENT 0x00001
+#define SHOW_DESC 0x00002
+#define SHOW_PLIST 0x00004
+#define SHOW_INSTALL 0x00008
+#define SHOW_DEINSTALL 0x00010
+#define SHOW_REQUIRE 0x00020
+#define SHOW_PREFIX 0x00040
+#define SHOW_INDEX 0x00080
+#define SHOW_FILES 0x00100
+#define SHOW_DISPLAY 0x00200
+#define SHOW_REQBY 0x00400
+#define SHOW_MTREE 0x00800
+#define SHOW_SIZE 0x01000
+#define SHOW_ORIGIN 0x02000
+#define SHOW_CKSUM 0x04000
+#define SHOW_FMTREV 0x08000
+#define SHOW_PTREV 0x10000
struct which_entry {
TAILQ_ENTRY(which_entry) next;
diff --git a/usr.sbin/pkg_install/info/main.c b/usr.sbin/pkg_install/info/main.c
index c1c8816..401cf13 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[] = "acdDe:fgGhiIkl:LmoO:pqrRst:vVW:x";
+static char Options[] = "acdDe:fgGhiIkl:LmoO:pPqrRst:vVW:x";
int Flags = 0;
match_t MatchType = MATCH_GLOB;
@@ -177,6 +177,10 @@ main(int argc, char **argv)
break;
}
+ case 'P':
+ Flags = SHOW_PTREV;
+ break;
+
case 'h':
case '?':
default:
@@ -188,6 +192,13 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;
+ if (Flags & SHOW_PTREV) {
+ if (!Quiet)
+ printf("Package tools revision: ");
+ printf("%d\n", PKG_INSTALL_VERSION);
+ exit(0);
+ }
+
/* Set some reasonable defaults */
if (!Flags)
Flags = SHOW_COMMENT | SHOW_DESC | SHOW_REQBY;
diff --git a/usr.sbin/pkg_install/info/pkg_info.1 b/usr.sbin/pkg_install/info/pkg_info.1
index c4a97ba..f618e01 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 cdDfgGiIkLmopqrRsvVx
+.Op Fl cdDfgGiIkLmopPqrRsvVx
.Op Fl e Ar package
.Op Fl l Ar prefix
.Op Fl t Ar template
@@ -174,6 +174,8 @@ indeed to overflow it.
.Ed
.It Fl V
Show revision number of the packing list format.
+.It Fl P
+Show revision number of package tools.
.El
.Sh TECHNICAL DETAILS
Package info is either extracted from package files named on the
OpenPOWER on IntegriCloud