diff options
author | jkh <jkh@FreeBSD.org> | 1994-08-28 14:15:30 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1994-08-28 14:15:30 +0000 |
commit | d34ba06ad506ce152fbe25a08e57a24665577d3a (patch) | |
tree | de0899877d025a04d6af82502669e32e43fd0dd4 | |
parent | 33e047d3b0c9cdbbe20730ae94cfa32d6de3a75a (diff) | |
download | FreeBSD-src-d34ba06ad506ce152fbe25a08e57a24665577d3a.zip FreeBSD-src-d34ba06ad506ce152fbe25a08e57a24665577d3a.tar.gz |
Add @srcdir option for customizing creation of packages.
Submitted by: jkh
-rw-r--r-- | usr.sbin/pkg_install/create/pkg_create.1 | 7 | ||||
-rw-r--r-- | usr.sbin/pkg_install/create/pl.c | 6 | ||||
-rw-r--r-- | usr.sbin/pkg_install/lib/lib.h | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_install/lib/plist.c | 8 |
4 files changed, 21 insertions, 4 deletions
diff --git a/usr.sbin/pkg_install/create/pkg_create.1 b/usr.sbin/pkg_install/create/pkg_create.1 index 67df84d..c11eae4 100644 --- a/usr.sbin/pkg_install/create/pkg_create.1 +++ b/usr.sbin/pkg_install/create/pkg_create.1 @@ -164,6 +164,13 @@ Note: .BI @cd is also an alias for this command. .TP +.BI "@srcdir\ " directory +Sets the internal directory pointer for _creation only_ to +.I directory. +That is to say that it overrides +.I @cwd +for package creation but not extraction. +.TP .BI "@exec\ " command Execute .I command diff --git a/usr.sbin/pkg_install/create/pl.c b/usr.sbin/pkg_install/create/pl.c index e1b6e36..65358ac 100644 --- a/usr.sbin/pkg_install/create/pl.c +++ b/usr.sbin/pkg_install/create/pl.c @@ -1,5 +1,5 @@ #ifndef lint -static const char *rcsid = "$Id: pl.c,v 1.5 1993/09/04 05:06:34 jkh Exp $"; +static const char *rcsid = "$Id: pl.c,v 1.2 1993/09/03 23:00:57 jkh Exp $"; #endif /* @@ -47,6 +47,8 @@ check_list(char *home, Package *pkg) where = p->name; else if (p->type == PLIST_IGNORE) p = p->next; + else if (p->type == PLIST_SRC) + where = p->name; else if (p->type == PLIST_FILE) { cmd[0] = '\0'; sprintf(name, "%s/%s", where, p->name); @@ -84,6 +86,8 @@ copy_plist(char *home, Package *plist) while (p) { if (p->type == PLIST_CWD) where = p->name; + else if (p->type == PLIST_SRC) + where = p->name; else if (p->type == PLIST_IGNORE) p = p->next; else if (p->type == PLIST_FILE && !p->marked) { diff --git a/usr.sbin/pkg_install/lib/lib.h b/usr.sbin/pkg_install/lib/lib.h index 54e8251..4f34569 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.6 1994/05/25 06:27:23 jkh Exp $ */ +/* $Id: lib.h,v 1.7 1994/05/25 18:00:04 asami Exp $ */ /* * FreeBSD install - a package for the installation and maintainance @@ -75,7 +75,7 @@ enum _plist_t { PLIST_FILE, PLIST_CWD, PLIST_CMD, PLIST_CHMOD, PLIST_CHOWN, PLIST_CHGRP, PLIST_COMMENT, - PLIST_IGNORE, PLIST_NAME, PLIST_UNEXEC + PLIST_IGNORE, PLIST_NAME, PLIST_UNEXEC, PLIST_SRC }; typedef enum _plist_t plist_t; diff --git a/usr.sbin/pkg_install/lib/plist.c b/usr.sbin/pkg_install/lib/plist.c index a0a2fa5..d2708fd 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.6 1994/05/25 06:27:24 jkh Exp $"; +static const char *rcsid = "$Id: plist.c,v 1.7 1994/07/11 01:11:14 jkh Exp $"; #endif /* @@ -180,6 +180,8 @@ plist_cmd(char *s, char **arg) *arg = sp; if (!strcmp(cmd, "cwd")) return PLIST_CWD; + else if (!strcmp(cmd, "srcdir")) + return PLIST_SRC; else if (!strcmp(cmd, "cd")) return PLIST_CWD; else if (!strcmp(cmd, "exec")) @@ -246,6 +248,10 @@ write_plist(Package *pkg, FILE *fp) fprintf(fp, "%ccwd %s\n", CMD_CHAR, plist->name); break; + case PLIST_SRC: + fprintf(fp, "%csrcdir %s\n", CMD_CHAR, plist->name); + break; + case PLIST_CMD: fprintf(fp, "%cexec %s\n", CMD_CHAR, plist->name); break; |