o Set paths internally for pkg_add for tools we might want to invoke.

o Fix bogus suffix handling.
o Tell user when an FTP url is being xferred rather than being silent.
  This sort of violates "the unix way" but it stops people from whacking
  ^C when they think it's hung, too.  Sometimes visual indication of
  success is important.  Doesn't spit out anything if not on a TTY.
This commit is contained in:
Jordan K. Hubbard 1998-09-08 10:42:26 +00:00
parent 9df3bd9208
commit 8c26c30381
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=38942
3 changed files with 16 additions and 12 deletions

View File

@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
"$Id: main.c,v 1.15 1997/09/18 14:08:27 phk Exp $";
"$Id: main.c,v 1.16 1997/10/08 07:45:43 charnier Exp $";
#endif
/*
@ -133,11 +133,16 @@ main(int argc, char **argv)
}
}
/* If no packages, yelp */
else if (!ch)
warnx("missing package name(s)"), usage();
else if (ch > 1 && AddMode == MASTER)
warnx("only one package name may be specified with master mode"),
else if (!ch) {
warnx("missing package name(s)");
usage();
}
else if (ch > 1 && AddMode == MASTER) {
warnx("only one package name may be specified with master mode");
usage();
}
/* Make sure the sub-execs we invoke get found */
setenv("PATH", "/sbin:/usr/sbin:/bin:/usr/bin", 1);
if ((err = pkg_perform(pkgs)) != 0) {
if (Verbose)
warnx("%d package addition(s) failed", err);

View File

@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
"$Id: perform.c,v 1.42 1998/07/28 11:55:39 jkh Exp $";
"$Id: perform.c,v 1.43 1998/09/08 03:15:41 jkh Exp $";
#endif
/*
@ -44,7 +44,6 @@ pkg_perform(char **pkgs)
char *cp;
FILE *pkg_in, *fp;
Package plist;
char *suffix; /* What we tack on to the end of the finished package */
int len;
/* Preliminary setup */

View File

@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
"$Id: file.c,v 1.29 1997/10/08 07:47:54 charnier Exp $";
"$Id: file.c,v 1.30 1997/10/18 05:54:17 jkh Exp $";
#endif
/*
@ -247,14 +247,12 @@ fileGetURL(char *base, char *spec)
gethostname(me, HOSTNAME_MAX);
snprintf(pword, HOSTNAME_MAX + 40, "%s@%s", pw->pw_name, me);
}
if (Verbose)
printf("Trying to fetch %s.\n", fname);
ftp = ftpGetURL(fname, uname, pword, &status);
if (ftp) {
if (isatty(0) || Verbose)
printf("Fetching %s...", fname), fflush(stdout);
pen[0] = '\0';
if ((rp = make_playpen(pen, 0)) != NULL) {
if (Verbose)
printf("Extracting from FTP connection into %s\n", pen);
tpid = fork();
if (!tpid) {
dup2(fileno(ftp), 0);
@ -273,6 +271,8 @@ fileGetURL(char *base, char *spec)
else
printf("Error: Unable to construct a new playpen for FTP!\n");
fclose(ftp);
if (rp && (isatty(0) || Verbose))
printf(" Done.\n");
}
else
printf("Error: FTP Unable to get %s: %s\n",