[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
draft patch to import gnulib's filemode module into Emacs
From: |
Paul Eggert |
Subject: |
draft patch to import gnulib's filemode module into Emacs |
Date: |
Sun, 20 Feb 2011 03:17:52 -0800 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 |
Here's a draft patch to import gnulib's filemode module
into Emacs.
The following parts of this may affect the Windows build:
* src/filemode.c is renamed to lib/filemode.c in the usual
way for imports from gnulib. There's also a new file
lib/filemode.h that src/dired.c now includes.
* lib/sys/stat.h is built on hosts whose <sys/stat.h> has problems.
I expect that Windows <sys/stat.h> does not have these problems,
so this part can be ignored.
* src/config.in has two new symbols that I expect can be left alone
on Windows but thought I'd mention them. They are HAVE_DECL_STRMODE
(for a BSD-style strmode function) and HAVE_ST_DM_MODE
(for a Cray-style dm_mode member of struct stat).
* Some other symbols are added to src/config.in. If <sys/stat.h> is OK
is OK on Windows then you can safely ignore these symbols. They
are STAT_MACROS_BROKEN and nlink_t.
Here are the handwritten parts of the patch. I'm attaching the full
patch, including the autogenerated files, in compressed format.
=== modified file '.bzrignore'
--- .bzrignore 2011-02-20 08:48:52 +0000
+++ .bzrignore 2011-02-20 10:51:50 +0000
@@ -42,6 +42,7 @@
lib/c++defs.h
lib/getopt.h
lib/stdlib.h
+lib/sys/
lib/time.h
lib/unistd.h
lib/warn-on-use.h
=== modified file 'ChangeLog'
--- ChangeLog 2011-02-20 08:48:52 +0000
+++ ChangeLog 2011-02-20 10:51:50 +0000
@@ -1,5 +1,20 @@
2011-02-20 Paul Eggert <address@hidden>
+ Import filemode module from gnulib.
+ * .bzrignore: Add lib/sys/.
+ * Makefile.in (GNULIB_MODULES): Add filemode.
+ * lib/Makefile.am (MOSTLYCLEANDIRS): New macro.
+ * lib/filemode.c: Renamed from src/filemode.c and regenerated
+ from gnulib. This adds support for some more file types, e.g.,
+ Cray DMF migrated files.
+ * lisp/emacs-lisp/find-gc.el (find-gc-source-files): Remove filemode.c.
+ * lib/filemode.h, lib/sys_stat.in.h, m4/filemode.m4, m4/st_dm_mode.m4:
+ * m4/sys_stat_h.m4: New files, generated from gnulib.
+ * aclocal.m4, configure, lib/Makefile.in, lib/gnulib.mk, m4/gl-comp.m4:
+ Regenerate.
+
+2011-02-20 Paul Eggert <address@hidden>
+
Import crypto/md5 and stdint modules from gnulib.
* aclocal.m4, configure, lib/Makefile.in, lib/gnulib.mk, m4/gl-comp.m4:
Regenerate.
=== modified file 'Makefile.in'
--- Makefile.in 2011-02-18 08:07:03 +0000
+++ Makefile.in 2011-02-20 10:51:50 +0000
@@ -331,7 +331,8 @@
# $(gnulib_srcdir) (relative to $(srcdir) and should have build tools
# as per $(gnulib_srcdir)/DEPENDENCIES.
GNULIB_MODULES = \
- crypto/md5 dtoastr getloadavg getopt-gnu ignore-value mktime strftime
+ crypto/md5 dtoastr filemode getloadavg getopt-gnu \
+ ignore-value mktime strftime
GNULIB_TOOL_FLAGS = \
--import --no-changelog --no-vc-files --makefile-name=gnulib.mk
sync-from-gnulib: $(gnulib_srcdir)
=== modified file 'lib/Makefile.am'
--- lib/Makefile.am 2011-02-06 22:13:03 +0000
+++ lib/Makefile.am 2011-02-20 10:51:50 +0000
@@ -1,5 +1,6 @@
BUILT_SOURCES =
EXTRA_DIST =
+MOSTLYCLEANDIRS =
MOSTLYCLEANFILES =
noinst_LIBRARIES =
=== modified file 'lisp/emacs-lisp/find-gc.el'
--- lisp/emacs-lisp/find-gc.el 2011-01-25 04:08:28 +0000
+++ lisp/emacs-lisp/find-gc.el 2011-02-20 10:51:50 +0000
@@ -55,7 +55,7 @@
"term.c" "cm.c" "emacs.c" "keyboard.c" "macros.c"
"keymap.c" "sysdep.c" "buffer.c" "filelock.c"
"insdel.c" "marker.c" "minibuf.c" "fileio.c"
- "dired.c" "filemode.c" "cmds.c" "casefiddle.c"
+ "dired.c" "cmds.c" "casefiddle.c"
"indent.c" "search.c" "regex.c" "undo.c"
"alloc.c" "data.c" "doc.c" "editfns.c"
"callint.c" "eval.c" "fns.c" "print.c" "lread.c"
=== modified file 'src/ChangeLog'
--- src/ChangeLog 2011-02-20 08:48:52 +0000
+++ src/ChangeLog 2011-02-20 10:53:22 +0000
@@ -1,5 +1,15 @@
2011-02-20 Paul Eggert <address@hidden>
+ Import filemode module from gnulib.
+ * Makefile.in (base_obj): Remove filemode.o, as it's now in ../lib.
+ * deps.mk (dired.o): Depend on ../lib/filemode.h, too.
+ (filemode.o): Remove; this is now in ../lib.
+ * dired.c: Include <filemode.h>.
+ (filemodestring): Remove now-redundant decl.
+ * config.in: Regenerate.
+
+2011-02-20 Paul Eggert <address@hidden>
+
Import crypto/md5 and stdint modules from gnulib.
* Makefile.in (base_obj): Remove md5.o, since this file
is in lib now.
=== modified file 'src/Makefile.in'
--- src/Makefile.in 2011-02-20 08:48:52 +0000
+++ src/Makefile.in 2011-02-20 10:53:22 +0000
@@ -347,7 +347,7 @@
cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \
emacs.o keyboard.o macros.o keymap.o sysdep.o \
buffer.o filelock.o insdel.o marker.o \
- minibuf.o fileio.o dired.o filemode.o \
+ minibuf.o fileio.o dired.o \
cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \
alloc.o data.o doc.o editfns.o callint.o \
eval.o floatfns.o fns.o font.o print.o lread.o \
=== modified file 'src/deps.mk'
--- src/deps.mk 2011-02-19 09:51:59 +0000
+++ src/deps.mk 2011-02-20 10:53:22 +0000
@@ -73,7 +73,7 @@
dbusbind.o: dbusbind.c termhooks.h frame.h keyboard.h lisp.h $(config_h)
dired.o: dired.c commands.h buffer.h lisp.h $(config_h) character.h charset.h \
coding.h regex.h systime.h blockinput.h atimer.h composite.h \
- ../lib/unistd.h globals.h
+ ../lib/filemode.h ../lib/unistd.h globals.h
dispnew.o: dispnew.c systime.h commands.h process.h frame.h coding.h \
window.h buffer.h termchar.h termopts.h termhooks.h cm.h \
disptab.h indent.h $(INTERVALS_H) nsgui.h ../lib/unistd.h \
@@ -98,7 +98,6 @@
commands.h globals.h ../lib/unistd.h
filelock.o: filelock.c buffer.h character.h coding.h systime.h composite.h \
../lib/unistd.h lisp.h globals.h $(config_h)
-filemode.o: filemode.c $(config_h)
font.o: font.c dispextern.h frame.h window.h ccl.h character.h charset.h \
font.h lisp.h globals.h $(config_h) buffer.h composite.h fontset.h \
xterm.h nsgui.h msdos.h
=== modified file 'src/dired.c'
--- src/dired.c 2011-02-16 15:02:50 +0000
+++ src/dired.c 2011-02-20 10:53:22 +0000
@@ -54,6 +54,8 @@
#include <sys/dir.h>
#include <sys/stat.h>
+#include <filemode.h>
+
#define DIRENTRY struct direct
extern DIR *opendir (char *);
@@ -82,9 +84,6 @@
struct re_registers *,
Lisp_Object, int, int);
-/* From filemode.c. Can't go in Lisp.h because of `stat'. */
-extern void filemodestring (struct stat *, char *);
-
/* if system does not have symbolic links, it does not have lstat.
In that case, use ordinary stat instead. */
filemode-patch1.txt.gz
Description: GNU Zip compressed data
- draft patch to import gnulib's filemode module into Emacs,
Paul Eggert <=