diff options
| author | hubertf <hubertf@NetBSD.org> | 2002-02-18 00:57:54 +0000 |
|---|---|---|
| committer | hubertf <hubertf@NetBSD.org> | 2002-02-18 00:57:54 +0000 |
| commit | 5ce6294f7bbabdf445cdb2dfef20d8001e3e9739 (patch) | |
| tree | e6847b79bbdae09fd075f73247c6a8c2a9bd94d0 /usr.sbin/pkg_install/create | |
| parent | 0b349f0680a1e310c0b3c09ba7a06883d1b04252 (diff) | |
make @cwd work a bit more reliable:
When -L is used (as it is by pkgsrc), don't override the directory
set by @cwd unconditionally with what was given to -L (srcdir).
Instead, use the @cwd directory.
XXX#1: This was not tested with DESTDIR set
XXX#2: @cwd is still needed twice
Diffstat (limited to 'usr.sbin/pkg_install/create')
| -rw-r--r-- | usr.sbin/pkg_install/create/pl.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/usr.sbin/pkg_install/create/pl.c b/usr.sbin/pkg_install/create/pl.c index 5d36600d8f5..6e7663d1924 100644 --- a/usr.sbin/pkg_install/create/pl.c +++ b/usr.sbin/pkg_install/create/pl.c @@ -1,11 +1,11 @@ -/* $NetBSD: pl.c,v 1.21 2001/05/21 12:05:20 agc Exp $ */ +/* $NetBSD: pl.c,v 1.22 2002/02/18 00:57:54 hubertf Exp $ */ #include <sys/cdefs.h> #ifndef lint #if 0 static const char *rcsid = "from FreeBSD Id: pl.c,v 1.11 1997/10/08 07:46:35 charnier Exp"; #else -__RCSID("$NetBSD: pl.c,v 1.21 2001/05/21 12:05:20 agc Exp $"); +__RCSID("$NetBSD: pl.c,v 1.22 2002/02/18 00:57:54 hubertf Exp $"); #endif #endif @@ -166,7 +166,14 @@ check_list(char *home, package_t *pkg, const char *PkgName) } } - (void) snprintf(name, sizeof(name), "%s/%s", srcdir ? srcdir : cwd, p->name); + if (cwd == home) { + /* no @cwd yet */ + (void) snprintf(name, sizeof(name), "%s/%s", srcdir ? srcdir : cwd, p->name); + } else { + /* after @cwd */ + /* prepend DESTDIR if set? - HF */ + (void) snprintf(name, sizeof(name), "%s/%s", cwd, p->name); + } if (lstat(name, &st) < 0) { warnx("can't stat `%s'", name); continue; |
