Lines Matching defs:from_name
465 do_link(char *from_name, char *to_name)
475 ret = link(from_name, tmpl);
479 * file may still exist when from_name and to_name point
485 ret = link(from_name, to_name);
488 (void)printf("install: link %s -> %s\n", from_name, to_name);
498 do_symlink(char *from_name, char *to_name)
508 if (symlink(from_name, tmpl) == -1)
509 err(EXIT_FAILURE, "symlink %s -> %s", from_name, tmpl);
516 if (symlink(from_name, to_name) == -1)
517 err(EXIT_FAILURE, "symlink %s -> %s", from_name, to_name);
520 (void)printf("install: symlink %s -> %s\n", from_name, to_name);
528 makelink(char *from_name, char *to_name)
535 if (do_link(from_name, to_name) == -1) {
537 err(EXIT_FAILURE, "link %s -> %s", from_name, to_name);
567 dres = MD5File(from_name, NULL);
570 dres = RMD160File(from_name, NULL);
573 dres = SHA1File(from_name, NULL);
576 dres = SHA256_File(from_name, NULL);
579 dres = SHA384_File(from_name, NULL);
582 dres = SHA512_File(from_name, NULL);
602 if (realpath(from_name, src) == NULL)
603 err(EXIT_FAILURE, "%s: realpath", from_name);
614 if (realpath(from_name, src) == NULL)
615 err(EXIT_FAILURE, "%s: realpath", from_name);
656 do_symlink(from_name, to_name);
657 /* XXX: from_name may point outside of destdir */
658 metadata_log(to_name, "link", NULL, from_name, NULL, 0);
666 install(char *from_name, char *to_name, u_int flags)
678 if (stat(from_name, &from_sb))
679 err(EXIT_FAILURE, "%s: stat", from_name);
692 if (flags & DIRECTORY || strcmp(from_name, _PATH_DEVNULL) != 0) {
696 errx(EXIT_FAILURE, "%s: not a regular file", from_name);
702 (p = strrchr(from_name, '/')) ? ++p : from_name);
736 makelink(from_name, dorename ? oto_name : to_name);
751 if ((from_fd = open(from_name, O_RDONLY, 0)) < 0) {
753 err(EXIT_FAILURE, "%s: open", from_name);
756 copy(from_fd, from_name, to_fd, to_name, from_sb.st_size);
834 (void)printf("install: %s -> %s\n", from_name, to_name);
860 copy(int from_fd, char *from_name, int to_fd, char *to_name, off_t size)
990 from_name);