This file is indexed.

/lib/rc/sh/gendepends.sh is in openrc 0.23-1+b1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/bin/sh
# Shell wrapper to list our dependencies

# Copyright (c) 2007-2015 The OpenRC Authors.
# See the Authors file at the top-level directory of this distribution and
# https://github.com/OpenRC/openrc/blob/master/AUTHORS
#
# This file is part of OpenRC. It is subject to the license terms in
# the LICENSE file found in the top-level directory of this
# distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE
# This file may not be copied, modified, propagated, or distributed
#    except according to the terms contained in the LICENSE file.

. /lib/rc/sh/functions.sh
. /lib/rc/sh/rc-functions.sh

config() {
	[ -n "$*" ] && echo "$RC_SVCNAME config $*" >&3
}
need() {
	[ -n "$*" ] && echo "$RC_SVCNAME ineed $*" >&3
}
use() {
	[ -n "$*" ] && echo "$RC_SVCNAME iuse $*" >&3
}
want() {
	[ -n "$*" ] && echo "$RC_SVCNAME iwant $*" >&3
}
before() {
	[ -n "$*" ] && echo "$RC_SVCNAME ibefore $*" >&3
}
after() {
	[ -n "$*" ] && echo "$RC_SVCNAME iafter $*" >&3
}
provide() {
	[ -n "$*" ] && echo "$RC_SVCNAME iprovide $*" >&3
}
keyword() {
	local c x
	set -- $*
	while [ -n "$*" ]; do
		case "$1" in
			-containers) x="$(_get_containers)" ;;
			!-containers) x="$(_get_containers_remove)" ;;
			*) x=$1 ;;
		esac
		c="${c}${x} "
		shift
	done
	[ -n "$c" ] && echo "$RC_SVCNAME keyword $c" >&3
}
depend() {
	:
}

_done_dirs=
for _dir in \
/etc/init.d \
/usr/etc/init.d \
/usr/local/etc/init.d
do
	[ -d "$_dir" ] || continue

	# Don't do the same dir twice
	for _d in $_done_dirs; do
		[ "$_d" = "$_dir" ] && continue 2
	done
	unset _d
	_done_dirs="$_done_dirs $_dir"

	cd "$_dir"
	for RC_SERVICE in *; do
		[ -x "$RC_SERVICE" -a -f "$RC_SERVICE" ] || continue
		# follow insserv to ignore alternatives generated by dpkg.
		case "$RC_SERVICE" in *.dpkg*) continue ;; esac

		lsbh=$(lsb2rcconf "$RC_SERVICE")
		# Only generate dependencies for OpenRC and LSB scripts
		read one two three <"$RC_SERVICE"
		[ "$one" = "#!/sbin/runscript" ] || \
		[ "$one" = "#!/sbin/openrc-run" ] || \
		[ "$one" = "#!" -a "$two" = "/sbin/runscript" ] || \
		[ "$one" = "#!" -a "$two" = "/sbin/openrc-run" ] || \
		[ -n "${lsbh}" ] || \
			continue
		unset one two three

		RC_SVCNAME=${RC_SERVICE##*/} ; export RC_SVCNAME

		# Compat
		SVCNAME=$RC_SVCNAME ; export SVCNAME

		(
		# Save stdout in fd3, then remap it to stderr
		exec 3>&1 1>&2

		_rc_c=${RC_SVCNAME%%.*}
		if [ -n "$_rc_c" -a "$_rc_c" != "$RC_SVCNAME" ]; then
			if [ -e "$_dir/../conf.d/$_rc_c" ]; then
				. "$_dir/../conf.d/$_rc_c"
			fi
		fi
		unset _rc_c

		if [ -e "$_dir/../conf.d/$RC_SVCNAME" ]; then
			. "$_dir/../conf.d/$RC_SVCNAME"
		fi

		[ -e /etc/rc.conf ] && . /etc/rc.conf
		if [ -d "/etc/rc.conf.d" ]; then
			for _f in "/etc"/rc.conf.d/*.conf; do
				[ -e "$_f" ] && . "$_f"
			done
		fi

		if [ -n "${lsbh}" ]; then
			eval "${lsbh}"
		else
			. "$_dir/$RC_SVCNAME"
		fi
		echo "$RC_SVCNAME" >&3
		_depend
		)
	done
done