[asterisk-commits] rizzo: trunk r88675 - /trunk/Makefile

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Nov 5 13:22:56 CST 2007


Author: rizzo
Date: Mon Nov  5 13:22:56 2007
New Revision: 88675

URL: http://svn.digium.com/view/asterisk?view=rev&rev=88675
Log:
Cleanup the installation of samples, avoiding repetitions.

I am preserving the behaviour on *.adsi files,
i.e. overwrite anything there without making a backup.
However I am not sure that this is the intended behaviour.


Modified:
    trunk/Makefile

Modified: trunk/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/Makefile?view=diff&rev=88675&r1=88674&r2=88675
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Mon Nov  5 13:22:56 2007
@@ -539,32 +539,42 @@
 
 upgrade: bininstall
 
+# XXX why *.adsi is installed first ?
 adsi:
-	mkdir -p $(DESTDIR)$(ASTETCDIR)
-	for x in configs/*.adsi; do \
-		if [ ! -f $(DESTDIR)$(ASTETCDIR)/$$x ]; then \
-			$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
+	@echo Installing adsi config files...
+	@mkdir -p $(DESTDIR)$(ASTETCDIR)
+	@for x in configs/*.adsi; do \
+		dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`" ; \
+		if [ -f $${dst} ] ; then \
+			echo "Overwriting $$x" ; \
+		else \
+			echo "Installing $$x" ; \
 		fi ; \
+		$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
 	done
 
 samples: adsi
-	mkdir -p $(DESTDIR)$(ASTETCDIR)
-	for x in configs/*.sample; do \
-		if [ -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ]; then \
+	@echo Installing other config files...
+	@mkdir -p $(DESTDIR)$(ASTETCDIR)
+	@for x in configs/*.sample; do \
+		dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`" ;	\
+		if [ -f $${dst} ]; then \
 			if [ "$(OVERWRITE)" = "y" ]; then \
-				if cmp -s $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` $$x ; then \
+				if cmp -s $${dst} $$x ; then \
 					echo "Config file $$x is unchanged"; \
 					continue; \
 				fi ; \
-				mv -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`.old ; \
+				mv -f $${dst} $${dst}.old ; \
 			else \
 				echo "Skipping config file $$x"; \
 				continue; \
 			fi ;\
 		fi ; \
-		$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ;\
+		echo "Installing file $$x"; \
+		$(INSTALL) -m 644 $$x $${dst} ;\
 	done
-	if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+	@if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+		echo "Creating asterisk.conf"; \
 		( \
 		echo "[directories]" ; \
 		echo "astetcdir => $(ASTETCDIR)" ; \




More information about the asterisk-commits mailing list