+#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
+