mirror of https://github.com/vitalif/e2fsprogs
Refine the build process to avoid re-running subst all the time on
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.bitmap-optimize
parent
9dd97ae37d
commit
dd60705665
|
@ -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>
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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) \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 - \
|
||||
|
|
|
@ -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
|
||||
|
|
22
util/subst.c
22
util/subst.c
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue