Patch provided by Lee Iverson <leei@ai.sri.com> unlabeled-3.13.14
authorcls%seawood.org
Tue, 21 Sep 1999 19:54:57 +0000
branchunlabeled-3.13.14
changeset 826 4df91de4a9e5
parent 611 bde95feaff7a
push idunknown
push userunknown
push dateunknown
Patch provided by Lee Iverson <leei@ai.sri.com> Ensure that unmodified include files & symlinks are not modified. Added --disable-shared option. Resurrect use of OS_LIBS & EXTRA_LIBS. Add check for -ldl. Added nsprincl.sh & nsprincl.mk to build.
config/nsinstall.c
--- a/config/nsinstall.c
+++ b/config/nsinstall.c
@@ -309,20 +309,23 @@ main(int argc, char **argv)
 		    }
 
 		    len = strlen(linkname);
 		}
 		name = linkname;
 	    }
 
 	    /* Check for a pre-existing symlink with identical content. */
-	    if (exists &&
-		(!S_ISLNK(tosb.st_mode) ||
-		 readlink(toname, buf, sizeof buf) != len ||
-		 strncmp(buf, name, len) != 0)) {
+	    if (exists) {
+          if (S_ISLNK(tosb.st_mode) &&
+              readlink(toname, buf, sizeof buf) == len &&
+              strncmp(buf, name, len) == 0) {
+            /*fprintf(stderr,"link exists: %s => %.*s\n", toname, len, buf);*/
+            continue;
+          }
 		(void) (S_ISDIR(tosb.st_mode) ? rmdir : unlink)(toname);
 		exists = 0;
 	    }
 	    if (!exists && symlink(name, toname) < 0)
 		fail("cannot make symbolic link %s", toname);
 #ifdef HAVE_LCHOWN
 	    if ((owner || group) && lchown(toname, uid, gid) < 0)
 		fail("cannot change owner of %s", toname);