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
This commit is contained in:
hubertf 2002-02-18 00:57:54 +00:00
parent 0b349f0680
commit 5ce6294f7b
1 changed files with 10 additions and 3 deletions

View File

@ -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;