diff options
author | hubertf <hubertf> | 2005-07-25 13:03:59 +0000 |
---|---|---|
committer | hubertf <hubertf> | 2005-07-25 13:03:59 +0000 |
commit | e7bd55e254582a59cda4e755dd535629500155f3 (patch) | |
tree | e12f099db57ef45d3830f3356107cc454540d27f /pkgtools | |
parent | 2f953c9eb5c03ba069f94fcaf4e82a8d8ee1dc5d (diff) | |
download | pkgsrc-e7bd55e254582a59cda4e755dd535629500155f3.tar.gz |
Pull over this change from src/usr.sbin/pkg_install (-current):
| Modified Files:
| src/usr.sbin/pkg_install/add: extract.c
|
| Log Message:
| Fix 'pkg_add -R' handling - not registering really means not touching
| the pkgdb too - useful for pkg_add as non-root!
|
|
| To generate a diff of this commit:
| cvs rdiff -r1.34 -r1.35 src/usr.sbin/pkg_install/add/extract.c
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkg_install/files/add/extract.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/pkgtools/pkg_install/files/add/extract.c b/pkgtools/pkg_install/files/add/extract.c index cfda0951c78..e9d1030a459 100644 --- a/pkgtools/pkg_install/files/add/extract.c +++ b/pkgtools/pkg_install/files/add/extract.c @@ -1,4 +1,4 @@ -/* $NetBSD: extract.c,v 1.11 2005/01/07 11:58:12 agc Exp $ */ +/* $NetBSD: extract.c,v 1.12 2005/07/25 13:03:59 hubertf Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -11,7 +11,7 @@ #if 0 static const char *rcsid = "FreeBSD - Id: extract.c,v 1.17 1997/10/08 07:45:35 charnier Exp"; #else -__RCSID("$NetBSD: extract.c,v 1.11 2005/01/07 11:58:12 agc Exp $"); +__RCSID("$NetBSD: extract.c,v 1.12 2005/07/25 13:03:59 hubertf Exp $"); #endif #endif @@ -152,10 +152,12 @@ extract_plist(char *home, package_t *pkg) last_file = NULL; Directory = home; - /* Open Package Database for writing */ - if (!pkgdb_open(ReadWrite)) { - cleanup(0); - err(EXIT_FAILURE, "can't open pkgdb"); + if (!NoRecord) { + /* Open Package Database for writing */ + if (!pkgdb_open(ReadWrite)) { + cleanup(0); + err(EXIT_FAILURE, "can't open pkgdb"); + } } /* Do it */ while (p) { @@ -203,8 +205,8 @@ extract_plist(char *home, package_t *pkg) } } if (rename(p->name, try) == 0) { - /* note in pkgdb */ - { + if (!NoRecord) { + /* note in pkgdb */ char *s, t[MaxPathSize]; int rc; @@ -261,11 +263,12 @@ extract_plist(char *home, package_t *pkg) } perm_count += add_count; - /* note in pkgdb */ - /* XXX would be better to store in PUSHOUT, but - * that would probably affect too much code I prefer - * not to touch - HF */ - { + if (!NoRecord) { + /* note in pkgdb */ + /* XXX would be better to store in PUSHOUT, but + * that would probably affect too much code I prefer + * not to touch - HF */ + char *s, t[MaxPathSize], *u; int rc; @@ -343,7 +346,8 @@ extract_plist(char *home, package_t *pkg) p = p->next; } PUSHOUT(Directory); - pkgdb_close(); + if (!NoRecord) + pkgdb_close(); free(perm_args); free(where_args); return 1; |