Deleted Added
full compact
package.c (47055) package.c (47179)
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 * $Id: package.c,v 1.70 1999/05/12 07:12:01 jkh Exp $
7 * $Id: package.c,v 1.71 1999/05/12 09:02:36 jkh Exp $
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

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

112 char path[511];
113 int ret, last_msg = 0;
114 FILE *fp;
115
116 /* Check to make sure it's not already there */
117 if (package_exists(name))
118 return DITEM_SUCCESS;
119
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

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

112 char path[511];
113 int ret, last_msg = 0;
114 FILE *fp;
115
116 /* Check to make sure it's not already there */
117 if (package_exists(name))
118 return DITEM_SUCCESS;
119
120 /* If necessary, initialize the ldconfig hints */
121 if (!file_readable("/var/run/ld.so.hints"))
122 vsystem("ldconfig /usr/lib /usr/local/lib /usr/X11R6/lib");
123
124 if (!dev->init(dev)) {
125 msgConfirm("Unable to initialize media type for package extract.");
126 return DITEM_FAILURE;
127 }
128
120 if (!dev->init(dev)) {
121 msgConfirm("Unable to initialize media type for package extract.");
122 return DITEM_FAILURE;
123 }
124
125 /* If necessary, initialize the ldconfig hints */
126 if (!file_readable("/var/run/ld.so.hints"))
127 vsystem("ldconfig /usr/lib /usr/local/lib /usr/X11R6/lib");
128
129 /* Be initially optimistic */
130 ret = DITEM_SUCCESS | DITEM_RESTORE;
131 /* Make a couple of paranoid locations for temp files to live if user specified none */
132 if (!variable_get(VAR_PKG_TMPDIR)) {
133 /* Set it to a location with as much space as possible */
134 variable_set2(VAR_PKG_TMPDIR, "/usr/tmp", 0);
135 }
136 Mkdir(variable_get(VAR_PKG_TMPDIR));
137 vsystem("chmod 1777 %s", variable_get(VAR_PKG_TMPDIR));
138
129 /* Be initially optimistic */
130 ret = DITEM_SUCCESS | DITEM_RESTORE;
131 /* Make a couple of paranoid locations for temp files to live if user specified none */
132 if (!variable_get(VAR_PKG_TMPDIR)) {
133 /* Set it to a location with as much space as possible */
134 variable_set2(VAR_PKG_TMPDIR, "/usr/tmp", 0);
135 }
136 Mkdir(variable_get(VAR_PKG_TMPDIR));
137 vsystem("chmod 1777 %s", variable_get(VAR_PKG_TMPDIR));
138
139 if (!strpbrk(name, "-_"))
140 sprintf(path, "packages/Latest/%s.tgz", name);
141 else if (!index(name, '/'))
142 sprintf(path, "packages/All/%s%s", name, strstr(name, ".tgz") ? "" : ".tgz");
139 if (!index(name, '/')) {
140 if (!strpbrk(name, "-_"))
141 sprintf(path, "packages/Latest/%s.tgz", name);
142 else
143 sprintf(path, "packages/All/%s%s", name, strstr(name, ".tgz") ? "" : ".tgz");
144 }
143 else
144 sprintf(path, "%s%s", name, strstr(name, ".tgz") ? "" : ".tgz");
145
146 /* We have a path, call the device strategy routine to get the file */
147 fp = dev->get(dev, path, TRUE);
148 if (fp) {
149 int i = 0, tot, pfd[2];
150 pid_t pid;

--- 88 unchanged lines hidden ---
145 else
146 sprintf(path, "%s%s", name, strstr(name, ".tgz") ? "" : ".tgz");
147
148 /* We have a path, call the device strategy routine to get the file */
149 fp = dev->get(dev, path, TRUE);
150 if (fp) {
151 int i = 0, tot, pfd[2];
152 pid_t pid;

--- 88 unchanged lines hidden ---