aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1995-05-16 01:30:20 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1995-05-16 01:30:20 +0000
commitaa1478bbd213582e61632d3399b1386c2dc5c293 (patch)
treec2b96d2a0ab0f0767ae99357b4adf7b5cac305ba
parent765b90447edfe51318e76402f65a1c1cf46ee335 (diff)
Notes
-rw-r--r--usr.sbin/pkg_manage/pkg_install.hlp4
-rw-r--r--usr.sbin/pkg_manage/pkg_manage.c5
-rw-r--r--usr.sbin/pkg_manage/pkg_preview_fs.hlp2
-rw-r--r--usr.sbin/pkg_manage/pkg_ui.c64
4 files changed, 58 insertions, 17 deletions
diff --git a/usr.sbin/pkg_manage/pkg_install.hlp b/usr.sbin/pkg_manage/pkg_install.hlp
index af030845f0ac..8a6ba385592e 100644
--- a/usr.sbin/pkg_manage/pkg_install.hlp
+++ b/usr.sbin/pkg_manage/pkg_install.hlp
@@ -16,6 +16,4 @@
<Install marked> button with 'TAB' or 'SHIFT-TAB' and press
'ENTER' to actually install them. Before installation a check
will be made if a selected package is already installed. If so,
- you will be given the choice to delete that package, or skip
- the selected package.
-
+ you will be informed of this and the package will be skipped.
diff --git a/usr.sbin/pkg_manage/pkg_manage.c b/usr.sbin/pkg_manage/pkg_manage.c
index 3a1a0b460a4c..f191a6e1c2a3 100644
--- a/usr.sbin/pkg_manage/pkg_manage.c
+++ b/usr.sbin/pkg_manage/pkg_manage.c
@@ -95,7 +95,7 @@ exec_catch_errors(char *prog, char *arg, char *fout)
* if you don't want output.
*/
{
- char *execstr, *tmp;
+ char *execstr, *tmp, msg[MAXPATHLEN];
int ret, yesno, unlink_fout;
execstr = (char *) malloc( strlen(prog) + strlen(arg) + 30 );
@@ -126,7 +126,8 @@ exec_catch_errors(char *prog, char *arg, char *fout)
/* disable helpline */
tmp = get_helpline();
use_helpline("use arrowkeys, PgUp, PgDn to move, press enter when done");
- dialog_textbox("Error output from pkg_add", fout, LINES-2, COLS-4);
+ sprintf(msg, "Error output from %s", prog);
+ dialog_textbox(msg, fout, LINES-2, COLS-4);
restore_helpline(tmp);
}
}
diff --git a/usr.sbin/pkg_manage/pkg_preview_fs.hlp b/usr.sbin/pkg_manage/pkg_preview_fs.hlp
index 5a7e3fea9743..4777d28cc9d6 100644
--- a/usr.sbin/pkg_manage/pkg_preview_fs.hlp
+++ b/usr.sbin/pkg_manage/pkg_preview_fs.hlp
@@ -5,6 +5,6 @@
Use TAB and SHIFT-TAB to move from field to field.
Selection: contains the name of the selected filename. Edit the field
- directly of choose a filename from the "Files:" box.
+ directly or choose a filename from the "Files:" box.
diff --git a/usr.sbin/pkg_manage/pkg_ui.c b/usr.sbin/pkg_manage/pkg_ui.c
index b612aa546567..8ab6cf23c9b4 100644
--- a/usr.sbin/pkg_manage/pkg_ui.c
+++ b/usr.sbin/pkg_manage/pkg_ui.c
@@ -29,6 +29,19 @@
extern PKG_info p_inf;
+/*
+ * Local prototypes
+ */
+
+void install_pkgs_indir(void);
+
+
+
+/*
+ * Functions
+ */
+
+
void
view_installed(void)
/*
@@ -157,13 +170,14 @@ preview_pkg(void)
int err;
use_helpfile(PREVIEW_FS_HLP);
+ use_helpline("Select package to preview");
fname = dialog_fselect(".", "*.tgz");
while (fname) {
use_helpfile(PREVIEW_HLP);
use_helpline("use PgUp and PgDn and arrow-keys to move through the text");
tmp_file = tempnam(NULL, "pkg.");
if (!tmp_file) {
- fprintf(stderr, "preview_pkg: Could not allocate space fore tmp_file");
+ fprintf(stderr, "preview_pkg: Could not allocate space for tmp_file\n");
exit(-1);
}
sprintf(args, "-n %s", fname);
@@ -176,6 +190,7 @@ preview_pkg(void)
free(fname);
free(tmp_file);
use_helpfile(PREVIEW_FS_HLP);
+ use_helpline("Select package to preview");
fname = dialog_fselect(".", "*.tgz");
}
if (fname) free(fname);
@@ -188,10 +203,33 @@ preview_pkg(void)
void
install_batch(void)
/*
+ * Desc: Get the directory from which to list and install packages
+ */
+{
+ int quit;
+
+ use_helpfile(DS_INSTALL_HLP);
+ quit = FALSE;
+ while (!quit) {
+ use_helpline("Select directory where the pkg's reside");
+ if (dialog_dselect(".", "*.tgz")) {
+ quit = TRUE;
+ } else {
+ install_pkgs_indir();
+ }
+ }
+
+ return;
+} /* install_batch() */
+
+
+void
+install_pkgs_indir(void)
+/*
* Desc: install several packages.
*/
{
- WINDOW *pkg_win, *w;
+ WINDOW *pkg_win, *w, *tmpwin;
DirList *d = NULL;
char **fnames, o_pkg[MAXPATHLEN], o_pkgi[MAXPATHLEN],
**comment, **desc, **names, msg[512];
@@ -203,19 +241,19 @@ install_batch(void)
long total_marked = 0, *sizes;
char *tmp_file, tmp_dir[MAXPATHLEN];
- /* first go to the directory where the packages are installed, then
- list all packages in that directory with a short description of
+ /* list all packages in the current directory with a short description of
the package. Pressing enter should give more info about a specific
package. */
-
- use_helpfile(DS_INSTALL_HLP);
- use_helpline("Select the directory where the pkg's reside");
- if (dialog_dselect()) {
- /* cancel button was pressed */
- return;
+
+ /* save current window */
+ tmpwin = dupwin(newscr);
+ if (tmpwin == NULL) {
+ endwin();
+ fprintf(stderr, "\ninstall_pkgs_indir: dupwin(newscr) failed\n");
+ exit(1);
}
+
use_helpline(NULL);
-
pkg_win = newwin(LINES-4, COLS-12, 2, 5);
if (pkg_win == NULL) {
endwin();
@@ -510,6 +548,10 @@ install_batch(void)
use_helpfile(NULL);
use_helpline(NULL);
delwin(pkg_win);
+
+ touchwin(tmpwin);
+ wrefresh(tmpwin);
+ delwin(tmpwin);
return;
} /* install_batch() */