This commit was manufactured by cvs2svn to create tag 'FreeBSD-release/1.0'.
[unix-history] / gnu / usr.bin / cvs / cvs / update.c
index e0dc287..c25bc75 100644 (file)
@@ -424,6 +424,37 @@ update_filesdone_proc (err, repository, update_dir)
        (void) run_exec (RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL);
     }
 
        (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);
 }
 
     return (err);
 }