summaryrefslogtreecommitdiff
path: root/misc/Makefile.in
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2008-07-16 13:39:32 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-07-16 15:07:56 -0400
commit03ce7afaba3f29c65766c6922d6c276b28b4bf1c (patch)
tree4e9af12aa8a4c6b9adeb06883c31c2367f3c2325 /misc/Makefile.in
parent929424f4f8507e72f6c5f0109ad0b5479d19e4e9 (diff)
downloade2fsprogs-03ce7afaba3f29c65766c6922d6c276b28b4bf1c.tar.gz
Add more intelligent handling of the mke2fs.conf installation process
For people who are compiling mke2fs for their own use outside of a package manager, we need to make sure the system /etc/mke2fs.conf is sufficiently up-to-date that it won't cause problems, but at the same time we don't want to blow away any user-specific customizations. So if /etc/mk2fs.conf exists, but does not mention ext4dev, we will move it aside to /etc/mke2fs.conf.e2fsprogs-old and then install the new mke2fs.conf. If the /etc/mke2fs.conf file exists but does mention ext4dev, we install the new mke2fs.conf file as /etc/mke2fs.conf.e2fsprogs-new. In both cases we print a warning mesage to the user so they can manually update /etc/mke2fs.conf with any changes if they so desire. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'misc/Makefile.in')
-rw-r--r--misc/Makefile.in25
1 files changed, 24 insertions, 1 deletions
diff --git a/misc/Makefile.in b/misc/Makefile.in
index a8d10184..a81df8a6 100644
--- a/misc/Makefile.in
+++ b/misc/Makefile.in
@@ -343,7 +343,30 @@ install: all $(SMANPAGES) $(UMANPAGES) installdirs
echo " INSTALL_DATA $(man5dir)/$$i"; \
$(INSTALL_DATA) $$i $(DESTDIR)$(man5dir)/$$i; \
done
- @if ! test -f $(DESTDIR)$(root_sysconfdir)/mke2fs.conf; then \
+ @if test -f $(DESTDIR)$(root_sysconfdir)/mke2fs.conf; then \
+ if cmp -s $(DESTDIR)$(root_sysconfdir)/mke2fs.conf \
+ $(srcdir)/mke2fs.conf; then \
+ true; \
+ else \
+ if grep -q ext4dev $(DESTDIR)$(root_sysconfdir)/mke2fs.conf ; then \
+ echo " INSTALL_DATA $(root_sysconfdir)/mke2fs.conf.e2fsprogs-new"; \
+ $(INSTALL_DATA) $(srcdir)/mke2fs.conf \
+ $(DESTDIR)$(root_sysconfdir)/mke2fs.conf.e2fsprogs-new; \
+ echo "Warning: installing mke2fs.conf in $(DESTDIR)$(root_sysconfdir)/mke2fs.conf.e2fsprogs-new"; \
+ echo "Check to see if you need to update your $(root_sysconfdir)/mke2fs.conf"; \
+ else \
+ echo " INSTALL_DATA $(root_sysconfdir)/mke2fs.conf"; \
+ mv $(DESTDIR)$(root_sysconfdir)/mke2fs.conf \
+ $(DESTDIR)$(root_sysconfdir)/mke2fs.conf.e2fsprogs-old; \
+ $(INSTALL_DATA) $(srcdir)/mke2fs.conf \
+ $(DESTDIR)$(root_sysconfdir)/mke2fs.conf; \
+ echo "Your mke2fs.conf is too old. Backing up old version in"; \
+ echo "$(DESTDIR)$(root_sysconfdir)/mke2fs.conf.e2fsprogs-old. Please check to see"; \
+ echo "if you have any local customizations that you wish to preserve."; \
+ fi; \
+ echo " "; \
+ fi; \
+ else \
echo " INSTALL_DATA $(root_sysconfdir)/mke2fs.conf"; \
$(INSTALL_DATA) $(srcdir)/mke2fs.conf \
$(DESTDIR)$(root_sysconfdir)/mke2fs.conf; \