update to match latest DEPSOLVE.txt changes; find updates of obsoleted packages
8 #include "razor-internal.h"
11 razor_create_dir(const char *root, const char *path)
13 char buffer[PATH_MAX], *p;
14 const char *slash, *next;
17 /* Create all sub-directories in dir and then create name. We
18 * know root exists and is a dir, root does not end in a '/',
19 * and path has a leading '/'. */
22 p = buffer + strlen(buffer);
24 for (slash = path; *slash != '\0'; slash = next) {
25 next = strchr(slash + 1, '/');
27 next = slash + strlen(slash);
29 memcpy(p, slash, next - slash);
33 if (stat(buffer, &buf) == 0) {
34 if (!S_ISDIR(buf.st_mode)) {
36 "%s exists but is not a directory\n",
40 } else if (mkdir(buffer, 0777) < 0) {
41 fprintf(stderr, "failed to make directory %s: %m\n",
46 /* FIXME: What to do about permissions for dirs we
47 * have to create but are not in the cpio archive? */
54 razor_write(int fd, const void *data, size_t size)
58 const unsigned char *p;
63 written = write(fd, p, rest);
65 fprintf(stderr, "write error: %m\n");