[Asterisk-code-review] make config: os-release output error. (asterisk[16])

Joshua Colp asteriskteam at digium.com
Fri Aug 31 04:55:11 CDT 2018


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/10021 )

Change subject: make config: os-release output error.
......................................................................

make config: os-release output error.

Fix not show the error
"/bin/sh: /etc/os-release: No such file or directory" when the command
'make config' is run in a System without systemv.

The instruction 'make config' pre execute the syntax
"$(shell . /etc/os-release && echo $$ID)" to identified if system is a
Slackware and Opensuse.

This change prevent show the message and is send to the /dev/null

Change-Id: I7f43e281a8d9405b2519fc653de82d9b8b645fdf
---
M Makefile
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
  George Joseph: Looks good to me, approved



diff --git a/Makefile b/Makefile
index 562b11e..8911c6a 100644
--- a/Makefile
+++ b/Makefile
@@ -946,7 +946,7 @@
 		if [ -z "$(DESTDIR)" ] ; then \
 			/sbin/chkconfig --add asterisk ; \
 		fi ; \
-	elif [ -f /etc/os-release ] && [ "opensuse" = "$(shell . /etc/os-release && echo $$ID)" ] ; then \
+	elif [ -f /etc/os-release ] && [ "opensuse" = "$(shell . /etc/os-release 2>/dev/null && echo $$ID)" ] ; then \
 		./build_tools/install_subst contrib/init.d/rc.suse.asterisk  "$(DESTDIR)/etc/init.d/asterisk"; \
 		if [ ! -f /etc/sysconfig/asterisk ] ; then \
 			$(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
@@ -958,7 +958,7 @@
 		./build_tools/install_subst contrib/init.d/rc.archlinux.asterisk  "$(DESTDIR)/etc/init.d/asterisk"; \
 	elif [ -f /etc/slackware-version ]; then \
 		./build_tools/install_subst contrib/init.d/rc.slackware.asterisk  "$(DESTDIR)/etc/rc.d/rc.asterisk"; \
-	elif [ -f /etc/os-release ] && [ "slackware" = "$(shell . /etc/os-release && echo $$ID)" ] ; then \
+	elif [ -f /etc/os-release ] && [ "slackware" = "$(shell . /etc/os-release 2>/dev/null && echo $$ID)" ] ; then \
 		./build_tools/install_subst contrib/init.d/rc.slackware.asterisk  "$(DESTDIR)/etc/rc.d/rc.asterisk"; \
 	elif [ -d "$(DESTDIR)/Library/LaunchDaemons" ]; then \
 		if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist" ]; then \

-- 
To view, visit https://gerrit.asterisk.org/10021
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-MessageType: merged
Gerrit-Change-Id: I7f43e281a8d9405b2519fc653de82d9b8b645fdf
Gerrit-Change-Number: 10021
Gerrit-PatchSet: 1
Gerrit-Owner: Rodrigo Ramirez Norambuena <a at rodrigoramirez.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180831/dcccdb53/attachment-0001.html>


More information about the asterisk-code-review mailing list