Check elinstall-proceed-p before making symlinks
authorTom Breton (Tehom) <tehom@panix.com>
Fri, 24 Dec 2010 20:42:27 +0000 (24 15:42 -0500)
committerTom Breton (Tehom) <tehom@panix.com>
Fri, 24 Dec 2010 20:42:27 +0000 (24 15:42 -0500)
elinstall.el

index ae9fb31..d45f012 100644 (file)
@@ -790,18 +790,20 @@ Other non-nil cases of FORCE are reserved for future development."
            (message "The target directory doesn't exist."))
         ;;Target shouldn't already exist, but if force is given, let
         ;;user override.
+
         ;;$$IMPROVE ME If it is a symlink pointing to the same place,
-        ;;do nothing even on force.
-        ((and
-            (file-exists-p target)
-            (or
-               (not force)
-               (not
-                  (yes-or-no-p 
-                     (format "Really overwrite %s? " target))))
-            (message "File %s already exists" target)))
-        
-        (t
+        ;;do nothing.
+
+        ;;$$IMPROVE ME The condition here is not updating but
+        ;;bulldozing a possibly different symlink.  Add another
+        ;;treatment symbol meaning to bulldoze what's in the way.
+        ((elinstall-proceed-p 'preloads-compile 
+            (list
+               '( "Symlink %s? "
+                   "Really overwrite %s? "
+                   "File %s already exists")
+               target)
+            (file-exists-p target))
            (make-symbolic-link 
               filename
               target