Mon Mar 2 17:13:49 2009 UTC ()
pkg_install-20090302:
Add new option -r to pkg_info, which works like -R, but expands it
recursively.


(joerg)
diff -r1.17 -r1.18 pkgsrc/pkgtools/pkg_install/files/info/info.h
diff -r1.24 -r1.25 pkgsrc/pkgtools/pkg_install/files/info/main.c
diff -r1.24 -r1.25 pkgsrc/pkgtools/pkg_install/files/info/show.c
diff -r1.52 -r1.53 pkgsrc/pkgtools/pkg_install/files/info/perform.c
diff -r1.23 -r1.24 pkgsrc/pkgtools/pkg_install/files/info/pkg_info.1
diff -r1.20 -r1.21 pkgsrc/pkgtools/pkg_install/files/info/pkg_info.cat1
diff -r1.116 -r1.117 pkgsrc/pkgtools/pkg_install/files/lib/version.h

cvs diff -r1.17 -r1.18 pkgsrc/pkgtools/pkg_install/files/info/info.h (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/files/info/info.h 2008/02/02 16:21:45 1.17
+++ pkgsrc/pkgtools/pkg_install/files/info/info.h 2009/03/02 17:13:49 1.18
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: info.h,v 1.17 2008/02/02 16:21:45 joerg Exp $ */ 1/* $NetBSD: info.h,v 1.18 2009/03/02 17:13:49 joerg Exp $ */
2 2
3/* from FreeBSD Id: info.h,v 1.10 1997/02/22 16:09:40 peter Exp */ 3/* from FreeBSD Id: info.h,v 1.10 1997/02/22 16:09:40 peter Exp */
4 4
5/*- 5/*-
6 * Copyright (c) 2008 Joerg Sonnenberger <joerg@NetBSD.org>. 6 * Copyright (c) 2008 Joerg Sonnenberger <joerg@NetBSD.org>.
7 * All rights reserved. 7 * All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 12 *
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -60,26 +60,27 @@ struct pkg_meta { @@ -60,26 +60,27 @@ struct pkg_meta {
60 char *meta_desc; 60 char *meta_desc;
61 char *meta_mtree; 61 char *meta_mtree;
62 char *meta_build_version; 62 char *meta_build_version;
63 char *meta_build_info; 63 char *meta_build_info;
64 char *meta_size_pkg; 64 char *meta_size_pkg;
65 char *meta_size_all; 65 char *meta_size_all;
66 char *meta_required_by; 66 char *meta_required_by;
67 char *meta_display; 67 char *meta_display;
68 char *meta_install; 68 char *meta_install;
69 char *meta_deinstall; 69 char *meta_deinstall;
70 char *meta_preserve; 70 char *meta_preserve;
71 char *meta_views; 71 char *meta_views;
72 char *meta_installed_info; 72 char *meta_installed_info;
 73 int is_installed;
73}; 74};
74 75
75#ifndef MAXINDEXSIZE 76#ifndef MAXINDEXSIZE
76#define MAXINDEXSIZE 60 77#define MAXINDEXSIZE 60
77#endif 78#endif
78 79
79#ifndef MAXNAMESIZE 80#ifndef MAXNAMESIZE
80#define MAXNAMESIZE 20 81#define MAXNAMESIZE 20
81#endif 82#endif
82 83
83#define SHOW_COMMENT 0x00001 84#define SHOW_COMMENT 0x00001
84#define SHOW_DESC 0x00002 85#define SHOW_DESC 0x00002
85#define SHOW_PLIST 0x00004 86#define SHOW_PLIST 0x00004
@@ -89,26 +90,27 @@ struct pkg_meta { @@ -89,26 +90,27 @@ struct pkg_meta {
89#define SHOW_INDEX 0x00080 90#define SHOW_INDEX 0x00080
90#define SHOW_FILES 0x00100 91#define SHOW_FILES 0x00100
91#define SHOW_DISPLAY 0x00200 92#define SHOW_DISPLAY 0x00200
92#define SHOW_REQBY 0x00400 93#define SHOW_REQBY 0x00400
93#define SHOW_MTREE 0x00800 94#define SHOW_MTREE 0x00800
94#define SHOW_BUILD_VERSION 0x01000 95#define SHOW_BUILD_VERSION 0x01000
95#define SHOW_BUILD_INFO 0x02000 96#define SHOW_BUILD_INFO 0x02000
96#define SHOW_DEPENDS 0x04000 97#define SHOW_DEPENDS 0x04000
97#define SHOW_PKG_SIZE 0x08000 98#define SHOW_PKG_SIZE 0x08000
98#define SHOW_ALL_SIZE 0x10000 99#define SHOW_ALL_SIZE 0x10000
99#define SHOW_BLD_DEPENDS 0x20000 100#define SHOW_BLD_DEPENDS 0x20000
100#define SHOW_BI_VAR 0x40000 101#define SHOW_BI_VAR 0x40000
101#define SHOW_SUMMARY 0x80000 102#define SHOW_SUMMARY 0x80000
 103#define SHOW_FULL_REQBY 0x100000
102 104
103enum which { 105enum which {
104 WHICH_ALL, 106 WHICH_ALL,
105 WHICH_USER, 107 WHICH_USER,
106 WHICH_LIST 108 WHICH_LIST
107}; 109};
108 110
109extern int Flags; 111extern int Flags;
110extern enum which Which; 112extern enum which Which;
111extern Boolean File2Pkg; 113extern Boolean File2Pkg;
112extern Boolean Quiet; 114extern Boolean Quiet;
113extern char *InfoPrefix; 115extern char *InfoPrefix;
114extern char *BuildInfoVariable; 116extern char *BuildInfoVariable;
@@ -118,17 +120,18 @@ extern size_t termwidth; @@ -118,17 +120,18 @@ extern size_t termwidth;
118extern lpkg_head_t pkgs; 120extern lpkg_head_t pkgs;
119 121
120int CheckForPkg(const char *); 122int CheckForPkg(const char *);
121int CheckForBestPkg(const char *); 123int CheckForBestPkg(const char *);
122 124
123void show_file(const char *, const char *, Boolean); 125void show_file(const char *, const char *, Boolean);
124void show_var(const char *, const char *); 126void show_var(const char *, const char *);
125void show_plist(const char *, package_t *, pl_ent_t); 127void show_plist(const char *, package_t *, pl_ent_t);
126void show_files(const char *, package_t *); 128void show_files(const char *, package_t *);
127void show_depends(const char *, package_t *); 129void show_depends(const char *, package_t *);
128void show_bld_depends(const char *, package_t *); 130void show_bld_depends(const char *, package_t *);
129void show_index(const char *, const char *); 131void show_index(const char *, const char *);
130void show_summary(struct pkg_meta *, package_t *, const char *); 132void show_summary(struct pkg_meta *, package_t *, const char *);
 133void show_list(lpkg_head_t *, const char *);
131 134
132int pkg_perform(lpkg_head_t *); 135int pkg_perform(lpkg_head_t *);
133 136
134#endif /* _INST_INFO_H_INCLUDE */ 137#endif /* _INST_INFO_H_INCLUDE */

cvs diff -r1.24 -r1.25 pkgsrc/pkgtools/pkg_install/files/info/main.c (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/files/info/main.c 2009/02/28 16:03:56 1.24
+++ pkgsrc/pkgtools/pkg_install/files/info/main.c 2009/03/02 17:13:49 1.25
@@ -1,23 +1,23 @@ @@ -1,23 +1,23 @@
1/* $NetBSD: main.c,v 1.24 2009/02/28 16:03:56 joerg Exp $ */ 1/* $NetBSD: main.c,v 1.25 2009/03/02 17:13:49 joerg Exp $ */
2 2
3#if HAVE_CONFIG_H 3#if HAVE_CONFIG_H
4#include "config.h" 4#include "config.h"
5#endif 5#endif
6#include <nbcompat.h> 6#include <nbcompat.h>
7#if HAVE_SYS_CDEFS_H 7#if HAVE_SYS_CDEFS_H
8#include <sys/cdefs.h> 8#include <sys/cdefs.h>
9#endif 9#endif
10__RCSID("$NetBSD: main.c,v 1.24 2009/02/28 16:03:56 joerg Exp $"); 10__RCSID("$NetBSD: main.c,v 1.25 2009/03/02 17:13:49 joerg Exp $");
11 11
12/* 12/*
13 * 13 *
14 * FreeBSD install - a package for the installation and maintainance 14 * FreeBSD install - a package for the installation and maintainance
15 * of non-core utilities. 15 * of non-core utilities.
16 * 16 *
17 * Redistribution and use in source and binary forms, with or without 17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions 18 * modification, are permitted provided that the following conditions
19 * are met: 19 * are met:
20 * 1. Redistributions of source code must retain the above copyright 20 * 1. Redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer. 21 * notice, this list of conditions and the following disclaimer.
22 * 2. Redistributions in binary form must reproduce the above copyright 22 * 2. Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the 23 * notice, this list of conditions and the following disclaimer in the
@@ -34,44 +34,44 @@ __RCSID("$NetBSD: main.c,v 1.24 2009/02/ @@ -34,44 +34,44 @@ __RCSID("$NetBSD: main.c,v 1.24 2009/02/
34#include <sys/ioctl.h> 34#include <sys/ioctl.h>
35#endif 35#endif
36 36
37#if HAVE_TERMIOS_H 37#if HAVE_TERMIOS_H
38#include <termios.h> 38#include <termios.h>
39#endif 39#endif
40#if HAVE_ERR_H 40#if HAVE_ERR_H
41#include <err.h> 41#include <err.h>
42#endif 42#endif
43 43
44#include "lib.h" 44#include "lib.h"
45#include "info.h" 45#include "info.h"
46 46
47static const char Options[] = ".aBbcDde:E:fFhIiK:kLl:mNnpQ:qRsSuvVX"; 47static const char Options[] = ".aBbcDde:E:fFhIiK:kLl:mNnpQ:qrRsSuvVX";
48 48
49int Flags = 0; 49int Flags = 0;
50enum which Which = WHICH_LIST; 50enum which Which = WHICH_LIST;
51Boolean File2Pkg = FALSE; 51Boolean File2Pkg = FALSE;
52Boolean Quiet = FALSE; 52Boolean Quiet = FALSE;
53char *InfoPrefix = ""; 53char *InfoPrefix = "";
54char *BuildInfoVariable = ""; 54char *BuildInfoVariable = "";
55char PlayPen[MaxPathSize]; 55char PlayPen[MaxPathSize];
56size_t PlayPenSize = sizeof(PlayPen); 56size_t PlayPenSize = sizeof(PlayPen);
57size_t termwidth = 0; 57size_t termwidth = 0;
58lpkg_head_t pkgs; 58lpkg_head_t pkgs;
59 59
60static void 60static void
61usage(void) 61usage(void)
62{ 62{
63 fprintf(stderr, "%s\n%s\n%s\n%s\n", 63 fprintf(stderr, "%s\n%s\n%s\n%s\n",
64 "usage: pkg_info [-BbcDdFfhIikLmNnpqRSsVvX] [-e package] [-E package]", 64 "usage: pkg_info [-BbcDdFfhIikLmNnpqrRSsVvX] [-e package] [-E package]",
65 " [-K pkg_dbdir] [-l prefix] pkg-name ...", 65 " [-K pkg_dbdir] [-l prefix] pkg-name ...",
66 " pkg_info [-a | -u] [flags]", 66 " pkg_info [-a | -u] [flags]",
67 " pkg_info [-Q variable] pkg-name ..."); 67 " pkg_info [-Q variable] pkg-name ...");
68 exit(1); 68 exit(1);
69} 69}
70 70
71int 71int
72main(int argc, char **argv) 72main(int argc, char **argv)
73{ 73{
74 char *CheckPkg = NULL; 74 char *CheckPkg = NULL;
75 char *BestCheckPkg = NULL; 75 char *BestCheckPkg = NULL;
76 lpkg_t *lpp; 76 lpkg_t *lpp;
77 int ch; 77 int ch;
@@ -162,26 +162,30 @@ main(int argc, char **argv) @@ -162,26 +162,30 @@ main(int argc, char **argv)
162 case 'p': 162 case 'p':
163 Flags |= SHOW_PREFIX; 163 Flags |= SHOW_PREFIX;
164 break; 164 break;
165 165
166 case 'Q': 166 case 'Q':
167 Flags |= SHOW_BI_VAR; 167 Flags |= SHOW_BI_VAR;
168 BuildInfoVariable = optarg; 168 BuildInfoVariable = optarg;
169 break; 169 break;
170 170
171 case 'q': 171 case 'q':
172 Quiet = TRUE; 172 Quiet = TRUE;
173 break; 173 break;
174 174
 175 case 'r':
 176 Flags |= SHOW_FULL_REQBY;
 177 break;
 178
175 case 'R': 179 case 'R':
176 Flags |= SHOW_REQBY; 180 Flags |= SHOW_REQBY;
177 break; 181 break;
178 182
179 case 's': 183 case 's':
180 Flags |= SHOW_PKG_SIZE; 184 Flags |= SHOW_PKG_SIZE;
181 break; 185 break;
182 186
183 case 'S': 187 case 'S':
184 Flags |= SHOW_ALL_SIZE; 188 Flags |= SHOW_ALL_SIZE;
185 break; 189 break;
186 190
187 case 'u': 191 case 'u':

cvs diff -r1.24 -r1.25 pkgsrc/pkgtools/pkg_install/files/info/show.c (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/files/info/show.c 2009/02/11 23:51:30 1.24
+++ pkgsrc/pkgtools/pkg_install/files/info/show.c 2009/03/02 17:13:49 1.25
@@ -1,23 +1,23 @@ @@ -1,23 +1,23 @@
1/* $NetBSD: show.c,v 1.24 2009/02/11 23:51:30 joerg Exp $ */ 1/* $NetBSD: show.c,v 1.25 2009/03/02 17:13:49 joerg Exp $ */
2 2
3#if HAVE_CONFIG_H 3#if HAVE_CONFIG_H
4#include "config.h" 4#include "config.h"
5#endif 5#endif
6#include <nbcompat.h> 6#include <nbcompat.h>
7#if HAVE_SYS_CDEFS_H 7#if HAVE_SYS_CDEFS_H
8#include <sys/cdefs.h> 8#include <sys/cdefs.h>
9#endif 9#endif
10__RCSID("$NetBSD: show.c,v 1.24 2009/02/11 23:51:30 joerg Exp $"); 10__RCSID("$NetBSD: show.c,v 1.25 2009/03/02 17:13:49 joerg Exp $");
11 11
12/* 12/*
13 * FreeBSD install - a package for the installation and maintainance 13 * FreeBSD install - a package for the installation and maintainance
14 * of non-core utilities. 14 * of non-core utilities.
15 * 15 *
16 * Redistribution and use in source and binary forms, with or without 16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions 17 * modification, are permitted provided that the following conditions
18 * are met: 18 * are met:
19 * 1. Redistributions of source code must retain the above copyright 19 * 1. Redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer. 20 * notice, this list of conditions and the following disclaimer.
21 * 2. Redistributions in binary form must reproduce the above copyright 21 * 2. Redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the 22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution. 23 * documentation and/or other materials provided with the distribution.
@@ -395,13 +395,31 @@ static int @@ -395,13 +395,31 @@ static int
395print_string_as_var(const char *var, const char *str) 395print_string_as_var(const char *var, const char *str)
396{ 396{
397 const char *eol; 397 const char *eol;
398 398
399 while ((eol = strchr(str, '\n')) != NULL) { 399 while ((eol = strchr(str, '\n')) != NULL) {
400 printf("%s=%.*s\n", var, (int)(eol - str), str); 400 printf("%s=%.*s\n", var, (int)(eol - str), str);
401 str = eol + 1; 401 str = eol + 1;
402 } 402 }
403 if (*str) 403 if (*str)
404 printf("%s=%s\n", var, str); 404 printf("%s=%s\n", var, str);
405 405
406 return 0; 406 return 0;
407} 407}
 408
 409void
 410show_list(lpkg_head_t *pkghead, const char *title)
 411{
 412 lpkg_t *lpp;
 413
 414 if (!Quiet)
 415 printf("%s%s", InfoPrefix, title);
 416
 417 while ((lpp = TAILQ_FIRST(pkghead)) != NULL) {
 418 TAILQ_REMOVE(pkghead, lpp, lp_link);
 419 puts(lpp->lp_name);
 420 free_lpkg(lpp);
 421 }
 422
 423 if (!Quiet)
 424 printf("\n");
 425}

cvs diff -r1.52 -r1.53 pkgsrc/pkgtools/pkg_install/files/info/perform.c (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/files/info/perform.c 2009/02/25 20:52:10 1.52
+++ pkgsrc/pkgtools/pkg_install/files/info/perform.c 2009/03/02 17:13:49 1.53
@@ -1,29 +1,29 @@ @@ -1,29 +1,29 @@
1/* $NetBSD: perform.c,v 1.52 2009/02/25 20:52:10 joerg Exp $ */ 1/* $NetBSD: perform.c,v 1.53 2009/03/02 17:13:49 joerg Exp $ */
2 2
3#if HAVE_CONFIG_H 3#if HAVE_CONFIG_H
4#include "config.h" 4#include "config.h"
5#endif 5#endif
6#include <nbcompat.h> 6#include <nbcompat.h>
7#if HAVE_SYS_CDEFS_H 7#if HAVE_SYS_CDEFS_H
8#include <sys/cdefs.h> 8#include <sys/cdefs.h>
9#endif 9#endif
10#if HAVE_SYS_QUEUE_H 10#if HAVE_SYS_QUEUE_H
11#include <sys/queue.h> 11#include <sys/queue.h>
12#endif 12#endif
13#if HAVE_SYS_WAIT_H 13#if HAVE_SYS_WAIT_H
14#include <sys/wait.h> 14#include <sys/wait.h>
15#endif 15#endif
16__RCSID("$NetBSD: perform.c,v 1.52 2009/02/25 20:52:10 joerg Exp $"); 16__RCSID("$NetBSD: perform.c,v 1.53 2009/03/02 17:13:49 joerg Exp $");
17 17
18/*- 18/*-
19 * Copyright (c) 2008 Joerg Sonnenberger <joerg@NetBSD.org>. 19 * Copyright (c) 2008 Joerg Sonnenberger <joerg@NetBSD.org>.
20 * All rights reserved. 20 * All rights reserved.
21 * 21 *
22 * Redistribution and use in source and binary forms, with or without 22 * Redistribution and use in source and binary forms, with or without
23 * modification, are permitted provided that the following conditions 23 * modification, are permitted provided that the following conditions
24 * are met: 24 * are met:
25 * 25 *
26 * 1. Redistributions of source code must retain the above copyright 26 * 1. Redistributions of source code must retain the above copyright
27 * notice, this list of conditions and the following disclaimer. 27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright 28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in 29 * notice, this list of conditions and the following disclaimer in
@@ -224,26 +224,27 @@ has_entry: @@ -224,26 +224,27 @@ has_entry:
224 (*target)[size] = '\0'; 224 (*target)[size] = '\0';
225 } 225 }
226 226
227 for (descr = pkg_meta_descriptors; descr->entry_filename; ++descr) { 227 for (descr = pkg_meta_descriptors; descr->entry_filename; ++descr) {
228 if (descr->required_file) 228 if (descr->required_file)
229 --found_required; 229 --found_required;
230 } 230 }
231 if (found_required != 0) { 231 if (found_required != 0) {
232 free_pkg_meta(meta); 232 free_pkg_meta(meta);
233 meta = NULL; 233 meta = NULL;
234 } 234 }
235 235
236 archive_read_finish(archive); 236 archive_read_finish(archive);
 237 meta->is_installed = 0;
237 238
238 return meta; 239 return meta;
239} 240}
240#endif 241#endif
241 242
242static struct pkg_meta * 243static struct pkg_meta *
243read_meta_data_from_pkgdb(const char *pkg) 244read_meta_data_from_pkgdb(const char *pkg)
244{ 245{
245 struct pkg_meta *meta; 246 struct pkg_meta *meta;
246 const struct pkg_meta_desc *descr; 247 const struct pkg_meta_desc *descr;
247 char **target; 248 char **target;
248 char *fname; 249 char *fname;
249 int fd; 250 int fd;
@@ -269,29 +270,70 @@ read_meta_data_from_pkgdb(const char *pk @@ -269,29 +270,70 @@ read_meta_data_from_pkgdb(const char *pk
269 if (fstat(fd, &st) == -1) 270 if (fstat(fd, &st) == -1)
270 err(2, "cannot stat meta data"); 271 err(2, "cannot stat meta data");
271 if ((st.st_mode & S_IFMT) != S_IFREG) 272 if ((st.st_mode & S_IFMT) != S_IFREG)
272 errx(1, "meta data is not regular file"); 273 errx(1, "meta data is not regular file");
273 if (st.st_size > SSIZE_MAX - 1) 274 if (st.st_size > SSIZE_MAX - 1)
274 err(2, "meta data file too large to process"); 275 err(2, "meta data file too large to process");
275 *target = xmalloc(st.st_size + 1); 276 *target = xmalloc(st.st_size + 1);
276 if (read(fd, *target, st.st_size) != st.st_size) 277 if (read(fd, *target, st.st_size) != st.st_size)
277 err(2, "cannot read meta data"); 278 err(2, "cannot read meta data");
278 (*target)[st.st_size] = '\0'; 279 (*target)[st.st_size] = '\0';
279 close(fd); 280 close(fd);
280 } 281 }
281 282
 283 meta->is_installed = 1;
 284
282 return meta; 285 return meta;
283} 286}
284 287
 288static void
 289build_full_reqby(lpkg_head_t *reqby, struct pkg_meta *meta)
 290{
 291 char *iter, *eol, *next;
 292 lpkg_t *lpp;
 293 struct pkg_meta *meta_dep;
 294
 295 if (meta->is_installed == 0 || meta->meta_required_by == NULL)
 296 return;
 297
 298 for (iter = meta->meta_required_by; *iter != '\0'; iter = next) {
 299 eol = iter + strcspn(iter, "\n");
 300 if (*eol == '\n')
 301 next = eol + 1;
 302 else
 303 next = eol;
 304 if (iter == eol)
 305 continue;
 306 TAILQ_FOREACH(lpp, reqby, lp_link) {
 307 if (strlen(lpp->lp_name) != eol - iter)
 308 continue;
 309 if (memcmp(lpp->lp_name, iter, eol - iter) == 0)
 310 break;
 311 }
 312 if (lpp != NULL)
 313 continue;
 314 *eol = '\0';
 315 lpp = alloc_lpkg(iter);
 316 if (next != eol)
 317 *eol = '\n';
 318 TAILQ_INSERT_TAIL(reqby, lpp, lp_link);
 319 meta_dep = read_meta_data_from_pkgdb(lpp->lp_name);
 320 if (meta_dep == NULL)
 321 continue;
 322 build_full_reqby(reqby, meta_dep);
 323 free_pkg_meta(meta_dep);
 324 }
 325}
 326
285static lfile_head_t files; 327static lfile_head_t files;
286 328
287static int 329static int
288pkg_do(const char *pkg) 330pkg_do(const char *pkg)
289{ 331{
290 struct pkg_meta *meta; 332 struct pkg_meta *meta;
291 char log_dir[MaxPathSize]; 333 char log_dir[MaxPathSize];
292 int code = 0; 334 int code = 0;
293 const char *binpkgfile = NULL; 335 const char *binpkgfile = NULL;
294 336
295 if (IS_URL(pkg) || (fexists(pkg) && isfile(pkg))) { 337 if (IS_URL(pkg) || (fexists(pkg) && isfile(pkg))) {
296#ifdef BOOTSTRAP 338#ifdef BOOTSTRAP
297 errx(2, "Binary packages not supported during bootstrap"); 339 errx(2, "Binary packages not supported during bootstrap");
@@ -386,26 +428,32 @@ pkg_do(const char *pkg) @@ -386,26 +428,32 @@ pkg_do(const char *pkg)
386 } 428 }
387 if (Flags & SHOW_COMMENT) { 429 if (Flags & SHOW_COMMENT) {
388 show_file(meta->meta_comment, "Comment:\n", TRUE); 430 show_file(meta->meta_comment, "Comment:\n", TRUE);
389 } 431 }
390 if (Flags & SHOW_DEPENDS) { 432 if (Flags & SHOW_DEPENDS) {
391 show_depends("Requires:\n", &plist); 433 show_depends("Requires:\n", &plist);
392 } 434 }
393 if (Flags & SHOW_BLD_DEPENDS) { 435 if (Flags & SHOW_BLD_DEPENDS) {
394 show_bld_depends("Built using:\n", &plist); 436 show_bld_depends("Built using:\n", &plist);
395 } 437 }
396 if ((Flags & SHOW_REQBY) && meta->meta_required_by) { 438 if ((Flags & SHOW_REQBY) && meta->meta_required_by) {
397 show_file(meta->meta_required_by, "Required by:\n", TRUE); 439 show_file(meta->meta_required_by, "Required by:\n", TRUE);
398 } 440 }
 441 if ((Flags & SHOW_FULL_REQBY) && meta->is_installed) {
 442 lpkg_head_t reqby;
 443 TAILQ_INIT(&reqby);
 444 build_full_reqby(&reqby, meta);
 445 show_list(&reqby, "Full required by list:\n");
 446 }
399 if (Flags & SHOW_DESC) { 447 if (Flags & SHOW_DESC) {
400 show_file(meta->meta_desc, "Description:\n", TRUE); 448 show_file(meta->meta_desc, "Description:\n", TRUE);
401 } 449 }
402 if ((Flags & SHOW_DISPLAY) && meta->meta_display) { 450 if ((Flags & SHOW_DISPLAY) && meta->meta_display) {
403 show_file(meta->meta_display, "Install notice:\n", 451 show_file(meta->meta_display, "Install notice:\n",
404 TRUE); 452 TRUE);
405 } 453 }
406 if (Flags & SHOW_PLIST) { 454 if (Flags & SHOW_PLIST) {
407 show_plist("Packing list:\n", &plist, PLIST_SHOW_ALL); 455 show_plist("Packing list:\n", &plist, PLIST_SHOW_ALL);
408 } 456 }
409 if ((Flags & SHOW_INSTALL) && meta->meta_install) { 457 if ((Flags & SHOW_INSTALL) && meta->meta_install) {
410 show_file(meta->meta_install, "Install script:\n", 458 show_file(meta->meta_install, "Install script:\n",
411 TRUE); 459 TRUE);
@@ -577,27 +625,27 @@ pkg_perform(lpkg_head_t *pkghead) @@ -577,27 +625,27 @@ pkg_perform(lpkg_head_t *pkghead)
577 desired_meta_data |= LOAD_PRESERVE; 625 desired_meta_data |= LOAD_PRESERVE;
578 if ((Flags & (SHOW_INDEX | SHOW_BI_VAR)) == 0) 626 if ((Flags & (SHOW_INDEX | SHOW_BI_VAR)) == 0)
579 desired_meta_data |= LOAD_CONTENTS; 627 desired_meta_data |= LOAD_CONTENTS;
580 if (Flags & (SHOW_COMMENT | SHOW_INDEX | SHOW_SUMMARY)) 628 if (Flags & (SHOW_COMMENT | SHOW_INDEX | SHOW_SUMMARY))
581 desired_meta_data |= LOAD_COMMENT; 629 desired_meta_data |= LOAD_COMMENT;
582 if (Flags & (SHOW_BI_VAR | SHOW_BUILD_INFO | SHOW_SUMMARY)) 630 if (Flags & (SHOW_BI_VAR | SHOW_BUILD_INFO | SHOW_SUMMARY))
583 desired_meta_data |= LOAD_BUILD_INFO | LOAD_INSTALLED_INFO; 631 desired_meta_data |= LOAD_BUILD_INFO | LOAD_INSTALLED_INFO;
584 if (Flags & (SHOW_SUMMARY | SHOW_PKG_SIZE)) 632 if (Flags & (SHOW_SUMMARY | SHOW_PKG_SIZE))
585 desired_meta_data |= LOAD_SIZE_PKG; 633 desired_meta_data |= LOAD_SIZE_PKG;
586 if (Flags & SHOW_ALL_SIZE) 634 if (Flags & SHOW_ALL_SIZE)
587 desired_meta_data |= LOAD_SIZE_ALL; 635 desired_meta_data |= LOAD_SIZE_ALL;
588 if (Flags & (SHOW_SUMMARY | SHOW_DESC)) 636 if (Flags & (SHOW_SUMMARY | SHOW_DESC))
589 desired_meta_data |= LOAD_DESC; 637 desired_meta_data |= LOAD_DESC;
590 if (Flags & SHOW_REQBY) 638 if (Flags & (SHOW_REQBY | SHOW_FULL_REQBY))
591 desired_meta_data |= LOAD_REQUIRED_BY; 639 desired_meta_data |= LOAD_REQUIRED_BY;
592 if (Flags & SHOW_DISPLAY) 640 if (Flags & SHOW_DISPLAY)
593 desired_meta_data |= LOAD_DISPLAY; 641 desired_meta_data |= LOAD_DISPLAY;
594 if (Flags & SHOW_INSTALL) 642 if (Flags & SHOW_INSTALL)
595 desired_meta_data |= LOAD_INSTALL; 643 desired_meta_data |= LOAD_INSTALL;
596 if (Flags & SHOW_DEINSTALL) 644 if (Flags & SHOW_DEINSTALL)
597 desired_meta_data |= LOAD_DEINSTALL; 645 desired_meta_data |= LOAD_DEINSTALL;
598 if (Flags & SHOW_MTREE) 646 if (Flags & SHOW_MTREE)
599 desired_meta_data |= LOAD_MTREE; 647 desired_meta_data |= LOAD_MTREE;
600 if (Flags & SHOW_BUILD_VERSION) 648 if (Flags & SHOW_BUILD_VERSION)
601 desired_meta_data |= LOAD_BUILD_VERSION; 649 desired_meta_data |= LOAD_BUILD_VERSION;
602 650
603 651

cvs diff -r1.23 -r1.24 pkgsrc/pkgtools/pkg_install/files/info/pkg_info.1 (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/files/info/pkg_info.1 2009/02/28 16:03:56 1.23
+++ pkgsrc/pkgtools/pkg_install/files/info/pkg_info.1 2009/03/02 17:13:49 1.24
@@ -1,41 +1,41 @@ @@ -1,41 +1,41 @@
1.\" $NetBSD: pkg_info.1,v 1.23 2009/02/28 16:03:56 joerg Exp $ 1.\" $NetBSD: pkg_info.1,v 1.24 2009/03/02 17:13:49 joerg Exp $
2.\" 2.\"
3.\" FreeBSD install - a package for the installation and maintenance 3.\" FreeBSD install - a package for the installation and maintenance
4.\" of non-core utilities. 4.\" of non-core utilities.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 14.\"
15.\" Jordan K. Hubbard 15.\" Jordan K. Hubbard
16.\" 16.\"
17.\" 17.\"
18.\" @(#)pkg_info.1 18.\" @(#)pkg_info.1
19.\" 19.\"
20.Dd February 27, 2009 20.Dd March 2, 2009
21.Dt PKG_INFO 1 21.Dt PKG_INFO 1
22.Os 22.Os
23.Sh NAME 23.Sh NAME
24.Nm pkg_info 24.Nm pkg_info
25.Nd a utility for displaying information on software packages 25.Nd a utility for displaying information on software packages
26.Sh SYNOPSIS 26.Sh SYNOPSIS
27.Nm 27.Nm
28.Op Fl BbcDdFfhIikLmNnpqRSsVvX 28.Op Fl BbcDdFfhIikLmNnpqrRSsVvX
29.Op Fl e Ar package 29.Op Fl e Ar package
30.Op Fl E Ar package 30.Op Fl E Ar package
31.Op Fl K Ar pkg_dbdir 31.Op Fl K Ar pkg_dbdir
32.Op Fl l Ar prefix 32.Op Fl l Ar prefix
33.Ar pkg-name ... 33.Ar pkg-name ...
34.Nm 34.Nm
35.Op Fl a | Fl u 35.Op Fl a | Fl u
36.Op flags 36.Op flags
37.Nm 37.Nm
38.Op Fl Q Ar variable 38.Op Fl Q Ar variable
39.Ar pkg-name ... 39.Ar pkg-name ...
40.Sh DESCRIPTION 40.Sh DESCRIPTION
41The 41The
@@ -166,26 +166,29 @@ Show the installation prefix for each pa @@ -166,26 +166,29 @@ Show the installation prefix for each pa
166.It Fl Q 166.It Fl Q
167Show the definition of 167Show the definition of
168.Ar variable 168.Ar variable
169from the build information for each package. 169from the build information for each package.
170An empty string is returned if no such variable definition is found for 170An empty string is returned if no such variable definition is found for
171the package(s). 171the package(s).
172.It Fl q 172.It Fl q
173Be 173Be
174.Dq quiet 174.Dq quiet
175in emitting report headers and such, just dump the 175in emitting report headers and such, just dump the
176raw info (basically, assume a non-human reading). 176raw info (basically, assume a non-human reading).
177.It Fl R 177.It Fl R
178For each package, show the packages that require it. 178For each package, show the packages that require it.
 179.It Fl r
 180For each package, show the packages that require it.
 181Continue recursively to show all dependents.
179.It Fl S 182.It Fl S
180Show the size of this package and all the packages it requires, 183Show the size of this package and all the packages it requires,
181in bytes. 184in bytes.
182.It Fl s 185.It Fl s
183Show the size of this package in bytes. 186Show the size of this package in bytes.
184The size is calculated by adding up the size of each file of the package. 187The size is calculated by adding up the size of each file of the package.
185.It Fl u 188.It Fl u
186Show information for all user-installed packages. 189Show information for all user-installed packages.
187Automatically installed packages (as dependencies 190Automatically installed packages (as dependencies
188of other packages) are not displayed. 191of other packages) are not displayed.
189See also 192See also
190.Fl a . 193.Fl a .
191.It Fl V 194.It Fl V

cvs diff -r1.20 -r1.21 pkgsrc/pkgtools/pkg_install/files/info/Attic/pkg_info.cat1 (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/files/info/Attic/pkg_info.cat1 2009/02/28 16:03:56 1.20
+++ pkgsrc/pkgtools/pkg_install/files/info/Attic/pkg_info.cat1 2009/03/02 17:13:49 1.21
@@ -1,20 +1,20 @@ @@ -1,20 +1,20 @@
1PKG_INFO(1) NetBSD General Commands Manual PKG_INFO(1) 1PKG_INFO(1) NetBSD General Commands Manual PKG_INFO(1)
2 2
3NNAAMMEE 3NNAAMMEE
4 ppkkgg__iinnffoo -- a utility for displaying information on software packages 4 ppkkgg__iinnffoo -- a utility for displaying information on software packages
5 5
6SSYYNNOOPPSSIISS 6SSYYNNOOPPSSIISS
7 ppkkgg__iinnffoo [--BBbbccDDddFFffhhIIiikkLLmmNNnnppqqRRSSssVVvvXX] [--ee _p_a_c_k_a_g_e] [--EE _p_a_c_k_a_g_e] 7 ppkkgg__iinnffoo [--BBbbccDDddFFffhhIIiikkLLmmNNnnppqqrrRRSSssVVvvXX] [--ee _p_a_c_k_a_g_e] [--EE _p_a_c_k_a_g_e]
8 [--KK _p_k_g___d_b_d_i_r] [--ll _p_r_e_f_i_x] _p_k_g_-_n_a_m_e _._._. 8 [--KK _p_k_g___d_b_d_i_r] [--ll _p_r_e_f_i_x] _p_k_g_-_n_a_m_e _._._.
9 ppkkgg__iinnffoo [--aa | --uu] [flags] 9 ppkkgg__iinnffoo [--aa | --uu] [flags]
10 ppkkgg__iinnffoo [--QQ _v_a_r_i_a_b_l_e] _p_k_g_-_n_a_m_e _._._. 10 ppkkgg__iinnffoo [--QQ _v_a_r_i_a_b_l_e] _p_k_g_-_n_a_m_e _._._.
11 11
12DDEESSCCRRIIPPTTIIOONN 12DDEESSCCRRIIPPTTIIOONN
13 The ppkkgg__iinnffoo command is used to dump out information for packages, which 13 The ppkkgg__iinnffoo command is used to dump out information for packages, which
14 may be either packed up in files or already installed on the system with 14 may be either packed up in files or already installed on the system with
15 the pkg_create(1) command. 15 the pkg_create(1) command.
16 16
17 The _p_k_g_-_n_a_m_e may be the name of an installed package (with our without 17 The _p_k_g_-_n_a_m_e may be the name of an installed package (with our without
18 version), a pattern matching several installed packages (see the _P_A_C_K_A_G_E 18 version), a pattern matching several installed packages (see the _P_A_C_K_A_G_E
19 _W_I_L_D_C_A_R_D_S section for a description of possible patterns), the pathname 19 _W_I_L_D_C_A_R_D_S section for a description of possible patterns), the pathname
20 to a binary package, a filename belonging to an installed package (if --FF 20 to a binary package, a filename belonging to an installed package (if --FF
@@ -97,26 +97,28 @@ DDEESSCCRRIIPPTTIIOONN @@ -97,26 +97,28 @@ DDEESSCCRRIIPPTTIIOONN
97 --nn Show which packages each package needs (depends upon), if any. 97 --nn Show which packages each package needs (depends upon), if any.
98 98
99 --pp Show the installation prefix for each package. 99 --pp Show the installation prefix for each package.
100 100
101 --QQ Show the definition of _v_a_r_i_a_b_l_e from the build information for 101 --QQ Show the definition of _v_a_r_i_a_b_l_e from the build information for
102 each package. An empty string is returned if no such variable 102 each package. An empty string is returned if no such variable
103 definition is found for the package(s). 103 definition is found for the package(s).
104 104
105 --qq Be ``quiet'' in emitting report headers and such, just dump the 105 --qq Be ``quiet'' in emitting report headers and such, just dump the
106 raw info (basically, assume a non-human reading). 106 raw info (basically, assume a non-human reading).
107 107
108 --RR For each package, show the packages that require it. 108 --RR For each package, show the packages that require it.
109 109
 110 --rr For each package, recursively show the packages that require it.
 111
110 --SS Show the size of this package and all the packages it requires, 112 --SS Show the size of this package and all the packages it requires,
111 in bytes. 113 in bytes.
112 114
113 --ss Show the size of this package in bytes. The size is calculated 115 --ss Show the size of this package in bytes. The size is calculated
114 by adding up the size of each file of the package. 116 by adding up the size of each file of the package.
115 117
116 --uu Show information for all user-installed packages. Automatically 118 --uu Show information for all user-installed packages. Automatically
117 installed packages (as dependencies of other packages) are not 119 installed packages (as dependencies of other packages) are not
118 displayed. See also --aa. 120 displayed. See also --aa.
119 121
120 --VV Print version number and exit. 122 --VV Print version number and exit.
121 123
122 --vv Turn on verbose output. 124 --vv Turn on verbose output.
@@ -174,14 +176,14 @@ EENNVVIIRROONNMMEENNTT @@ -174,14 +176,14 @@ EENNVVIIRROONNMMEENNTT
174SSEEEE AALLSSOO 176SSEEEE AALLSSOO
175 pkg_add(1), pkg_admin(1), pkg_create(1), pkg_delete(1), mktemp(3), 177 pkg_add(1), pkg_admin(1), pkg_create(1), pkg_delete(1), mktemp(3),
176 pkgsrc(7), mtree(8) 178 pkgsrc(7), mtree(8)
177 179
178AAUUTTHHOORRSS 180AAUUTTHHOORRSS
179 Jordan Hubbard 181 Jordan Hubbard
180 most of the work 182 most of the work
181 John Kohl 183 John Kohl
182 refined it for NetBSD 184 refined it for NetBSD
183 Hubert Feyrer 185 Hubert Feyrer
184 NetBSD wildcard dependency processing, pkgdb, depends displaying, 186 NetBSD wildcard dependency processing, pkgdb, depends displaying,
185 pkg size display etc. 187 pkg size display etc.
186 188
187NetBSD 5.0 February 27, 2009 NetBSD 5.0 189NetBSD 5.0 March 2, 2009 NetBSD 5.0

cvs diff -r1.116 -r1.117 pkgsrc/pkgtools/pkg_install/files/lib/version.h (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/files/lib/version.h 2009/03/02 14:59:14 1.116
+++ pkgsrc/pkgtools/pkg_install/files/lib/version.h 2009/03/02 17:13:49 1.117
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: version.h,v 1.116 2009/03/02 14:59:14 joerg Exp $ */ 1/* $NetBSD: version.h,v 1.117 2009/03/02 17:13:49 joerg Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001 Thomas Klausner. All rights reserved. 4 * Copyright (c) 2001 Thomas Klausner. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -17,16 +17,16 @@ @@ -17,16 +17,16 @@
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27#ifndef _INST_LIB_VERSION_H_ 27#ifndef _INST_LIB_VERSION_H_
28#define _INST_LIB_VERSION_H_ 28#define _INST_LIB_VERSION_H_
29 29
30#define PKGTOOLS_VERSION "20090301" 30#define PKGTOOLS_VERSION "20090302"
31 31
32#endif /* _INST_LIB_VERSION_H_ */ 32#endif /* _INST_LIB_VERSION_H_ */