- (when (file-symlink-p link) (delete-file link))
- (unless (file-exists-p link) (make-symbolic-link dir link 1))
- (vm-pipe-message-to-command (concat "munpack -C " dir))
+
+ (when (file-symlink-p (concat link "~~"))
+ (delete-file (concat link "~~")))
+
+ (when (and (file-symlink-p (concat link "~"))
+ (not (file-exists-p (concat link "~~"))))
+ (rename-file (concat link "~") (concat link "~~")))
+
+ (when (and (file-symlink-p link)
+ (not (file-exists-p (concat link "~"))))
+ (file-symlink-p link) (rename-file link (concat link "~")))
+
+ (unless (file-exists-p link)
+ (make-symbolic-link dir link 1))
+
+ ;; (vm-pipe-message-to-command (concat "munpack -C " dir))
+
+ (vm-pipe-message-to-command (concat "munpack -t -C " dir))