Deleted Added
full compact
package.c (50780) package.c (54587)
1/*
2 * The new sysinstall program.
3 *
4 * This is probably the last program in the `sysinstall' line - the next
5 * generation being essentially a complete rewrite.
6 *
1/*
2 * The new sysinstall program.
3 *
4 * This is probably the last program in the `sysinstall' line - the next
5 * generation being essentially a complete rewrite.
6 *
7 * $FreeBSD: head/usr.sbin/sysinstall/package.c 50780 1999-09-02 00:51:16Z jkh $
7 * $FreeBSD: head/usr.sbin/sysinstall/package.c 54587 1999-12-14 04:25:29Z jkh $
8 *
9 * Copyright (c) 1995
10 * Jordan Hubbard. All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright

--- 53 unchanged lines hidden (view full) ---

69 return i;
70
71 tmp3 = strpbrk(name, "-") ? NULL : &tmp2;
72 tmp = index_search(&Top, name, tmp3);
73 if (tmp)
74 return index_extract(mediaDevice, &Top, tmp, FALSE);
75 else {
76 msgConfirm("Sorry, package %s was not found in the INDEX.", name);
8 *
9 * Copyright (c) 1995
10 * Jordan Hubbard. All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright

--- 53 unchanged lines hidden (view full) ---

69 return i;
70
71 tmp3 = strpbrk(name, "-") ? NULL : &tmp2;
72 tmp = index_search(&Top, name, tmp3);
73 if (tmp)
74 return index_extract(mediaDevice, &Top, tmp, FALSE);
75 else {
76 msgConfirm("Sorry, package %s was not found in the INDEX.", name);
77 return DITEM_FAILURE | DITEM_RESTORE;
77 return DITEM_FAILURE;
78 }
79}
80
81/* For use by dispatch */
82int
83packageAdd(dialogMenuItem *self)
84{
85 char *cp;

--- 43 unchanged lines hidden (view full) ---

129 }
130
131 /* If necessary, initialize the ldconfig hints */
132 if (!file_readable("/var/run/ld.so.hints"))
133 vsystem("ldconfig /usr/lib /usr/local/lib /usr/X11R6/lib");
134 vsystem("/sbin/ldconfig -aout /usr/lib/compat/aout /usr/lib/aout /usr/X11R6/lib/aout /usr/local/lib/aout");
135
136 /* Be initially optimistic */
78 }
79}
80
81/* For use by dispatch */
82int
83packageAdd(dialogMenuItem *self)
84{
85 char *cp;

--- 43 unchanged lines hidden (view full) ---

129 }
130
131 /* If necessary, initialize the ldconfig hints */
132 if (!file_readable("/var/run/ld.so.hints"))
133 vsystem("ldconfig /usr/lib /usr/local/lib /usr/X11R6/lib");
134 vsystem("/sbin/ldconfig -aout /usr/lib/compat/aout /usr/lib/aout /usr/X11R6/lib/aout /usr/local/lib/aout");
135
136 /* Be initially optimistic */
137 ret = DITEM_SUCCESS | DITEM_RESTORE;
137 ret = DITEM_SUCCESS;
138 /* Make a couple of paranoid locations for temp files to live if user specified none */
139 if (!variable_get(VAR_PKG_TMPDIR)) {
140 /* Set it to a location with as much space as possible */
141 variable_set2(VAR_PKG_TMPDIR, "/usr/tmp", 0);
142 }
143 Mkdir(variable_get(VAR_PKG_TMPDIR));
144 vsystem("chmod 1777 %s", variable_get(VAR_PKG_TMPDIR));
145

--- 66 unchanged lines hidden (view full) ---

212 msgInfo("pkg_add(1) apparently did not like the %s package.", name);
213 else if (i == -1)
214 msgInfo("I/O error while reading in the %s package.", name);
215 else
216 msgInfo("Package %s read successfully - waiting for pkg_add(1)", name);
217 refresh();
218 i = waitpid(pid, &tot, 0);
219 if (sigpipe_caught || i < 0 || WEXITSTATUS(tot)) {
138 /* Make a couple of paranoid locations for temp files to live if user specified none */
139 if (!variable_get(VAR_PKG_TMPDIR)) {
140 /* Set it to a location with as much space as possible */
141 variable_set2(VAR_PKG_TMPDIR, "/usr/tmp", 0);
142 }
143 Mkdir(variable_get(VAR_PKG_TMPDIR));
144 vsystem("chmod 1777 %s", variable_get(VAR_PKG_TMPDIR));
145

--- 66 unchanged lines hidden (view full) ---

212 msgInfo("pkg_add(1) apparently did not like the %s package.", name);
213 else if (i == -1)
214 msgInfo("I/O error while reading in the %s package.", name);
215 else
216 msgInfo("Package %s read successfully - waiting for pkg_add(1)", name);
217 refresh();
218 i = waitpid(pid, &tot, 0);
219 if (sigpipe_caught || i < 0 || WEXITSTATUS(tot)) {
220 ret = DITEM_FAILURE | DITEM_RESTORE;
220 ret = DITEM_FAILURE;
221 if (variable_get(VAR_NO_CONFIRM))
222 msgNotify("Add of package %s aborted, error code %d -\n"
223 "Please check the debug screen for more info.", name, WEXITSTATUS(tot));
224 else
225 msgConfirm("Add of package %s aborted, error code %d -\n"
226 "Please check the debug screen for more info.", name, WEXITSTATUS(tot));
227 }
228 else
229 msgNotify("Package %s was added successfully", name);
230
231 /* Now catch any stragglers */
232 while (wait3(&tot, WNOHANG, NULL) > 0);
233
234 sleep(1);
235 restorescr(w);
236 }
237 }
238 else {
221 if (variable_get(VAR_NO_CONFIRM))
222 msgNotify("Add of package %s aborted, error code %d -\n"
223 "Please check the debug screen for more info.", name, WEXITSTATUS(tot));
224 else
225 msgConfirm("Add of package %s aborted, error code %d -\n"
226 "Please check the debug screen for more info.", name, WEXITSTATUS(tot));
227 }
228 else
229 msgNotify("Package %s was added successfully", name);
230
231 /* Now catch any stragglers */
232 while (wait3(&tot, WNOHANG, NULL) > 0);
233
234 sleep(1);
235 restorescr(w);
236 }
237 }
238 else {
239 dialog_clear_norefresh();
240 if (variable_get(VAR_NO_CONFIRM))
241 msgNotify("Unable to fetch package %s from selected media.\n"
242 "No package add will be done.", name);
243 else
244 msgConfirm("Unable to fetch package %s from selected media.\n"
245 "No package add will be done.", name);
239 if (variable_get(VAR_NO_CONFIRM))
240 msgNotify("Unable to fetch package %s from selected media.\n"
241 "No package add will be done.", name);
242 else
243 msgConfirm("Unable to fetch package %s from selected media.\n"
244 "No package add will be done.", name);
246 ret = DITEM_FAILURE | DITEM_RESTORE;
245 ret = DITEM_FAILURE;
247 }
248 signal(SIGPIPE, SIG_IGN);
249 return ret;
250}
246 }
247 signal(SIGPIPE, SIG_IGN);
248 return ret;
249}