X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/beb54af10082dc588132b2c0d32e050028b72c78..78ed81a334dab56aa7a876792a473d67d4359c25:/gnu/usr.bin/cvs/cvs/update.c diff --git a/gnu/usr.bin/cvs/cvs/update.c b/gnu/usr.bin/cvs/cvs/update.c index e0dc2870cf..c25bc757f5 100644 --- a/gnu/usr.bin/cvs/cvs/update.c +++ b/gnu/usr.bin/cvs/cvs/update.c @@ -424,6 +424,37 @@ update_filesdone_proc (err, repository, update_dir) (void) run_exec (RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL); } +#ifdef DO_LINKS + { + char lnfile[PATH_MAX]; + FILE *links; + + sprintf(lnfile, "%s/SymLinks", repository); + links = fopen(lnfile, "r"); + if (links) { + char from[PATH_MAX], to[PATH_MAX]; + + /* Read all the link pairs from the symlinks file */ + while (fgets(to, PATH_MAX, links)) { + fgets(from, PATH_MAX, links); + + /* Strip off the newlines */ + to[strlen(to) - 1] = '\0'; + from[strlen(from) - 1] = '\0'; + + /* Do it */ + if (symlink(from, to) == -1) { + error (0, errno, "Unable to create symlink `%s'", to); + return 1; + } + else if (!quiet) + error (0, 0, "Creating symlink %s", to); + } + fclose(links); + } + } +#endif + return (err); }