summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_install
diff options
context:
space:
mode:
authorhubertf <hubertf@NetBSD.org>2000-06-18 01:29:17 +0000
committerhubertf <hubertf@NetBSD.org>2000-06-18 01:29:17 +0000
commit7aed2e5cfbbeaebbe0604f94a376c52fd2c94993 (patch)
tree76f8f5c7c3a530f3cc6818e721f80966099295e8 /usr.sbin/pkg_install
parente7ad3c6044481463a959022e32cced330837ebed (diff)
use /var/tmp consistently. (XXX need to re-visit if we ever
put pkg_add on a install floppy)
Diffstat (limited to 'usr.sbin/pkg_install')
-rw-r--r--usr.sbin/pkg_install/lib/ftpio.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/usr.sbin/pkg_install/lib/ftpio.c b/usr.sbin/pkg_install/lib/ftpio.c
index 0c5ee0acbad..c06fe2c6e92 100644
--- a/usr.sbin/pkg_install/lib/ftpio.c
+++ b/usr.sbin/pkg_install/lib/ftpio.c
@@ -1,8 +1,8 @@
-/* $NetBSD: ftpio.c,v 1.19 2000/06/08 00:26:48 hubertf Exp $ */
+/* $NetBSD: ftpio.c,v 1.20 2000/06/18 01:29:17 hubertf Exp $ */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: ftpio.c,v 1.19 2000/06/08 00:26:48 hubertf Exp $");
+__RCSID("$NetBSD: ftpio.c,v 1.20 2000/06/18 01:29:17 hubertf Exp $");
#endif
/*
@@ -462,7 +462,7 @@ expandURL(char *expandedurl, const char *wildcardurl)
char best[FILENAME_MAX];
int tfd;
- strcpy(tmpname, "/tmp/pkg.XXXXXX");
+ strcpy(tmpname, "/var/tmp/pkg.XXXXXX");
tfd=mkstemp(tmpname);
if (tfd == -1) {
warnx("Cannot generate temp file for ftp(1)'s nlist output");
@@ -520,6 +520,7 @@ expandURL(char *expandedurl, const char *wildcardurl)
* in findmatchingname() */
while (fgets(filename, sizeof(buf), f)) {
filename[strlen(filename)-1] = '\0';
+fprintf(stderr, "HF: pkg='%s', filename='%s'\n", pkg, filename);
if (pmatch(pkg, filename)) {
matches++;
@@ -657,7 +658,7 @@ miscstuff(const char *url)
char cmd[256];
char tmpdir[256];
- (void) snprintf(tmpdir, sizeof(tmpdir), "/tmp/dir%s",
+ (void) snprintf(tmpdir, sizeof(tmpdir), "/var/tmp/dir%s",
(getenv(PKG_FTPIO_CNT))?getenv(PKG_FTPIO_CNT):"");
mkdir(tmpdir, 0755);
@@ -674,7 +675,7 @@ miscstuff(const char *url)
/* check if one more file(s) exist */
if (0) {
char buf[FILENAME_MAX];
- (void) snprintf(buf, sizeof(buf), "nlist %s /tmp/xxx\n", pkg);
+ (void) snprintf(buf, sizeof(buf), "nlist %s /var/tmp/xxx\n", pkg);
rc = ftp_cmd(buf, "\n(226|550).*\n"); /* catch errors */
if (rc != 226) {
if (Verbose)
@@ -689,15 +690,15 @@ miscstuff(const char *url)
return -1;
}
- if (access("/tmp/xxx", R_OK)==0) {
- system("cat /tmp/xxx");
+ if (access("/var/tmp/xxx", R_OK)==0) {
+ system("cat /var/tmp/xxx");
{
/* count lines - >0 -> fexists() == true */
int len, count;
FILE *f;
- f=fopen("/tmp/xxx", "r");
+ f=fopen("/var/tmp/xxx", "r");
if (f == NULL) {
warn("fopen");
return -1;
@@ -712,7 +713,7 @@ miscstuff(const char *url)
} else
printf("NO MATCH\n");
- unlink("/tmp/xxx");
+ unlink("/var/tmp/xxx");
}
/* for a given wildcard URL, find the best matching pkg */