[stgt] [PATCH] don't overwrite the config file for tgt-admin if it's already there

Tomasz Chmielewski mangoo at wpkg.org
Mon Oct 26 10:48:10 CET 2009


Right now, "make install" will overwrite a config file for tgt-admin placed in /etc/tgt/targets.conf.

Generally, one don't want to overwrite it - so copy the default file only if it's not there already.


Signed-off-by: Tomasz Chmielewski <mangoo at wpkg.org>

diff --git a/conf/Makefile b/conf/Makefile
index 4f5ae77..0ef29ab 100644
--- a/conf/Makefile
+++ b/conf/Makefile
@@ -6,7 +6,9 @@ all:
 .PHONY: install
 install:
        install -d -m 755 $(DESTDIR)$(sysconfdir)/tgt
-       install -m 644 targets.conf $(DESTDIR)$(sysconfdir)/tgt
+       if [ ! -f $(DESTDIR)$(sysconfdir)/tgt/targets.conf ] ; then \
+               install -m 644 targets.conf $(DESTDIR)$(sysconfdir)/tgt ; \
+       fi

 .PHONY: clean
 clean:



-- 
Tomasz Chmielewski
http://wpkg.org
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list