coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] maint: improve make src/fs-magic-compare


From: Pádraig Brady
Subject: [PATCH] maint: improve make src/fs-magic-compare
Date: Fri, 22 Mar 2013 12:25:15 +0000

* README-release: fix the `make` command, and mention how
to get the latest results without requring running a
system with the latest kernel.
* src/local.mk (src/fs-latest-magic.h): A new target to
document how/where to place the latest magic header.
(src/fs-kernel-magic): Adjust to include separately
downloaded header if available.
(src/fs-magic): Undefine MANPAGER as it may impact the
ability to pipe the output of man(1).
(fs-magic-compare): Don't echo the commands run as they're
distracting from the output which needs to be examined.
---
 README-release |    7 ++++---
 src/local.mk   |   22 ++++++++++++++++------
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/README-release b/README-release
index e76adb7..20fcb9e 100644
--- a/README-release
+++ b/README-release
@@ -25,11 +25,12 @@ Here are most of the steps we (maintainers) follow when 
making a release.
 FIXME: enable excluded programs like arch? to get their manual pages?
 
 * Check for new file system types by running the following command on
-  a system with the most recent kernel possible (e.g., Fedora rawhide):
+  a system with the most recent kernel possible, or with the latest
+  upstream include/uapi/linux/magic.h made available at src/fs-latest-magic.h
 
-    make -C src fs-magic-compare
+    make src/fs-magic-compare
 
-  If it finds a new file system magic number, add it to src/stat.c.
+  If it reports new file system magic numbers, add them to src/stat.c.
   If it is a remote file system, add the new S_MAGIC_* name you created
   in stat.c to the list of remote file system types in src/tail.c's
   fremote function.
diff --git a/src/local.mk b/src/local.mk
index 982cd4d..1ae9eff 100644
--- a/src/local.mk
+++ b/src/local.mk
@@ -403,8 +403,8 @@ AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = src/false src/test
 # Also compare against /usr/include/linux/magic.h
 .PHONY: src/fs-magic-compare
 src/fs-magic-compare: src/fs-magic src/fs-kernel-magic src/fs-def
-       join -v1 -t@ src/fs-magic src/fs-def
-       join -v1 -t@ src/fs-kernel-magic src/fs-def
+       @join -v1 -t@ src/fs-magic src/fs-def
+       @join -v1 -t@ src/fs-kernel-magic src/fs-def
 
 CLEANFILES += src/fs-def
 src/fs-def: src/fs.h
@@ -434,7 +434,7 @@ fs_normalize_perl_subst =                   \
 
 CLEANFILES += src/fs-magic
 src/fs-magic: Makefile
-       man statfs \
+       @MANPAGER= man statfs \
          |perl -ne '/File system types:/.../Nobody kno/ and print'     \
          |grep 0x | perl -p                                            \
            $(fs_normalize_perl_subst)                                  \
@@ -442,13 +442,23 @@ src/fs-magic: Makefile
          | $(ASSORT)                                                   \
          > $@-t && mv $@-t $@
 
+DISTCLEANFILES += src/fs-latest-magic.h
+# This rule currently gets the latest header, but probably isn't general
+# enough to enable by default.
+#      @kgit='https://git.kernel.org/cgit/linux/kernel/git'; \
+#      wget -q $$kgit/torvalds/linux.git/plain/include/uapi/linux/magic.h \
+#        -O $@
+src/fs-latest-magic.h:
+       @touch $@
+
 CLEANFILES += src/fs-kernel-magic
-src/fs-kernel-magic: Makefile
-       perl -ne '/^#define.*0x/ and print' /usr/include/linux/magic.h  \
+src/fs-kernel-magic: Makefile src/fs-latest-magic.h
+       @perl -ne '/^#define.*0x/ and print'                            \
+         /usr/include/linux/magic.h src/fs-latest-magic.h              \
          | perl -p                                                     \
            $(fs_normalize_perl_subst)                                  \
          | grep -Ev 'S_MAGIC_EXT[34]|STACK_END'                        \
-         | $(ASSORT)                                                   \
+         | $(ASSORT) -u                                                \
          > $@-t && mv $@-t $@
 
 BUILT_SOURCES += src/fs-is-local.h
-- 
1.7.7.6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]