]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Refine the build process to avoid re-running subst all the time on
authorTheodore Ts'o <tytso@mit.edu>
Sat, 3 Apr 2004 18:53:46 +0000 (13:53 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 3 Apr 2004 18:53:46 +0000 (13:53 -0500)
some generated files, by having subst update the modtime on these
files even when the generated file hasn't changed.  We do this with
generated files that do not have any downstream dependencies.

18 files changed:
ChangeLog
MCONFIG.in
debugfs/ChangeLog
debugfs/Makefile.in
e2fsck/ChangeLog
e2fsck/Makefile.in
ext2ed/ChangeLog
ext2ed/Makefile.in
lib/blkid/ChangeLog
lib/blkid/Makefile.in
lib/uuid/ChangeLog
lib/uuid/Makefile.in
misc/ChangeLog
misc/Makefile.in
resize/ChangeLog
resize/Makefile.in
util/ChangeLog
util/subst.c

index 26fe6b9634341daf4bf69875df500e87ce2d29c4..e995b7f37120313784a0b4272e7c1b35ba90bfa2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-04-03  Theodore Ts'o  <tytso@mit.edu>
 
+       * MCONFIG.in (SUBSTITUTE_UPTIME): New definition which passes the
+               -t option to subst.
+
        * configure.in: Add test for stdint.h
 
 2004-03-19  Theodore Ts'o  <tytso@mit.edu>
index ba99911c4e44fb6005f76eaeb6df210b80b73cf5..0e9fc6527e5171cba3352302264df8abdf7d14a3 100644 (file)
@@ -109,6 +109,7 @@ LINUX_INCLUDE=@LINUX_INCLUDE@
 #
 SUBST_CONF=$(top_builddir)/util/subst.conf
 SUBSTITUTE= $(top_builddir)/util/subst -f $(SUBST_CONF)
+SUBSTITUTE_UPTIME= $(top_builddir)/util/subst -t -f $(SUBST_CONF)
 DEP_SUBSTITUTE= $(top_builddir)/util/subst $(SUBST_CONF)
 
 $(top_builddir)/util/subst:
index 3f546c8ee844c8a8a68225c3021883fe301a7714..240a237b80c1f9811d64a54ae28f61f7992e429a 100644 (file)
@@ -1,3 +1,10 @@
+2004-04-03  Theodore Ts'o  <tytso@mit.edu>
+
+       * Makefile.in: Update the modtime even if subst doesn't need to
+               update the debugfs man page, to avoid always re-running
+               subst, especially since there are no dependencies on the
+               man page.
+
 2004-03-20  Theodore Ts'o  <tytso@mit.edu>
 
        * debugfs.c (make_link): Set the filetype information when
index cfc24e9989d4fb386e825120fb1035571cac4060..cb5b90d87a82a04ba6c250fbd9aeb1414f2b1d46 100644 (file)
@@ -41,7 +41,7 @@ debug_cmds.c debug_cmds.h: debug_cmds.ct
        $(MK_CMDS) $(srcdir)/debug_cmds.ct
 
 debugfs.8: $(DEP_SUBSTITUTE) $(srcdir)/debugfs.8.in
-       $(SUBSTITUTE) $(srcdir)/debugfs.8.in debugfs.8
+       $(SUBSTITUTE_UPTIME) $(srcdir)/debugfs.8.in debugfs.8
 
 installdirs:
        $(top_srcdir)/mkinstalldirs $(DESTDIR)$(root_sbindir) \
index dd0d70f0f05066a3532cef968cf38ba89a1a7d07..280860e6a02fc5660ca1d8fe26f008880fdeb2eb 100644 (file)
@@ -1,3 +1,10 @@
+2004-04-03  Theodore Ts'o  <tytso@mit.edu>
+
+       * Makefile.in: Update the modtime even if subst doesn't need to
+               update the e2fsck man page, to avoid always re-running
+               subst, especially since there are no dependencies on the
+               man page.
+
 2004-02-28  Theodore Ts'o  <tytso@mit.edu>
 
        * Release of E2fsprogs 1.35
index 43a674c0be82cafb258c2b28043bd71f483fb702..d91d561632381a3205e15399888ee3d346f569d5 100644 (file)
@@ -137,7 +137,7 @@ profiled:
        mkdir profiled
 
 e2fsck.8: $(DEP_SUBSTITUTE) $(srcdir)/e2fsck.8.in
-       $(SUBSTITUTE) $(srcdir)/e2fsck.8.in e2fsck.8
+       $(SUBSTITUTE_UPTIME) $(srcdir)/e2fsck.8.in e2fsck.8
 
 installdirs:
        $(top_srcdir)/mkinstalldirs $(DESTDIR)$(root_sbindir) \
index 150871d037fe355231941111934f4d7f62c54438..c233a754ea61a192e72dc86ac848230fde2daa43 100644 (file)
@@ -1,3 +1,10 @@
+2004-04-03  Theodore Ts'o  <tytso@mit.edu>
+
+       * Makefile.in: Update the modtime even if subst doesn't need to
+               update the ext2ed man page and conbfiguration, to avoid
+               always re-running subst, especially since there are no
+               dependencies on these generated files.
+
 2004-02-28  Theodore Ts'o  <tytso@mit.edu>
 
        * Release of E2fsprogs 1.35
index a581ee3f31fbfe66f569983f676c1fade1b75192..610635a07f02e92d4c4e9f381866e23e7522c5ec 100644 (file)
@@ -60,10 +60,10 @@ ext2ed: $(OBJS)
        $(CC) $(ALL_LDFLAGS) -o ext2ed $(OBJS) $(LIBS)
 
 ext2ed.8: $(DEP_SUBSTITUTE) $(srcdir)/ext2ed.8.in
-       $(SUBSTITUTE) $(srcdir)/ext2ed.8.in ext2ed.8
+       $(SUBSTITUTE_UPTIME) $(srcdir)/ext2ed.8.in ext2ed.8
 
 ext2ed.conf: $(DEP_SUBSTITUTE) $(srcdir)/ext2ed.conf.in
-       $(SUBSTITUTE) $(srcdir)/ext2ed.conf.in ext2ed.conf
+       $(SUBSTITUTE_UPTIME) $(srcdir)/ext2ed.conf.in ext2ed.conf
 
 clean:
        $(RM) -f ext2ed $(OBJS) $(DOCS) ext2ed.conf ext2ed.8
index cd26bbfd64cef9c6718022a0d678eb0c0ed89ed3..022b4ba50cecc4d96314acf4db4292c84e70644b 100644 (file)
@@ -1,3 +1,10 @@
+2004-04-03  Theodore Ts'o  <tytso@mit.edu>
+
+       * Makefile.in: Update the modtime even if subst doesn't need to
+               update the libblkid man page, to avoid always re-running
+               subst, especially since there are no dependencies on the
+               man page.
+
 2004-04-03  Theodore Ts'o  <tytso@mit.edu>
 
        * blkid_types.h.in: Remove check for _UUID_TYPES since uuid_types.h
index 5e27184f6e50d4b3d8a8884990c2e5d34709cdad..0f82f60b074fa6f5b47c4788031b6fd75ea3027f 100644 (file)
@@ -68,7 +68,7 @@ $(top_builddir)/lib/blkid/blkid_types.h: $(srcdir)/blkid_types.h.in $(top_buildd
        cd $(top_builddir); CONFIG_FILES=$(my_dir)/blkid_types.h ./config.status
 
 libblkid.3: $(DEP_SUBSTITUTE) $(srcdir)/libblkid.3.in
-       $(SUBSTITUTE) $(srcdir)/libblkid.3.in libblkid.3
+       $(SUBSTITUTE_UPTIME) $(srcdir)/libblkid.3.in libblkid.3
 
 tst_cache: $(srcdir)/cache.c $(DEPLIBS_BLKID)
        $(CC) -o tst_cache -DTEST_PROGRAM $(srcdir)/cache.c $(LIBS_BLKID) $(ALL_CFLAGS)
index 6de5b963ea6c5aa86f4a1a3c4fa307a1cece873c..fd665c53cf7b9ccb130cc5c6e8e41d41c02ca4c5 100644 (file)
@@ -1,3 +1,10 @@
+2004-04-03  Theodore Ts'o  <tytso@mit.edu>
+
+       * Makefile.in: Update the modtime even if subst doesn't need to
+               update the libuuid man pages, to avoid always re-running
+               subst, especially since there are no dependencies on the
+               man page.
+
 2004-04-03  Theodore Ts'o  <tytso@mit.edu>
 
        * libuuid.3.in, uuid_clear.3.in, uuid_compare.3.in, uuid_copy.3.in,
index ba9326a36bbe763d84a945b3956efa63fa258aed..3c68eb23ac1453edd5216d39c951379d7afa18d1 100644 (file)
@@ -94,31 +94,31 @@ uuid_time: $(srcdir)/uuid_time.c $(DEPLIBUUID)
                $(LIBUUID)
 
 libuuid.3: $(DEP_SUBSTITUTE) $(srcdir)/libuuid.3.in
-       $(SUBSTITUTE) $(srcdir)/libuuid.3.in libuuid.3
+       $(SUBSTITUTE_UPTIME) $(srcdir)/libuuid.3.in libuuid.3
 
 uuid_clear.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_clear.3.in
-       $(SUBSTITUTE) $(srcdir)/uuid_clear.3.in uuid_clear.3
+       $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_clear.3.in uuid_clear.3
 
 uuid_compare.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_compare.3.in
-       $(SUBSTITUTE) $(srcdir)/uuid_compare.3.in uuid_compare.3
+       $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_compare.3.in uuid_compare.3
 
 uuid_copy.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_copy.3.in
-       $(SUBSTITUTE) $(srcdir)/uuid_copy.3.in uuid_copy.3
+       $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_copy.3.in uuid_copy.3
 
 uuid_generate.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_generate.3.in
-       $(SUBSTITUTE) $(srcdir)/uuid_generate.3.in uuid_generate.3
+       $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_generate.3.in uuid_generate.3
 
 uuid_is_null.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_is_null.3.in
-       $(SUBSTITUTE) $(srcdir)/uuid_is_null.3.in uuid_is_null.3
+       $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_is_null.3.in uuid_is_null.3
 
 uuid_parse.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_parse.3.in
-       $(SUBSTITUTE) $(srcdir)/uuid_parse.3.in uuid_parse.3
+       $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_parse.3.in uuid_parse.3
 
 uuid_time.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_time.3.in
-       $(SUBSTITUTE) $(srcdir)/uuid_time.3.in uuid_time.3
+       $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_time.3.in uuid_time.3
 
 uuid_unparse.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid_unparse.3.in
-       $(SUBSTITUTE) $(srcdir)/uuid_unparse.3.in uuid_unparse.3
+       $(SUBSTITUTE_UPTIME) $(srcdir)/uuid_unparse.3.in uuid_unparse.3
 
 installdirs::
        $(top_srcdir)/mkinstalldirs $(DESTDIR)$(libdir)  \
index 70d5e6cf09a6f7a070c6ef11878b5e3bb956b148..c50c9cd585cdba338dcffd26fc1b8edd4b53a2d8 100644 (file)
@@ -1,3 +1,10 @@
+2004-04-03  Theodore Ts'o  <tytso@mit.edu>
+
+       * Makefile.in: Update the modtime even if subst doesn't need to
+               update the man pages, to avoid always re-running
+               subst, especially since there are no dependencies on these
+               generated files.
+
 2004-03-21  Theodore Ts'o  <tytso@mit.edu>
 
        * blkid.c: Remove the partially implemented -p option (it never
index 53d81a022d3aa5cfbb0076e3ec5963da412d7ae5..61176ef39f93f8ef690110d35b559e951911e56e 100644 (file)
@@ -121,52 +121,52 @@ filefrag: $(FILEFRAG_OBJS)
        $(CC) $(ALL_LDFLAGS) -o filefrag $(FILEFRAG_OBJS) 
 
 tune2fs.8: $(DEP_SUBSTITUTE) $(srcdir)/tune2fs.8.in
-       $(SUBSTITUTE) $(srcdir)/tune2fs.8.in tune2fs.8
+       $(SUBSTITUTE_UPTIME) $(srcdir)/tune2fs.8.in tune2fs.8
 
 mklost+found.8: $(DEP_SUBSTITUTE) $(srcdir)/mklost+found.8.in
-       $(SUBSTITUTE) $(srcdir)/mklost+found.8.in mklost+found.8
+       $(SUBSTITUTE_UPTIME) $(srcdir)/mklost+found.8.in mklost+found.8
 
 mke2fs.8: $(DEP_SUBSTITUTE) $(srcdir)/mke2fs.8.in
-       $(SUBSTITUTE) $(srcdir)/mke2fs.8.in mke2fs.8
+       $(SUBSTITUTE_UPTIME) $(srcdir)/mke2fs.8.in mke2fs.8
 
 e2label.8: $(DEP_SUBSTITUTE) $(srcdir)/e2label.8.in
-       $(SUBSTITUTE) $(srcdir)/e2label.8.in e2label.8
+       $(SUBSTITUTE_UPTIME) $(srcdir)/e2label.8.in e2label.8
 
 findfs.8: $(DEP_SUBSTITUTE) $(srcdir)/findfs.8.in
-       $(SUBSTITUTE) $(srcdir)/findfs.8.in findfs.8
+       $(SUBSTITUTE_UPTIME) $(srcdir)/findfs.8.in findfs.8
 
 e2image.8: $(DEP_SUBSTITUTE) $(srcdir)/e2image.8.in
-       $(SUBSTITUTE) $(srcdir)/e2image.8.in e2image.8
+       $(SUBSTITUTE_UPTIME) $(srcdir)/e2image.8.in e2image.8
 
 dumpe2fs.8: $(DEP_SUBSTITUTE) $(srcdir)/dumpe2fs.8.in 
-       $(SUBSTITUTE) $(srcdir)/dumpe2fs.8.in dumpe2fs.8
+       $(SUBSTITUTE_UPTIME) $(srcdir)/dumpe2fs.8.in dumpe2fs.8
 
 badblocks.8: $(DEP_SUBSTITUTE) $(srcdir)/badblocks.8.in
-       $(SUBSTITUTE) $(srcdir)/badblocks.8.in badblocks.8      
+       $(SUBSTITUTE_UPTIME) $(srcdir)/badblocks.8.in badblocks.8       
 
 fsck.8: $(DEP_SUBSTITUTE) $(srcdir)/fsck.8.in
-       $(SUBSTITUTE) $(srcdir)/fsck.8.in fsck.8 
+       $(SUBSTITUTE_UPTIME) $(srcdir)/fsck.8.in fsck.8 
 
 blkid.8: $(DEP_SUBSTITUTE) $(srcdir)/blkid.8.in
-       $(SUBSTITUTE) $(srcdir)/blkid.8.in blkid.8
+       $(SUBSTITUTE_UPTIME) $(srcdir)/blkid.8.in blkid.8
 
 logsave.8: $(DEP_SUBSTITUTE) $(srcdir)/logsave.8.in
-       $(SUBSTITUTE) $(srcdir)/logsave.8.in logsave.8
+       $(SUBSTITUTE_UPTIME) $(srcdir)/logsave.8.in logsave.8
 
 chattr.1: $(DEP_SUBSTITUTE) $(srcdir)/chattr.1.in
-       $(SUBSTITUTE) $(srcdir)/chattr.1.in chattr.1 
+       $(SUBSTITUTE_UPTIME) $(srcdir)/chattr.1.in chattr.1 
 
 lsattr.1: $(DEP_SUBSTITUTE) $(srcdir)/lsattr.1.in 
-       $(SUBSTITUTE) $(srcdir)/lsattr.1.in lsattr.1 
+       $(SUBSTITUTE_UPTIME) $(srcdir)/lsattr.1.in lsattr.1 
 
 uuidgen.1: $(DEP_SUBSTITUTE) $(srcdir)/uuidgen.1.in 
-       $(SUBSTITUTE) $(srcdir)/uuidgen.1.in uuidgen.1 
+       $(SUBSTITUTE_UPTIME) $(srcdir)/uuidgen.1.in uuidgen.1 
 
 blkid.1: $(DEP_SUBSTITUTE) $(srcdir)/blkid.1.in 
-       $(SUBSTITUTE) $(srcdir)/blkid.1.in blkid.1 
+       $(SUBSTITUTE_UPTIME) $(srcdir)/blkid.1.in blkid.1 
 
 filefrag.8: $(DEP_SUBSTITUTE) $(srcdir)/filefrag.8.in
-       $(SUBSTITUTE) $(srcdir)/filefrag.8.in filefrag.8
+       $(SUBSTITUTE_UPTIME) $(srcdir)/filefrag.8.in filefrag.8
 
 installdirs:
        $(top_srcdir)/mkinstalldirs $(DESTDIR)$(sbindir) \
index 217a8bc936fc08c32a61e9f1eda8212666eaf622..aa52dc0c46da0fd100076d47e0a5708960c12da5 100644 (file)
@@ -1,3 +1,10 @@
+2004-04-03  Theodore Ts'o  <tytso@mit.edu>
+
+       * Makefile.in: Update the modtime even if subst doesn't need to
+               update the resize2fs man page, to avoid always re-running
+               subst, especially since there are no dependencies on the
+               man page.
+
 2004-02-28  Theodore Ts'o  <tytso@mit.edu>
 
        * Release of E2fsprogs 1.35
index 2ea4979bc24ea28554b774b19c5a239a6e5bc5e8..c9dff22f2fc5fc3491e4e2dc837e9e9b5e3f85fb 100644 (file)
@@ -44,11 +44,11 @@ resize2fs.static: $(RESIZE_OBJS)  $(STATIC_DEPLIBS)
                $(RESIZE_OBJS) $(STATIC_LIBS) 
 
 resize2fs.8: $(DEP_SUBSTITUTE) $(srcdir)/resize2fs.8.in
-       $(SUBSTITUTE) $(srcdir)/resize2fs.8.in resize2fs.8
+       $(SUBSTITUTE_UPTIME) $(srcdir)/resize2fs.8.in resize2fs.8
 
 test_extent: $(TEST_EXTENT_OBJS)
        $(CC) $(ALL_LDFLAGS) -o test_extent $(TEST_EXTENT_OBJS) $(LIBS) 
-       
+
 installdirs:
        $(top_srcdir)/mkinstalldirs $(DESTDIR)$(root_sbindir) \
                $(DESTDIR)$(man8dir)
@@ -85,7 +85,7 @@ check:: test_extent.out
                diff test_extent.out $(srcdir)/test_extent.in ; \
                exit 1 ; \
        fi
-       
+
 clean:
        $(RM) -f $(PROGS) $(TEST_PROGS) $(MANPAGES) \#* *.s *.o *.a *~ core \
                resize2fs.static test_extent.out
@@ -116,7 +116,7 @@ $(top_srcdir)/.exclude-file:
                >> $(top_srcdir)/.exclude-file
        echo $(SRCROOT)/e2fsprogs-ALL-@E2FSPROGS_VERSION@.tar.gz \
                >> $(top_srcdir)/.exclude-file
-       
+
 source_tar_file: $(top_srcdir)/.exclude-file
        (cd $(top_srcdir)/..; a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
                $(TAR) -c -h -v -f - \
index 6625403521e35813b6f8de66b33502a06ed63f70..ec2a01c0cae6eafdfb816b9f60e8c9ac2388c3d0 100644 (file)
@@ -1,3 +1,8 @@
+2004-04-03  Theodore Ts'o  <tytso@mit.edu>
+
+       * subst.c (main): Add new option to update the timestamp of the
+               generated file.
+
 2004-02-28  Theodore Ts'o  <tytso@mit.edu>
 
        * Release of E2fsprogs 1.35
index dff1848bc70535dee780891a5d6b599b48f06068..0c618a868f03b572056c221dc2c04d92ea6378da 100644 (file)
@@ -11,6 +11,9 @@
 #include <unistd.h>
 #include <string.h>
 #include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <utime.h>
 
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
@@ -289,7 +292,6 @@ static int compare_file(const char *outfn, const char *newfn)
        return retval;
 }
 
-       
 
 
 int main(int argc, char **argv)
@@ -299,8 +301,11 @@ int main(int argc, char **argv)
        FILE    *in, *out;
        char    *outfn = NULL, *newfn = NULL;
        int     verbose = 0;
+       int     adjust_timestamp = 0;
+       struct stat stbuf;
+       struct utimbuf ut;
        
-       while ((c = getopt (argc, argv, "f:v")) != EOF) {
+       while ((c = getopt (argc, argv, "f:tv")) != EOF) {
                switch (c) {
                case 'f':
                        in = fopen(optarg, "r");
@@ -311,6 +316,9 @@ int main(int argc, char **argv)
                        parse_config_file(in);
                        fclose(in);
                        break;
+               case 't':
+                       adjust_timestamp++;
+                       break;
                case 'v':
                        verbose++;
                        break;
@@ -361,6 +369,16 @@ int main(int argc, char **argv)
                if (compare_file(outfn, newfn)) {
                        if (verbose)
                                printf("No change, keeping %s.\n", outfn);
+                       if (adjust_timestamp) {
+                               if (stat(outfn, &stbuf) == 0) {
+                                       if (verbose)
+                                               printf("Updating modtime for %s\n", outfn);
+                                       ut.actime = stbuf.st_atime;
+                                       ut.modtime = time(0);
+                                       if (utime(outfn, &ut) < 0)
+                                               perror("utime");
+                               }
+                       }
                        unlink(newfn);
                } else {
                        if (verbose)