summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1994-05-25 06:24:18 +0000
committerjkh <jkh@FreeBSD.org>1994-05-25 06:24:18 +0000
commit873ef098bd733fcb71e41acf4d9fd14c968ae456 (patch)
treeea1b7e6a12dbf1f60491b43be9dc7e2b231481b9 /usr.sbin/pkg_install
parent6ec6244718eeb5e83a5b0fa6b8ae2292c9386ee8 (diff)
downloadFreeBSD-src-873ef098bd733fcb71e41acf4d9fd14c968ae456.zip
FreeBSD-src-873ef098bd733fcb71e41acf4d9fd14c968ae456.tar.gz
Remove find_name(), replace with more generic find_plist() function.
Diffstat (limited to 'usr.sbin/pkg_install')
-rw-r--r--usr.sbin/pkg_install/add/perform.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c
index 5029690..34f3da0 100644
--- a/usr.sbin/pkg_install/add/perform.c
+++ b/usr.sbin/pkg_install/add/perform.c
@@ -1,5 +1,5 @@
#ifndef lint
-static const char *rcsid = "$Id: perform.c,v 1.5 1993/10/08 01:19:28 jkh Exp $";
+static const char *rcsid = "$Id: perform.c,v 1.6 1993/10/10 20:25:31 jkh Exp $";
#endif
/*
@@ -28,7 +28,6 @@ static const char *rcsid = "$Id: perform.c,v 1.5 1993/10/08 01:19:28 jkh Exp $";
#include <signal.h>
static int pkg_do(char *);
-static char *find_name(Package *);
static int sanity_check(char *);
static char LogDir[FILENAME_MAX];
@@ -60,6 +59,7 @@ pkg_do(char *pkg)
FILE *cfile;
char *home;
int code = 0;
+ PackingList p;
/* Reset some state */
if (Plist.head)
@@ -118,7 +118,7 @@ pkg_do(char *pkg)
return 0;
}
}
- PkgName = find_name(&Plist);
+ PkgName = (p = find_plist(&Plist, PLIST_NAME)) ? p->name : "anonymous";
if (fexists(REQUIRE_FNAME)) {
vsystem("chmod +x %s", REQUIRE_FNAME); /* be sure */
if (Verbose)
@@ -220,19 +220,6 @@ sanity_check(char *pkg)
return 0;
}
-static char *
-find_name(Package *pkg)
-{
- PackingList p = pkg->head;
-
- while (p) {
- if (p->type == PLIST_NAME)
- return p->name;
- p = p->next;
- }
- return "anonymous";
-}
-
void
cleanup(int signo)
{
OpenPOWER on IntegriCloud