[asterisk-commits] qwell: tag 1.8.6.0-rc2 r332928 - in /tags/1.8.6.0-rc2: ./ agi/ funcs/ main/ s...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 22 15:28:30 CDT 2011


Author: qwell
Date: Mon Aug 22 15:28:22 2011
New Revision: 332928

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=332928
Log:
------------------------------------------------------------------------
r331575 | rmudgett | 2011-08-11 16:39:58 -0500 (Thu, 11 Aug 2011) | 9 lines

Segfault in shell_helper in func_shell.c.

The return value of popen() was not checked for failure to open.

(closes issue ASTERISK-18109)
JIRA SWP-3633
Reported by: Michael Myles
Tested by: rmudgett

------------------------------------------------------------------------
r332355 | tilghman | 2011-08-17 14:21:36 -0500 (Wed, 17 Aug 2011) | 13 lines

Re-add support for spaces in pathnames, including now spaces in DESTDIR.

This was initially added to 1.8 prior to release, primarily to support the
standard paths on Mac OS X, but was partially reverted recently in Subversion,
due to the lack of support for spaces in DESTDIR.  This commit restores support
for the standard paths on Mac OS X, and also includes support for spaces in
DESTDIR.

(closes issue ASTERISK-18290)
Reported by: pabelanger

Review: https://reviewboard.asterisk.org/r/1326/

------------------------------------------------------------------------
r332559 | twilson | 2011-08-18 16:26:01 -0500 (Thu, 18 Aug 2011) | 7 lines

Fix possible error on stringification of IPv4-mapped addrs

The FreeBSD netsock2 test has been failing for a while. We were
pasing sa->len to getnameinfo instead of sa_tmp->len.

ASTERISK-18289

------------------------------------------------------------------------

Modified:
    tags/1.8.6.0-rc2/Makefile
    tags/1.8.6.0-rc2/Makefile.moddir_rules
    tags/1.8.6.0-rc2/agi/Makefile
    tags/1.8.6.0-rc2/configure
    tags/1.8.6.0-rc2/configure.ac
    tags/1.8.6.0-rc2/funcs/func_shell.c
    tags/1.8.6.0-rc2/main/netsock2.c
    tags/1.8.6.0-rc2/makeopts.in
    tags/1.8.6.0-rc2/sounds/Makefile
    tags/1.8.6.0-rc2/utils/Makefile

Modified: tags/1.8.6.0-rc2/Makefile
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.6.0-rc2/Makefile?view=diff&rev=332928&r1=332927&r2=332928
==============================================================================
--- tags/1.8.6.0-rc2/Makefile (original)
+++ tags/1.8.6.0-rc2/Makefile Mon Aug 22 15:28:22 2011
@@ -155,8 +155,8 @@
 GLOBAL_MAKEOPTS=$(wildcard /etc/asterisk.makeopts)
 USER_MAKEOPTS=$(wildcard ~/.asterisk.makeopts)
 
-MOD_SUBDIR_CFLAGS=-I$(ASTTOPDIR)/include
-OTHER_SUBDIR_CFLAGS=-I$(ASTTOPDIR)/include
+MOD_SUBDIR_CFLAGS="-I$(ASTTOPDIR)/include"
+OTHER_SUBDIR_CFLAGS="-I$(ASTTOPDIR)/include"
 
 # Create OPTIONS variable, but probably we can assign directly to ASTCFLAGS
 OPTIONS=
@@ -453,17 +453,17 @@
 	rm -f build_tools/menuselect-deps
 
 datafiles: _all doc/core-en_US.xml
-	CFLAGS="$(_ASTCFLAGS) $(ASTCFLAGS)" build_tools/mkpkgconfig $(DESTDIR)$(libdir)/pkgconfig;
+	CFLAGS="$(_ASTCFLAGS) $(ASTCFLAGS)" build_tools/mkpkgconfig "$(DESTDIR)$(libdir)/pkgconfig";
 # Should static HTTP be installed during make samples or even with its own target ala
 # webvoicemail?  There are portions here that *could* be customized but might also be
 # improved a lot.  I'll put it here for now.
 
 	for x in static-http/*; do \
-		$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/static-http ; \
+		$(INSTALL) -m 644 $$x "$(DESTDIR)$(ASTDATADIR)/static-http" ; \
 	done
-	$(INSTALL) -m 644 doc/core-en_US.xml $(DESTDIR)$(ASTDATADIR)/static-http;
+	$(INSTALL) -m 644 doc/core-en_US.xml "$(DESTDIR)$(ASTDATADIR)/static-http";
 	for x in images/*.jpg; do \
-		$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/images ; \
+		$(INSTALL) -m 644 $$x "$(DESTDIR)$(ASTDATADIR)/images" ; \
 	done
 	$(MAKE) -C sounds install
 
@@ -512,7 +512,7 @@
 	fi
 
 NEWHEADERS=$(notdir $(wildcard include/asterisk/*.h))
-OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
+OLDHEADERS=$(filter-out $(NEWHEADERS) $(notdir $(DESTDIR)$(ASTHEADERDIR)),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
 
 installdirs:
 	$(INSTALL) -d "$(DESTDIR)$(MODULES_DIR)"
@@ -546,37 +546,37 @@
 	$(INSTALL) -d "$(DESTDIR)$(ASTDBDIR)"
 
 bininstall: _all installdirs $(SUBDIRS_INSTALL)
-	$(INSTALL) -m 755 main/asterisk $(DESTDIR)$(ASTSBINDIR)/
-	$(LN) -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
-	$(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
-	$(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
-	if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk -a ! -f /sbin/launchd ]; then \
+	$(INSTALL) -m 755 main/asterisk "$(DESTDIR)$(ASTSBINDIR)/"
+	$(LN) -sf asterisk "$(DESTDIR)$(ASTSBINDIR)/rasterisk"
+	$(INSTALL) -m 755 contrib/scripts/astgenkey "$(DESTDIR)$(ASTSBINDIR)/"
+	$(INSTALL) -m 755 contrib/scripts/autosupport "$(DESTDIR)$(ASTSBINDIR)/"
+	if [ ! -f "$(DESTDIR)$(ASTSBINDIR)/safe_asterisk" -a ! -f /sbin/launchd ]; then \
 		cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/scripts/safe.tmp ; \
-		$(INSTALL) -m 755 contrib/scripts/safe.tmp $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ; \
+		$(INSTALL) -m 755 contrib/scripts/safe.tmp "$(DESTDIR)$(ASTSBINDIR)/safe_asterisk" ; \
 		rm -f contrib/scripts/safe.tmp ; \
 	fi
-	$(INSTALL) -m 644 include/asterisk.h $(DESTDIR)$(includedir)
-	$(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
-	$(INSTALL) -m 644 include/asterisk/doxygen/*.h $(DESTDIR)$(ASTHEADERDIR)/doxygen
+	$(INSTALL) -m 644 include/asterisk.h "$(DESTDIR)$(includedir)"
+	$(INSTALL) -m 644 include/asterisk/*.h "$(DESTDIR)$(ASTHEADERDIR)"
+	$(INSTALL) -m 644 include/asterisk/doxygen/*.h "$(DESTDIR)$(ASTHEADERDIR)/doxygen"
 	if [ -n "$(OLDHEADERS)" ]; then \
-		rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
+		for h in $(OLDHEADERS); do rm -f "$(DESTDIR)$(ASTHEADERDIR)/$$h"; done \
 	fi
 
-	$(INSTALL) -m 644 doc/core-*.xml $(DESTDIR)$(ASTDATADIR)/documentation
-	$(INSTALL) -m 644 doc/appdocsxml.dtd $(DESTDIR)$(ASTDATADIR)/documentation
-	$(INSTALL) -m 644 doc/asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
-	$(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
-	$(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
-	$(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+	$(INSTALL) -m 644 doc/core-*.xml "$(DESTDIR)$(ASTDATADIR)/documentation"
+	$(INSTALL) -m 644 doc/appdocsxml.dtd "$(DESTDIR)$(ASTDATADIR)/documentation"
+	$(INSTALL) -m 644 doc/asterisk.8 "$(DESTDIR)$(ASTMANDIR)/man8"
+	$(INSTALL) -m 644 contrib/scripts/astgenkey.8 "$(DESTDIR)$(ASTMANDIR)/man8"
+	$(INSTALL) -m 644 contrib/scripts/autosupport.8 "$(DESTDIR)$(ASTMANDIR)/man8"
+	$(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 "$(DESTDIR)$(ASTMANDIR)/man8"
 	if [ -f contrib/firmware/iax/iaxy.bin ] ; then \
-		$(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin; \
+		$(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin "$(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin"; \
 	fi
 
 $(SUBDIRS_INSTALL):
 	+ at DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" $(SUBMAKE) -C $(@:-install=) install 
 
 NEWMODS:=$(foreach d,$(MOD_SUBDIRS),$(notdir $(wildcard $(d)/*.so)))
-OLDMODS=$(filter-out $(NEWMODS),$(notdir $(wildcard $(DESTDIR)$(MODULES_DIR)/*.so)))
+OLDMODS=$(filter-out $(NEWMODS) $(notdir $(DESTDIR)$(MODULES_DIR)),$(notdir $(wildcard $(DESTDIR)$(MODULES_DIR)/*.so)))
 
 oldmodcheck:
 	@if [ -n "$(OLDMODS)" ]; then \
@@ -603,9 +603,19 @@
 	@exit 1
 endif
 
-install: badshell bininstall datafiles
+preinstall_spaces:
+ifneq ($(MAKE_PREINSTALL),)
+	$(MAKE_PREINSTALL)
+endif
+
+postinstall_spaces:
+ifneq ($(MAKE_POSTINSTALL),)
+	$(MAKE_POSTINSTALL)
+endif
+
+install: preinstall_spaces badshell bininstall datafiles postinstall_spaces
 	@if [ -x /usr/sbin/asterisk-post-install ]; then \
-		/usr/sbin/asterisk-post-install $(DESTDIR) . ; \
+		/usr/sbin/asterisk-post-install "$(DESTDIR)" . ; \
 	fi
 	@echo " +---- Asterisk Installation Complete -------+"  
 	@echo " +                                           +"
@@ -637,7 +647,7 @@
 # XXX why *.adsi is installed first ?
 adsi:
 	@echo Installing adsi config files...
-	$(INSTALL) -d $(DESTDIR)$(ASTETCDIR)
+	$(INSTALL) -d "$(DESTDIR)$(ASTETCDIR)"
 	@for x in configs/*.adsi; do \
 		dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`" ; \
 		if [ -f $${dst} ] ; then \
@@ -645,7 +655,7 @@
 		else \
 			echo "Installing $$x" ; \
 		fi ; \
-		$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
+		$(INSTALL) -m 644 $$x "$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`" ; \
 	done
 
 samples: adsi
@@ -679,38 +689,38 @@
 			-e 's|^astspooldir.*$$|astspooldir => $(ASTSPOOLDIR)|' \
 			-e 's|^astrundir.*$$|astrundir => $(ASTVARRUNDIR)|' \
 			-e 's|^astlogdir.*$$|astlogdir => $(ASTLOGDIR)|' \
-			$(DESTDIR)$(ASTCONFPATH) > $(DESTDIR)$(ASTCONFPATH).tmp ; \
-		$(INSTALL) -m 644 $(DESTDIR)$(ASTCONFPATH).tmp $(DESTDIR)$(ASTCONFPATH) ; \
-		rm -f $(DESTDIR)$(ASTCONFPATH).tmp ; \
+			"$(DESTDIR)$(ASTCONFPATH)" > "$(DESTDIR)$(ASTCONFPATH).tmp" ; \
+		$(INSTALL) -m 644 "$(DESTDIR)$(ASTCONFPATH).tmp" "$(DESTDIR)$(ASTCONFPATH)" ; \
+		rm -f "$(DESTDIR)$(ASTCONFPATH).tmp" ; \
 	fi ; \
-	$(INSTALL) -d $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
-	build_tools/make_sample_voicemail $(DESTDIR)/$(ASTDATADIR) $(DESTDIR)/$(ASTSPOOLDIR)
+	$(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX"
+	build_tools/make_sample_voicemail "$(DESTDIR)/$(ASTDATADIR)" "$(DESTDIR)/$(ASTSPOOLDIR)"
 
 	@for x in phoneprov/*; do \
 		dst="$(DESTDIR)$(ASTDATADIR)/$$x" ;	\
-		if [ -f $${dst} ]; then \
+		if [ -f "$${dst}" ]; then \
 			if [ "$(OVERWRITE)" = "y" ]; then \
-				if cmp -s $${dst} $$x ; then \
+				if cmp -s "$${dst}" "$$x" ; then \
 					echo "Config file $$x is unchanged"; \
 					continue; \
 				fi ; \
-				mv -f $${dst} $${dst}.old ; \
+				mv -f "$${dst}" "$${dst}.old" ; \
 			else \
 				echo "Skipping config file $$x"; \
 				continue; \
 			fi ;\
 		fi ; \
 		echo "Installing file $$x"; \
-		$(INSTALL) -m 644 $$x $${dst} ;\
+		$(INSTALL) -m 644 "$$x" "$${dst}" ;\
 	done
 
 webvmail:
-	@[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
-	@[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
-	$(INSTALL) -m 4755 contrib/scripts/vmail.cgi $(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi
-	$(INSTALL) -d $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
+	@[ -d "$(DESTDIR)$(HTTP_DOCSDIR)/" ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
+	@[ -d "$(DESTDIR)$(HTTP_CGIDIR)" ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
+	$(INSTALL) -m 4755 contrib/scripts/vmail.cgi "$(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi"
+	$(INSTALL) -d "$(DESTDIR)$(HTTP_DOCSDIR)/_asterisk"
 	for x in images/*.gif; do \
-		$(INSTALL) -m 644 $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \
+		$(INSTALL) -m 644 $$x "$(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/"; \
 	done
 	@echo " +--------- Asterisk Web Voicemail ----------+"  
 	@echo " +                                           +"
@@ -735,75 +745,75 @@
 	echo "PROJECT_NUMBER=$(ASTERISKVERSION)") | doxygen - 
 
 install-logrotate:
-	if [ ! -d $(ASTETCDIR)/../logrotate.d ]; then \
-		$(INSTALL) -d $(ASTETCDIR)/../logrotate.d ; \
+	if [ ! -d "$(DESTDIR)$(ASTETCDIR)/../logrotate.d" ]; then \
+		$(INSTALL) -d "$(DESTDIR)$(ASTETCDIR)/../logrotate.d" ; \
 	fi
 	sed 's#__LOGDIR__#$(ASTLOGDIR)#g' < contrib/scripts/asterisk.logrotate | sed 's#__SBINDIR__#$(ASTSBINDIR)#g' > contrib/scripts/asterisk.logrotate.tmp
-	$(INSTALL) -m 0644 contrib/scripts/asterisk.logrotate.tmp $(ASTETCDIR)/../logrotate.d/asterisk
+	$(INSTALL) -m 0644 contrib/scripts/asterisk.logrotate.tmp "$(DESTDIR)$(ASTETCDIR)/../logrotate.d/asterisk"
 	rm -f contrib/scripts/asterisk.logrotate.tmp
 
 config:
 	@if [ "${OSARCH}" = "linux-gnu" ]; then \
 		if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \
 			cat contrib/init.d/rc.redhat.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/init.d/rc.asterisk.tmp ; \
-			$(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp $(DESTDIR)/etc/rc.d/init.d/asterisk ; \
+			$(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp "$(DESTDIR)/etc/rc.d/init.d/asterisk" ; \
 			rm -f contrib/init.d/rc.asterisk.tmp ; \
-			if [ ! -f $(DESTDIR)/etc/sysconfig/asterisk ] ; then \
-				$(INSTALL) -m 644 contrib/init.d/etc_default_asterisk $(DESTDIR)/etc/sysconfig/asterisk ; \
+			if [ ! -f "$(DESTDIR)/etc/sysconfig/asterisk" ] ; then \
+				$(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
 			fi ; \
 			if [ -z "$(DESTDIR)" ] ; then \
 				/sbin/chkconfig --add asterisk ; \
 			fi ; \
 		elif [ -f /etc/debian_version ] ; then \
 			cat contrib/init.d/rc.debian.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/init.d/rc.asterisk.tmp ; \
-			$(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp $(DESTDIR)/etc/init.d/asterisk ; \
+			$(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp "$(DESTDIR)/etc/init.d/asterisk" ; \
 			rm -f contrib/init.d/rc.asterisk.tmp ; \
-			if [ ! -f $(DESTDIR)/etc/default/asterisk ] ; then \
-				$(INSTALL) -m 644 contrib/init.d/etc_default_asterisk $(DESTDIR)/etc/default/asterisk ; \
+			if [ ! -f "$(DESTDIR)/etc/default/asterisk" ] ; then \
+				$(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/default/asterisk" ; \
 			fi ; \
 			if [ -z "$(DESTDIR)" ] ; then \
 				/usr/sbin/update-rc.d asterisk defaults 50 91 ; \
 			fi ; \
 		elif [ -f /etc/gentoo-release ] ; then \
 			cat contrib/init.d/rc.gentoo.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/init.d/rc.asterisk.tmp ; \
-			$(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp $(DESTDIR)/etc/init.d/asterisk ; \
+			$(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp "$(DESTDIR)/etc/init.d/asterisk" ; \
 			rm -f contrib/init.d/rc.asterisk.tmp ; \
 			if [ -z "$(DESTDIR)" ] ; then \
 				/sbin/rc-update add asterisk default ; \
 			fi ; \
 		elif [ -f /etc/mandrake-release -o -f /etc/mandriva-release ] ; then \
 			cat contrib/init.d/rc.mandriva.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/init.d/rc.asterisk.tmp ; \
-			$(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp $(DESTDIR)/etc/rc.d/init.d/asterisk ; \
+			$(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp "$(DESTDIR)/etc/rc.d/init.d/asterisk" ; \
 			rm -f contrib/init.d/rc.asterisk.tmp ; \
 			if [ ! -f /etc/sysconfig/asterisk ] ; then \
-				$(INSTALL) -m 644 contrib/init.d/etc_default_asterisk $(DESTDIR)/etc/sysconfig/asterisk ; \
+				$(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
 			fi ; \
 			if [ -z "$(DESTDIR)" ] ; then \
 				/sbin/chkconfig --add asterisk ; \
 			fi ; \
 		elif [ -f /etc/SuSE-release -o -f /etc/novell-release ] ; then \
 			cat contrib/init.d/rc.suse.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/init.d/rc.asterisk.tmp ; \
-			$(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp $(DESTDIR)/etc/init.d/asterisk ;\
+			$(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp "$(DESTDIR)/etc/init.d/asterisk" ;\
 			rm -f contrib/init.d/rc.asterisk.tmp ; \
 			if [ ! -f /etc/sysconfig/asterisk ] ; then \
-				$(INSTALL) -m 644 contrib/init.d/etc_default_asterisk $(DESTDIR)/etc/sysconfig/asterisk ; \
+				$(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
 			fi ; \
 			if [ -z "$(DESTDIR)" ] ; then \
 				/sbin/chkconfig --add asterisk ; \
 			fi ; \
 		elif [ -f /etc/arch-release -o -f /etc/arch-release ] ; then \
 			cat contrib/init.d/rc.archlinux.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/init.d/rc.asterisk.tmp ; \
-			$(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp $(DESTDIR)/etc/rc.d/asterisk ; \
+			$(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp "$(DESTDIR)/etc/rc.d/asterisk" ; \
 			rm -f contrib/init.d/rc.asterisk.tmp ; \
-		elif [ -d $(DESTDIR)/Library/LaunchDaemons ]; then \
-			if [ ! -f $(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist ]; then \
+		elif [ -d "$(DESTDIR)/Library/LaunchDaemons" ]; then \
+			if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist" ]; then \
 				sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' < contrib/init.d/org.asterisk.asterisk.plist > asterisk.plist ; \
-				$(INSTALL) -m 644 asterisk.plist $(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist; \
+				$(INSTALL) -m 644 asterisk.plist "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist"; \
 				rm -f asterisk.plist; \
 			fi; \
-			if [ ! -f $(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist ]; then \
+			if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist" ]; then \
 				sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' < contrib/init.d/org.asterisk.muted.plist > muted.plist ; \
-				$(INSTALL) -m 644 muted.plist $(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist; \
+				$(INSTALL) -m 644 muted.plist "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist"; \
 				rm -f muted.plist; \
 			fi; \
 		elif [ -f /etc/slackware-version ]; then \
@@ -829,19 +839,19 @@
 	+@$(SUBMAKE) -C $(@:-uninstall=) uninstall
 
 _uninstall: $(SUBDIRS_UNINSTALL)
-	rm -f $(DESTDIR)$(MODULES_DIR)/*
-	rm -f $(DESTDIR)$(ASTSBINDIR)/*asterisk*
-	rm -f $(DESTDIR)$(ASTSBINDIR)/astgenkey
-	rm -f $(DESTDIR)$(ASTSBINDIR)/autosupport
-	rm -rf $(DESTDIR)$(ASTHEADERDIR)
-	rm -rf $(DESTDIR)$(ASTDATADIR)/firmware
-	rm -f $(DESTDIR)$(ASTMANDIR)/man8/asterisk.8
-	rm -f $(DESTDIR)$(ASTMANDIR)/man8/astgenkey.8
-	rm -f $(DESTDIR)$(ASTMANDIR)/man8/autosupport.8
-	rm -f $(DESTDIR)$(ASTMANDIR)/man8/safe_asterisk.8
+	rm -f "$(DESTDIR)$(MODULES_DIR)/"*
+	rm -f "$(DESTDIR)$(ASTSBINDIR)/"*asterisk*
+	rm -f "$(DESTDIR)$(ASTSBINDIR)/astgenkey"
+	rm -f "$(DESTDIR)$(ASTSBINDIR)/autosupport"
+	rm -rf "$(DESTDIR)$(ASTHEADERDIR)"
+	rm -rf "$(DESTDIR)$(ASTDATADIR)/firmware"
+	rm -f "$(DESTDIR)$(ASTMANDIR)/man8/asterisk.8"
+	rm -f "$(DESTDIR)$(ASTMANDIR)/man8/astgenkey.8"
+	rm -f "$(DESTDIR)$(ASTMANDIR)/man8/autosupport.8"
+	rm -f "$(DESTDIR)$(ASTMANDIR)/man8/safe_asterisk.8"
 	$(MAKE) -C sounds uninstall
 
-uninstall: _uninstall
+uninstall: preinstall_spaces _uninstall postinstall_spaces
 	@echo " +--------- Asterisk Uninstall Complete -----+"  
 	@echo " + Asterisk binaries, sounds, man pages,     +"  
 	@echo " + headers, modules, and firmware builds,    +"  
@@ -856,12 +866,12 @@
 	@echo " +-------------------------------------------+"  
 
 uninstall-all: _uninstall
-	rm -rf $(DESTDIR)$(ASTLIBDIR)
-	rm -rf $(DESTDIR)$(ASTVARLIBDIR)
-	rm -rf $(DESTDIR)$(ASTDATADIR)
-	rm -rf $(DESTDIR)$(ASTSPOOLDIR)
-	rm -rf $(DESTDIR)$(ASTETCDIR)
-	rm -rf $(DESTDIR)$(ASTLOGDIR)
+	rm -rf "$(DESTDIR)$(ASTLIBDIR)"
+	rm -rf "$(DESTDIR)$(ASTVARLIBDIR)"
+	rm -rf "$(DESTDIR)$(ASTDATADIR)"
+	rm -rf "$(DESTDIR)$(ASTSPOOLDIR)"
+	rm -rf "$(DESTDIR)$(ASTETCDIR)"
+	rm -rf "$(DESTDIR)$(ASTLOGDIR)"
 
 menuconfig: menuselect
 

Modified: tags/1.8.6.0-rc2/Makefile.moddir_rules
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.6.0-rc2/Makefile.moddir_rules?view=diff&rev=332928&r1=332927&r2=332928
==============================================================================
--- tags/1.8.6.0-rc2/Makefile.moddir_rules (original)
+++ tags/1.8.6.0-rc2/Makefile.moddir_rules Mon Aug 22 15:28:22 2011
@@ -122,7 +122,7 @@
 
 install:: all
 	@echo "Installing modules from `basename $(CURDIR)`..."
-	@for x in $(LOADABLE_MODS:%=%.so); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+	@for x in $(LOADABLE_MODS:%=%.so); do $(INSTALL) -m 755 $$x "$(DESTDIR)$(MODULES_DIR)" ; done
 
 uninstall::
 

Modified: tags/1.8.6.0-rc2/agi/Makefile
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.6.0-rc2/agi/Makefile?view=diff&rev=332928&r1=332927&r2=332928
==============================================================================
--- tags/1.8.6.0-rc2/agi/Makefile (original)
+++ tags/1.8.6.0-rc2/agi/Makefile Mon Aug 22 15:28:22 2011
@@ -40,11 +40,11 @@
 eagi-sphinx-test: eagi-sphinx-test.o
 
 install: all
-	$(INSTALL) -d $(DESTDIR)$(AGI_DIR)
-	for x in $(AGIS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(AGI_DIR) ; done
+	$(INSTALL) -d "$(DESTDIR)$(AGI_DIR)"
+	for x in $(AGIS); do $(INSTALL) -m 755 $$x "$(DESTDIR)$(AGI_DIR)" ; done
 
 uninstall:
-	for x in $(AGIS); do rm -f $(DESTDIR)$(AGI_DIR)/$$x ; done
+	for x in $(AGIS); do rm -f "$(DESTDIR)$(AGI_DIR)/$$x" ; done
 
 clean:
 	rm -f *.so *.o look eagi-test eagi-sphinx-test

Modified: tags/1.8.6.0-rc2/configure.ac
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.6.0-rc2/configure.ac?view=diff&rev=332928&r1=332927&r2=332928
==============================================================================
--- tags/1.8.6.0-rc2/configure.ac (original)
+++ tags/1.8.6.0-rc2/configure.ac Mon Aug 22 15:28:22 2011
@@ -129,6 +129,78 @@
      fi
 fi
 
+# $HOME is preferred as our substitute path, unless $HOME contains a space
+for i in ${HOME} /tmp; do
+	if test "${i}" = ""; then continue; fi
+	if test "${i}" = "/"; then continue; fi
+	__ac_path_has_spaces=`echo $HOME | grep ' '`
+	if test "$ac_path_has_spaces" = ""; then :; else continue; fi
+	__ac_substitute_path=${i}
+	break
+done
+
+AC_PROG_LN_S
+__sub_ordinal=1
+MAKE_PREINSTALL=""
+MAKE_POSTINSTALL=""
+
+# It may initially seem a trifle bit excessive to evaluate all of these paths.
+# However, consider that many of these may invoke another variable, such as
+# ${prefix}, by default, which is not resolved until compile time.  If that
+# variable contains a space, then each of the dependent variables will also
+# contain a space and thus will need the special treatment.
+for stdpath in prefix exec_prefix datarootdir datadir includedir infodir libdir libexecdir localstatedir mandir sbindir sharedstatedir sysconfdir astetcdir astsbindir astlibdir astheaderdir astmandir astvarlibdir astspooldir astlogdir astvarrundir astdatadir astdbdir astkeydir; do
+	eval "__ac_path_sub=\${$stdpath}"
+	#echo "__ac_path_sub=$__ac_path_sub"
+	__ac_path_has_var=`sh -c "echo '$__ac_path_sub' | grep '{'"`
+	if test "$__ac_path_has_var" = ""; then :; else
+		__ac_path_sub=`echo $__ac_path_sub | sed 's/{/{MAKE_/'`
+	fi
+
+	__ac_path_has_spaces=`sh -c "echo '$__ac_path_sub' | grep ' '"`
+	if test "$__ac_path_has_spaces" = ""; then
+		eval "MAKE_$stdpath=\$__ac_path_sub"
+	else
+		# Substitute path for a path without a space
+		eval "MAKE_$stdpath=\"$__ac_substitute_path/.asterisk_install_path_${__sub_ordinal}\""
+		MAKE_POSTINSTALL="${MAKE_POSTINSTALL} rm -f \"$__ac_substitute_path/.asterisk_install_path_${__sub_ordinal}\";"
+		MAKE_PREINSTALL="${MAKE_PREINSTALL} rm -f \"$__ac_substitute_path/.asterisk_install_path_${__sub_ordinal}\";"
+		MAKE_PREINSTALL="${MAKE_PREINSTALL} ${LN_S} -f \"\$(DESTDIR)$__ac_path_sub\" \"$__ac_substitute_path/.asterisk_install_path_${__sub_ordinal}\";"
+		__sub_ordinal=$((${__sub_ordinal}+1))
+	fi
+done
+AC_SUBST(MAKE_PREINSTALL)
+AC_SUBST(MAKE_POSTINSTALL)
+AC_SUBST(MAKE_prefix)
+AC_SUBST(MAKE_exec_prefix)
+AC_SUBST(MAKE_datarootdir)
+AC_SUBST(MAKE_datadir)
+AC_SUBST(MAKE_includedir)
+AC_SUBST(MAKE_infodir)
+AC_SUBST(MAKE_libdir)
+AC_SUBST(MAKE_libexecdir)
+AC_SUBST(MAKE_localstatedir)
+AC_SUBST(MAKE_mandir)
+AC_SUBST(MAKE_sbindir)
+AC_SUBST(MAKE_sharedstatedir)
+AC_SUBST(MAKE_sysconfdir)
+AC_SUBST(MAKE_astetcdir)
+AC_SUBST(MAKE_astsbindir)
+AC_SUBST(MAKE_astlibdir)
+AC_SUBST(MAKE_astheaderdir)
+AC_SUBST(MAKE_astmandir)
+AC_SUBST(MAKE_astvarlibdir)
+AC_SUBST(MAKE_astspooldir)
+AC_SUBST(MAKE_astlogdir)
+AC_SUBST(MAKE_astvarrundir)
+AC_SUBST(MAKE_astdatadir)
+AC_SUBST(MAKE_astdbdir)
+AC_SUBST(MAKE_astkeydir)
+
+test "x$MAKE_prefix" = xNONE && MAKE_prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$MAKE_exec_prefix" = xNONE && MAKE_exec_prefix='${prefix}'
+
 BUILD_PLATFORM=${build}
 BUILD_CPU=${build_cpu}
 BUILD_VENDOR=${build_vendor}
@@ -221,7 +293,6 @@
 AST_PROG_LD	# note, does not work on FreeBSD
 AC_PROG_AWK
 AC_PROG_INSTALL
-AC_PROG_LN_S
 AC_PROG_RANLIB
 AST_CHECK_GNU_MAKE
 AC_PROG_EGREP

Modified: tags/1.8.6.0-rc2/funcs/func_shell.c
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.6.0-rc2/funcs/func_shell.c?view=diff&rev=332928&r1=332927&r2=332928
==============================================================================
--- tags/1.8.6.0-rc2/funcs/func_shell.c (original)
+++ tags/1.8.6.0-rc2/funcs/func_shell.c Mon Aug 22 15:28:22 2011
@@ -42,29 +42,38 @@
 static int shell_helper(struct ast_channel *chan, const char *cmd, char *data,
 		                         char *buf, size_t len)
 {
+	int res = 0;
+
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Missing Argument!  Example:  Set(foo=${SHELL(echo \"bar\")})\n");
 		return -1;
 	}
 
-	if (chan)
+	if (chan) {
 		ast_autoservice_start(chan);
+	}
 
 	if (len >= 1) {
 		FILE *ptr;
 		char plbuff[4096];
 
 		ptr = popen(data, "r");
-		while (fgets(plbuff, sizeof(plbuff), ptr)) {
-			strncat(buf, plbuff, len - strlen(buf) - 1);
+		if (ptr) {
+			while (fgets(plbuff, sizeof(plbuff), ptr)) {
+				strncat(buf, plbuff, len - strlen(buf) - 1);
+			}
+			pclose(ptr);
+		} else {
+			ast_log(LOG_WARNING, "Failed to execute shell command '%s'\n", data);
+			res = -1;
 		}
-		pclose(ptr);
 	}
 
-	if (chan)
+	if (chan) {
 		ast_autoservice_stop(chan);
+	}
 
-	return 0;
+	return res;
 }
 
 /*** DOCUMENTATION

Modified: tags/1.8.6.0-rc2/main/netsock2.c
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.6.0-rc2/main/netsock2.c?view=diff&rev=332928&r1=332927&r2=332928
==============================================================================
--- tags/1.8.6.0-rc2/main/netsock2.c (original)
+++ tags/1.8.6.0-rc2/main/netsock2.c Mon Aug 22 15:28:22 2011
@@ -85,7 +85,7 @@
 		sa_tmp = sa;
 	}
 
-	if ((e = getnameinfo((struct sockaddr *)&sa_tmp->ss, sa->len,
+	if ((e = getnameinfo((struct sockaddr *)&sa_tmp->ss, sa_tmp->len,
 			     format & AST_SOCKADDR_STR_ADDR ? host : NULL,
 			     format & AST_SOCKADDR_STR_ADDR ? sizeof(host) : 0,
 			     format & AST_SOCKADDR_STR_PORT ? port : 0,

Modified: tags/1.8.6.0-rc2/makeopts.in
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.6.0-rc2/makeopts.in?view=diff&rev=332928&r1=332927&r2=332928
==============================================================================
--- tags/1.8.6.0-rc2/makeopts.in (original)
+++ tags/1.8.6.0-rc2/makeopts.in Mon Aug 22 15:28:22 2011
@@ -34,6 +34,8 @@
 MD5=@MD5@
 SHA1SUM=@SHA1SUM@
 OPENSSL=@OPENSSL@
+MAKE_PREINSTALL=@MAKE_PREINSTALL@
+MAKE_POSTINSTALL=@MAKE_POSTINSTALL@
 
 BUILD_PLATFORM=@BUILD_PLATFORM@
 BUILD_CPU=@BUILD_CPU@
@@ -91,6 +93,35 @@
 ASTLOGDIR = @astlogdir@
 ASTVARRUNDIR = @astvarrundir@
 
+MAKE_prefix = @MAKE_prefix@
+MAKE_exec_prefix = @MAKE_exec_prefix@
+
+MAKE_datarootdir = @MAKE_datarootdir@
+MAKE_datadir = @MAKE_datadir@
+MAKE_includedir = @MAKE_includedir@
+MAKE_infodir = @MAKE_infodir@
+MAKE_libdir = @MAKE_libdir@
+MAKE_libexecdir = @MAKE_libexecdir@
+MAKE_localstatedir = @MAKE_localstatedir@
+MAKE_mandir = @MAKE_mandir@
+MAKE_sbindir = @MAKE_sbindir@
+MAKE_sharedstatedir = @MAKE_sharedstatedir@
+MAKE_sysconfdir = @MAKE_sysconfdir@
+
+MAKE_ASTSBINDIR = @MAKE_astsbindir@
+MAKE_ASTETCDIR = @MAKE_astetcdir@
+MAKE_ASTHEADERDIR = @MAKE_astheaderdir@
+MAKE_ASTLIBDIR = @MAKE_astlibdir@
+MAKE_ASTMANDIR = @MAKE_astmandir@
+MAKE_astvarlibdir = @MAKE_astvarlibdir@
+MAKE_ASTVARLIBDIR = @MAKE_astvarlibdir@
+MAKE_ASTDATADIR = @MAKE_astdatadir@
+MAKE_ASTDBDIR = @MAKE_astdbdir@
+MAKE_ASTKEYDIR = @MAKE_astkeydir@
+MAKE_ASTSPOOLDIR = @MAKE_astspooldir@
+MAKE_ASTLOGDIR = @MAKE_astlogdir@
+MAKE_ASTVARRUNDIR = @MAKE_astvarrundir@
+
 AST_DEVMODE=@AST_DEVMODE@
 NOISY_BUILD=@NOISY_BUILD@
 

Modified: tags/1.8.6.0-rc2/sounds/Makefile
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.6.0-rc2/sounds/Makefile?view=diff&rev=332928&r1=332927&r2=332928
==============================================================================
--- tags/1.8.6.0-rc2/sounds/Makefile (original)
+++ tags/1.8.6.0-rc2/sounds/Makefile Mon Aug 22 15:28:22 2011
@@ -16,9 +16,9 @@
 -include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/makeopts
 
 CMD_PREFIX?=@
-SOUNDS_DIR:=$(DESTDIR)$(ASTDATADIR)/sounds
+SOUNDS_DIR:=$(MAKE_ASTDATADIR)/sounds
 SOUNDS_CACHE_DIR?=
-MOH_DIR:=$(DESTDIR)$(ASTDATADIR)/moh
+MOH_DIR:=$(MAKE_ASTDATADIR)/moh
 CORE_SOUNDS_VERSION:=1.4.21
 EXTRA_SOUNDS_VERSION:=1.4.11
 MOH_VERSION:=2.03

Modified: tags/1.8.6.0-rc2/utils/Makefile
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.6.0-rc2/utils/Makefile?view=diff&rev=332928&r1=332927&r2=332928
==============================================================================
--- tags/1.8.6.0-rc2/utils/Makefile (original)
+++ tags/1.8.6.0-rc2/utils/Makefile Mon Aug 22 15:28:22 2011
@@ -75,12 +75,12 @@
 install:
 	for x in $(UTILS); do \
 		if [ "$$x" != "none" ]; then \
-			$(INSTALL) -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
+			$(INSTALL) -m 755 $$x "$(DESTDIR)$(ASTSBINDIR)/$$x"; \
 		fi; \
 	done 
 
 uninstall:
-	for x in $(ALL_UTILS); do rm -f $(DESTDIR)$(ASTSBINDIR)/$$x; done
+	for x in $(ALL_UTILS); do rm -f "$(DESTDIR)$(ASTSBINDIR)/$$x"; done
 
 clean:
 	rm -f *.o $(ALL_UTILS) check_expr




More information about the asterisk-commits mailing list