Gnus development mailing list
 help / color / mirror / Atom feed
* Patch for filesystems that do not support chmod.
@ 2004-05-19 12:53 Paul Stodghill
  2004-05-19 13:26 ` Jesper Harder
  0 siblings, 1 reply; 11+ messages in thread
From: Paul Stodghill @ 2004-05-19 12:53 UTC (permalink / raw)


Here's my problem: I store all of my Gnus files on a FAT32 filesystem so
that I can share them between Windows and Linux on my dual-boot system.
Unfortunately, Cygwin (Linux too, I think) does not provide a complete
implementation of chmod for FAT32 filesystems. As a result, Gnus's calls
to `set-file-modes' will likely fail.

I offer the following patch to NGnus 0.02 for your consideration.
Basically, it introduces a global variable, `gnus-set-file-modes', which
can be set to nil to prevent Gnus from making any calls to
set-file-modes.

I will be happy to rework this basic upon feedback. I have copyright
assignment papers files with the FSF for Gnus.

Thank you.


diff -ru ../ngnus-0.2-orig/lisp/gnus-registry.el ./lisp/gnus-registry.el
--- ../ngnus-0.2-orig/lisp/gnus-registry.el	2004-04-27 19:10:12.000000000 -0400
+++ ./lisp/gnus-registry.el	2004-05-19 08:42:52.000000000 -0400
@@ -202,7 +202,7 @@
 		
 		;; Replace the existing startup file with the temp file.
 		(rename-file working-file startup-file t)
-		(set-file-modes startup-file setmodes)))
+		(gnus-set-file-modes startup-file setmodes)))
 	  (condition-case nil
 	      (delete-file working-file)
 	    (file-error nil)))))
diff -ru ../ngnus-0.2-orig/lisp/gnus-start.el ./lisp/gnus-start.el
--- ../ngnus-0.2-orig/lisp/gnus-start.el	2004-04-08 12:02:08.000000000 -0400
+++ ./lisp/gnus-start.el	2004-05-19 08:42:46.000000000 -0400
@@ -870,7 +870,7 @@
 	  (when (and (file-exists-p gnus-current-startup-file)
 		     (file-exists-p dribble-file)
 		     (setq modes (file-modes gnus-current-startup-file)))
-	    (set-file-modes dribble-file modes))
+	    (gnus-set-file-modes dribble-file modes))
 	  (goto-char (point-min))
 	  (when (search-forward "Gnus was exited on purpose" nil t)
 	    (setq purpose t))
@@ -2752,7 +2752,7 @@
 
                       ;; Replace the existing startup file with the temp file.
                       (rename-file working-file startup-file t)
-                      (set-file-modes startup-file setmodes)))
+                      (gnus-set-file-modes startup-file setmodes)))
                 (condition-case nil
                     (delete-file working-file)
                   (file-error nil)))))
@@ -2897,7 +2897,7 @@
       (let ((coding-system-for-write gnus-ding-file-coding-system))
 	(gnus-write-buffer slave-name))
       (when modes
-	(set-file-modes slave-name modes)))))
+	(gnus-set-file-modes slave-name modes)))))
 
 (defun gnus-master-read-slave-newsrc ()
   (let ((slave-files
diff -ru ../ngnus-0.2-orig/lisp/gnus-util.el ./lisp/gnus-util.el
--- ../ngnus-0.2-orig/lisp/gnus-util.el	2004-04-07 21:48:42.000000000 -0400
+++ ./lisp/gnus-util.el	2004-05-19 08:43:06.000000000 -0400
@@ -1473,6 +1473,14 @@
 			  (concat old-dir "..")))))))))
 
 
+(defcustom gnus-set-file-modes t "When nil, do not attempt to change file modes. This is useful when Gnus files are stored on filesystems that do not support chmod (e.g., FAT32)." :type 'boolean :group 'gnus)
+
+(defun gnus-set-file-modes (filename mode)
+  "Wrapper for set-file-modes.
+No-op if `gnus-set-file-modes' is set to nil."
+  (if gnus-set-file-modes
+      (set-file-modes filename mode)))
+
 (provide 'gnus-util)
 
 ;;; gnus-util.el ends here
diff -ru ../ngnus-0.2-orig/lisp/gnus-uu.el ./lisp/gnus-uu.el
--- ../ngnus-0.2-orig/lisp/gnus-uu.el	2004-04-25 14:01:34.000000000 -0400
+++ ./lisp/gnus-uu.el	2004-05-19 08:42:42.000000000 -0400
@@ -1751,7 +1751,7 @@
 
       (setq gnus-uu-work-dir
 	    (mm-make-temp-file (concat gnus-uu-tmp-dir "gnus") 'dir))
-      (set-file-modes gnus-uu-work-dir 448)
+      (gnus-set-file-modes gnus-uu-work-dir 448)
       (setq gnus-uu-work-dir (file-name-as-directory gnus-uu-work-dir))
       (push (cons gnus-newsgroup-name gnus-uu-work-dir)
 	    gnus-uu-tmp-alist))))
diff -ru ../ngnus-0.2-orig/lisp/mail-source.el ./lisp/mail-source.el
--- ../ngnus-0.2-orig/lisp/mail-source.el	2004-03-08 01:54:24.000000000 -0500
+++ ./lisp/mail-source.el	2004-05-19 08:42:38.000000000 -0400
@@ -608,7 +608,7 @@
 			     (expand-file-name "movemail" exec-directory))
 			 nil errors nil from to)))))
 	      (when (file-exists-p to)
-		(set-file-modes to mail-source-default-file-modes))
+		(gnus-set-file-modes to mail-source-default-file-modes))
 	      (if (and (or (not (buffer-modified-p errors))
 			   (zerop (buffer-size errors)))
 		       (and (numberp result)
diff -ru ../ngnus-0.2-orig/lisp/mm-decode.el ./lisp/mm-decode.el
--- ../ngnus-0.2-orig/lisp/mm-decode.el	2004-03-22 00:31:58.000000000 -0500
+++ ./lisp/mm-decode.el	2004-05-19 08:42:36.000000000 -0400
@@ -735,7 +735,7 @@
 	       (copiousoutput (assoc "copiousoutput" mime-info))
 	       file buffer)
 	  ;; We create a private sub-directory where we store our files.
-	  (set-file-modes dir 448)
+	  (gnus-set-file-modes dir 448)
 	  (if filename
 	      (setq file (expand-file-name
 			  (gnus-map-function mm-file-name-rewrite-functions
diff -ru ../ngnus-0.2-orig/lisp/nnmail.el ./lisp/nnmail.el
--- ../ngnus-0.2-orig/lisp/nnmail.el	2004-04-15 02:42:24.000000000 -0400
+++ ./lisp/nnmail.el	2004-05-19 08:42:30.000000000 -0400
@@ -1882,7 +1882,7 @@
   (let ((coding-system-for-write nnmail-file-coding-system)
 	(file-name-coding-system nnmail-pathname-coding-system))
     (write-region start end filename append visit lockname)
-    (set-file-modes filename nnmail-default-file-modes)))
+    (gnus-set-file-modes filename nnmail-default-file-modes)))
 
 ;;;
 ;;; Status functions




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-05-22 23:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-19 12:53 Patch for filesystems that do not support chmod Paul Stodghill
2004-05-19 13:26 ` Jesper Harder
2004-05-19 23:39   ` Lars Magne Ingebrigtsen
2004-05-20  1:08     ` Jesper Harder
2004-05-20 16:43       ` Lars Magne Ingebrigtsen
2004-05-20 17:08       ` Paul Stodghill
2004-05-20 17:28         ` Paul Stodghill
2004-05-20 23:40           ` Jon Ericson
2004-05-22 23:29           ` Lars Magne Ingebrigtsen
2004-05-20 19:58         ` Jesper Harder
2004-05-20 17:04   ` Paul Stodghill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).