From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-940564-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id C6CE1139694
	for <garchives@archives.gentoo.org>; Thu, 23 Mar 2017 18:27:09 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id DFA9821C091;
	Thu, 23 Mar 2017 18:27:06 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id B998A21C091
	for <gentoo-commits@lists.gentoo.org>; Thu, 23 Mar 2017 18:27:06 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 4735A33E142
	for <gentoo-commits@lists.gentoo.org>; Thu, 23 Mar 2017 18:27:05 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 94CAF7271
	for <gentoo-commits@lists.gentoo.org>; Thu, 23 Mar 2017 18:27:03 +0000 (UTC)
From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" <williamh@gentoo.org>
Message-ID: <1490293031.50fccf47d4bd2ed6e7ea6ff7f72577c8e7b95d0d.williamh@OpenRC>
Subject: [gentoo-commits] proj/openrc:master commit in: sh/
X-VCS-Repository: proj/openrc
X-VCS-Files: sh/gendepends.sh.in
X-VCS-Directories: sh/
X-VCS-Committer: williamh
X-VCS-Committer-Name: William Hubbs
X-VCS-Revision: 50fccf47d4bd2ed6e7ea6ff7f72577c8e7b95d0d
X-VCS-Branch: master
Date: Thu, 23 Mar 2017 18:27:03 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: e397a9fd-58bb-4931-86e8-01299f1f124b
X-Archives-Hash: f96d6eeeae66ec2a076e8b43e2bd0608

commit:     50fccf47d4bd2ed6e7ea6ff7f72577c8e7b95d0d
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Thu Mar 23 18:17:11 2017 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Thu Mar 23 18:17:11 2017 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=50fccf47

sh/gendepends.sh.in: fix detection of service scripts

We do not need to care about the path on the shebang line of a service
script as long as the shebang line ends with "openrc-run".
This fixes #119 and #120.

 sh/gendepends.sh.in | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/sh/gendepends.sh.in b/sh/gendepends.sh.in
index 82088c51..45147e6a 100644
--- a/sh/gendepends.sh.in
+++ b/sh/gendepends.sh.in
@@ -74,11 +74,22 @@ do
 
 		# Only generate dependencies for OpenRC scripts
 		read one two three <"$RC_SERVICE"
-		[ "$one" = "#!@SBINDIR@/runscript" ] || \
-		[ "$one" = "#!@SBINDIR@/openrc-run" ] || \
-		[ "$one" = "#!" -a "$two" = "@SBINDIR@/runscript" ] || \
-		[ "$one" = "#!" -a "$two" = "@SBINDIR@/openrc-run" ] || \
-			continue
+		case "$one" in
+			\#*/openrc-run) ;;
+			\#*/runscript) ;;
+			\#!)
+				case "$two" in
+					*/openrc-run) ;;
+					*/runscript) ;;
+					*)
+						continue
+						;;
+				esac
+				;;
+			*)
+				continue
+				;;
+		esac
 		unset one two three
 
 		RC_SVCNAME=${RC_SERVICE##*/} ; export RC_SVCNAME