main.c (201226) | main.c (207113) |
---|---|
1/* 2 * 3 * FreeBSD install - a package for the installation and maintainance 4 * of non-core utilities. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 6 unchanged lines hidden (view full) --- 15 * Jordan K. Hubbard 16 * 18 July 1993 17 * 18 * This is the info module. 19 * 20 */ 21 22#include <sys/cdefs.h> | 1/* 2 * 3 * FreeBSD install - a package for the installation and maintainance 4 * of non-core utilities. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 6 unchanged lines hidden (view full) --- 15 * Jordan K. Hubbard 16 * 18 July 1993 17 * 18 * This is the info module. 19 * 20 */ 21 22#include <sys/cdefs.h> |
23__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/info/main.c 201226 2009-12-29 22:33:53Z ed $"); | 23__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/info/main.c 207113 2010-04-23 11:07:43Z flz $"); |
24 25#include <getopt.h> 26#include <err.h> 27 | 24 25#include <getopt.h> 26#include <err.h> 27 |
28#include "lib.h" | 28#include <pkg.h> |
29#include "info.h" 30 31int Flags = 0; 32match_t MatchType = MATCH_GLOB; 33Boolean QUIET = FALSE; 34Boolean UseBlkSz = FALSE; 35char *InfoPrefix = (char *)(uintptr_t)""; 36char PlayPen[FILENAME_MAX]; --- 26 unchanged lines hidden (view full) --- 63 64int 65main(int argc, char **argv) 66{ 67 int ch; 68 char **pkgs, **start; 69 char *pkgs_split; 70 | 29#include "info.h" 30 31int Flags = 0; 32match_t MatchType = MATCH_GLOB; 33Boolean QUIET = FALSE; 34Boolean UseBlkSz = FALSE; 35char *InfoPrefix = (char *)(uintptr_t)""; 36char PlayPen[FILENAME_MAX]; --- 26 unchanged lines hidden (view full) --- 63 64int 65main(int argc, char **argv) 66{ 67 int ch; 68 char **pkgs, **start; 69 char *pkgs_split; 70 |
71 pkg_wrap(PKG_INSTALL_VERSION, argv); 72 |
|
71 whead = malloc(sizeof(struct which_head)); 72 if (whead == NULL) 73 err(2, NULL); 74 TAILQ_INIT(whead); 75 76 pkgs = start = argv; 77 if (argc == 1) { 78 MatchType = MATCH_ALL; --- 141 unchanged lines hidden (view full) --- 220 221 strlcpy(entp->file, optarg, PATH_MAX); 222 entp->skip = FALSE; 223 TAILQ_INSERT_TAIL(whead, entp, next); 224 break; 225 } 226 227 case 'P': | 73 whead = malloc(sizeof(struct which_head)); 74 if (whead == NULL) 75 err(2, NULL); 76 TAILQ_INIT(whead); 77 78 pkgs = start = argv; 79 if (argc == 1) { 80 MatchType = MATCH_ALL; --- 141 unchanged lines hidden (view full) --- 222 223 strlcpy(entp->file, optarg, PATH_MAX); 224 entp->skip = FALSE; 225 TAILQ_INSERT_TAIL(whead, entp, next); 226 break; 227 } 228 229 case 'P': |
228 Flags = SHOW_PTREV; | 230 if (Flags & SHOW_PTREV) 231 Flags |= SHOW_LPREV; 232 else 233 Flags = SHOW_PTREV; |
229 break; 230 231 case 'h': 232 default: 233 usage(); 234 break; 235 } 236 } 237 238 argc -= optind; 239 argv += optind; 240 241 if (Flags & SHOW_PTREV) { 242 if (!Quiet) 243 printf("Package tools revision: "); 244 printf("%d\n", PKG_INSTALL_VERSION); | 234 break; 235 236 case 'h': 237 default: 238 usage(); 239 break; 240 } 241 } 242 243 argc -= optind; 244 argv += optind; 245 246 if (Flags & SHOW_PTREV) { 247 if (!Quiet) 248 printf("Package tools revision: "); 249 printf("%d\n", PKG_INSTALL_VERSION); |
250 if (Flags & SHOW_LPREV) { 251 if (!Quiet) 252 printf("Libpkg revision: "); 253 printf("%d\n", libpkg_version()); 254 } |
|
245 exit(0); 246 } 247 248 /* Set some reasonable defaults */ 249 if (!Flags) 250 Flags = SHOW_COMMENT | SHOW_DESC | SHOW_REQBY; 251 252 /* Get all the remaining package names, if any */ --- 42 unchanged lines hidden --- | 255 exit(0); 256 } 257 258 /* Set some reasonable defaults */ 259 if (!Flags) 260 Flags = SHOW_COMMENT | SHOW_DESC | SHOW_REQBY; 261 262 /* Get all the remaining package names, if any */ --- 42 unchanged lines hidden --- |