summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/lib
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1993-09-03 23:01:17 +0000
committerjkh <jkh@FreeBSD.org>1993-09-03 23:01:17 +0000
commita1623ebed998f464514c6eafa426c4efeba768ec (patch)
tree33f2e2fff1fe01fa5806a718ba345fc9ec5b3485 /usr.sbin/pkg_install/lib
parent3e9396c56d8617662d9ee7af612df9381888e538 (diff)
downloadFreeBSD-src-a1623ebed998f464514c6eafa426c4efeba768ec.zip
FreeBSD-src-a1623ebed998f464514c6eafa426c4efeba768ec.tar.gz
Lots of misc tweaks, support for arbitrary separators in pkg_info, more
intelligent name handling in pkg_create. Most of these files are changed because of rcsid's being different in my cvs tree and freefall's (foo).
Diffstat (limited to 'usr.sbin/pkg_install/lib')
-rw-r--r--usr.sbin/pkg_install/lib/Makefile1
-rw-r--r--usr.sbin/pkg_install/lib/exec.c2
-rw-r--r--usr.sbin/pkg_install/lib/file.c2
-rw-r--r--usr.sbin/pkg_install/lib/lib.h6
-rw-r--r--usr.sbin/pkg_install/lib/msg.c2
-rw-r--r--usr.sbin/pkg_install/lib/pen.c2
-rw-r--r--usr.sbin/pkg_install/lib/plist.c40
7 files changed, 46 insertions, 9 deletions
diff --git a/usr.sbin/pkg_install/lib/Makefile b/usr.sbin/pkg_install/lib/Makefile
index d520df5..1f802f6 100644
--- a/usr.sbin/pkg_install/lib/Makefile
+++ b/usr.sbin/pkg_install/lib/Makefile
@@ -1,5 +1,6 @@
LIB= install
SRCS= file.c msg.c plist.c str.c exec.c global.c pen.c
+CFLAGS+= ${DEBUG}
NOPROFILE= yes
install:
diff --git a/usr.sbin/pkg_install/lib/exec.c b/usr.sbin/pkg_install/lib/exec.c
index 6f1a672..5232dd2 100644
--- a/usr.sbin/pkg_install/lib/exec.c
+++ b/usr.sbin/pkg_install/lib/exec.c
@@ -1,5 +1,5 @@
#ifndef lint
-static const char *rcsid = "$Id: exec.c,v 1.3 1993/08/24 09:24:04 jkh Exp $";
+static const char *rcsid = "$Id: exec.c,v 1.4 1993/09/04 05:06:47 jkh Exp $";
#endif
/*
diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c
index ac7e4d7..9c86151 100644
--- a/usr.sbin/pkg_install/lib/file.c
+++ b/usr.sbin/pkg_install/lib/file.c
@@ -1,5 +1,5 @@
#ifndef lint
-static const char *rcsid = "$Id: file.c,v 1.5 1993/08/26 08:13:48 jkh Exp $";
+static const char *rcsid = "$Id: file.c,v 1.6 1993/09/04 05:06:48 jkh Exp $";
#endif
/*
diff --git a/usr.sbin/pkg_install/lib/lib.h b/usr.sbin/pkg_install/lib/lib.h
index 05d43e7..8c49933 100644
--- a/usr.sbin/pkg_install/lib/lib.h
+++ b/usr.sbin/pkg_install/lib/lib.h
@@ -1,4 +1,4 @@
-/* $Id: lib.h,v 1.4 1993/08/24 09:24:07 jkh Exp $ */
+/* $Id: lib.h,v 1.5 1993/09/04 05:06:49 jkh Exp $ */
/*
* FreeBSD install - a package for the installation and maintainance
@@ -123,10 +123,12 @@ Boolean y_or_n(Boolean, const char *, ...);
/* Packing list */
PackingList new_plist_entry(void);
PackingList last_plist(Package *);
+Boolean in_plist(Package *, plist_t);
void free_plist(Package *);
void mark_plist(Package *);
void csum_plist_entry(char *, PackingList);
-void add_plist(Package *, int, char *);
+void add_plist(Package *, plist_t, char *);
+void add_plist_top(Package *, plist_t, char *);
void write_plist(Package *, FILE *);
void read_plist(Package *, FILE *);
int plist_cmd(char *, char **);
diff --git a/usr.sbin/pkg_install/lib/msg.c b/usr.sbin/pkg_install/lib/msg.c
index 4c74290..489fc47 100644
--- a/usr.sbin/pkg_install/lib/msg.c
+++ b/usr.sbin/pkg_install/lib/msg.c
@@ -1,5 +1,5 @@
#ifndef lint
-static const char *rcsid = "$Id: msg.c,v 1.2 1993/08/16 14:20:18 jkh Exp $";
+static const char *rcsid = "$Id: msg.c,v 1.3 1993/09/04 05:06:50 jkh Exp $";
#endif
/*
diff --git a/usr.sbin/pkg_install/lib/pen.c b/usr.sbin/pkg_install/lib/pen.c
index 8a3416f..c5eee71 100644
--- a/usr.sbin/pkg_install/lib/pen.c
+++ b/usr.sbin/pkg_install/lib/pen.c
@@ -1,5 +1,5 @@
#ifndef lint
-static const char *rcsid = "$Id: pen.c,v 1.1 1993/08/24 09:24:08 jkh Exp $";
+static const char *rcsid = "$Id: pen.c,v 1.2 1993/09/04 05:06:51 jkh Exp $";
#endif
/*
diff --git a/usr.sbin/pkg_install/lib/plist.c b/usr.sbin/pkg_install/lib/plist.c
index f2992c6..cd8ae24 100644
--- a/usr.sbin/pkg_install/lib/plist.c
+++ b/usr.sbin/pkg_install/lib/plist.c
@@ -1,5 +1,5 @@
#ifndef lint
-static const char *rcsid = "$Id: plist.c,v 1.5 1993/08/26 08:13:49 jkh Exp $";
+static const char *rcsid = "$Id: plist.c,v 1.6 1993/09/04 05:06:52 jkh Exp $";
#endif
/*
@@ -26,7 +26,7 @@ static const char *rcsid = "$Id: plist.c,v 1.5 1993/08/26 08:13:49 jkh Exp $";
/* Add an item to a packing list */
void
-add_plist(Package *p, int type, char *arg)
+add_plist(Package *p, plist_t type, char *arg)
{
PackingList tmp;
@@ -43,6 +43,24 @@ add_plist(Package *p, int type, char *arg)
}
}
+void
+add_plist_top(Package *p, plist_t type, char *arg)
+{
+ PackingList tmp;
+
+ tmp = new_plist_entry();
+ tmp->name = copy_string(arg);
+ tmp->type = type;
+
+ if (!p->head)
+ p->head = p->tail = tmp;
+ else {
+ tmp->next = p->head;
+ p->head->prev = tmp;
+ p->head = tmp;
+ }
+}
+
/* Return the last (most recent) entry in a packing list */
PackingList
last_plist(Package *p)
@@ -62,6 +80,20 @@ mark_plist(Package *pkg)
}
}
+/* Return whether or not there is an item of 'type' in the list */
+Boolean
+in_plist(Package *pkg, plist_t type)
+{
+ PackingList p = pkg->head;
+
+ while (p) {
+ if (p->type == type)
+ return TRUE;
+ p = p->next;
+ }
+ return FALSE;
+}
+
/* Allocate a new packing list entry */
PackingList
new_plist_entry(void)
@@ -116,6 +148,8 @@ plist_cmd(char *s, char **arg)
*arg = sp;
if (!strcmp(cmd, "cwd"))
return PLIST_CWD;
+ else if (!strcmp(cmd, "cd"))
+ return PLIST_CWD;
else if (!strcmp(cmd, "exec"))
return PLIST_CMD;
else if (!strcmp(cmd, "mode"))
@@ -226,7 +260,7 @@ delete_package(Boolean ign_err, Package *pkg)
if (p->type == PLIST_CWD) {
Where = p->name;
if (Verbose)
- printf("Delete: (CWD to %s)\n", Where);
+ printf("(CWD to %s)\n", Where);
}
else if (p->type == PLIST_IGNORE)
p = p->next;
OpenPOWER on IntegriCloud