Deleted Added
sdiff udiff text old ( 112572 ) new ( 131275 )
full compact
1/*
2 * FreeBSD install - a package for the installation and maintainance
3 * of non-core utilities.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 5 unchanged lines hidden (view full) ---

14 * Jordan K. Hubbard
15 * 23 Aug 1993
16 *
17 * This is the main body of the info module.
18 *
19 */
20
21#include <sys/cdefs.h>
22__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/info/perform.c 112572 2003-03-25 00:51:41Z mdodd $");
23
24#include "lib.h"
25#include "info.h"
26#include <err.h>
27#include <signal.h>
28
29static int pkg_do(char *);
30static int find_pkg(struct which_head *);
31static int cmp_path(const char *, const char *, const char *);
32static char *abspath(const char *);
33static int find_pkgs_by_origin(const char *);
34
35int
36pkg_perform(char **pkgs)
37{
38 char **matched;
39 int err_cnt = 0;
40 int i, errcode;
41
42 signal(SIGINT, cleanup);
43
44 /* Overriding action? */
45 if (CheckPkg) {
46 return isinstalledpkg(CheckPkg) == TRUE ? 0 : 1;
47 /* Not reached */
48 } else if (!TAILQ_EMPTY(whead)) {
49 return find_pkg(whead);
50 } else if (LookUpOrigin != NULL) {
51 return find_pkgs_by_origin(LookUpOrigin);
52 }
53

--- 8 unchanged lines hidden (view full) ---

62 else switch (MatchType) {
63 case MATCH_GLOB:
64 break;
65 case MATCH_ALL:
66 warnx("no packages installed");
67 return 0;
68 /* Not reached */
69 case MATCH_REGEX:
70 warnx("no packages match pattern(s)");
71 return 1;
72 /* Not reached */
73 default:
74 break;
75 }
76 }
77

--- 368 unchanged lines hidden (view full) ---

446 if (matched == NULL)
447 return errcode;
448
449 for (i = 0; matched[i] != NULL; i++)
450 puts(matched[i]);
451
452 return 0;
453}