Set BATCH and PACKAGE_BUILDING to environment before exec()ing pkg_add

in order to suppress onwonted package interaction.

Submitted by:   steve
This commit is contained in:
Jordan K. Hubbard 2000-11-10 09:34:06 +00:00
parent e828ada709
commit 3a335eb7a7
2 changed files with 10 additions and 0 deletions

View file

@ -174,6 +174,11 @@ package_extract(Device *dev, char *name, Boolean depended)
close(2);
}
close(pfd[1]);
/* Prevent pkg_add from wanting to interact in bad ways */
setenv("PACKAGE_BUILDING", "t", 1);
setenv("BATCH", "t", 1);
if (isDebug())
i = execl("/usr/sbin/pkg_add", "/usr/sbin/pkg_add", "-v", "-", 0);
else

View file

@ -174,6 +174,11 @@ package_extract(Device *dev, char *name, Boolean depended)
close(2);
}
close(pfd[1]);
/* Prevent pkg_add from wanting to interact in bad ways */
setenv("PACKAGE_BUILDING", "t", 1);
setenv("BATCH", "t", 1);
if (isDebug())
i = execl("/usr/sbin/pkg_add", "/usr/sbin/pkg_add", "-v", "-", 0);
else