This file is indexed.

/lib/live/debconfig/0910-git is in live-debconfig 4.0~alpha31-1.

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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
#!/bin/sh

## live-debconfig(7) - System Configuration Components
## Copyright (C) 2006-2013 Daniel Baumann <mail@daniel-baumann.ch>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.


set -e

DEBCONF_SYSTEMRC="/var/lib/live/debconfig/systemrc"
export DEBCONF_SYSTEMRC

. /usr/share/debconf/confmodule

## single repository (interactive)

# repository url
db_get live-debconfig/git/repository-url
_REPOSITORY_URL="${RET}" # string (w/ empty)

db_set live-debconfig/git/repository-url "${_REPOSITORY_URL}"
db_fset live-debconfig/git/repository-url seen false

db_settitle live-debconfig/title
db_input high live-debconfig/git/repository-url || true
db_go

db_get live-debconfig/git/repository-url
_REPOSITORY_URL="${RET}" # string (w/ empty)

if [ -n "${_REPOSITORY_URL}" ]
then
	# repository directory
	db_get live-debconfig/git/repository-directory
	_REPOSITORY_DIRECTORY="${RET}" # string (w/ empty)

	db_set live-debconfig/git/repository-directory "${_REPOSITORY_DIRECTORY}"
	db_fset live-debconfig/git/repository-directory seen false

	db_settitle live-debconfig/title
	db_input high live-debconfig/git/repository-directory || true
	db_go

	db_get live-debconfig/git/repository-directory
	_REPOSITORY_DIRECTORY="${RET}" # string (w/ empty)

	# repository uid
	db_get live-debconfig/git/repository-uid
	_REPOSITORY_UID="${RET}" # string (w/ empty)

	db_set live-debconfig/git/repository-uid "${_REPOSITORY_UID}"
	db_fset live-debconfig/git/repository-uid seen false

	db_settitle live-debconfig/title
	db_input low live-debconfig/git/repository-uid || true
	db_go

	db_get live-debconfig/git/repository-uid
	_REPOSITORY_UID="${RET}" # string (w/ empty)

	# repository gid
	db_get live-debconfig/git/repository-gid
	_REPOSITORY_GID="${RET}" # string (w/ empty)

	db_set live-debconfig/git/repository-gid "${_REPOSITORY_GID}"
	db_fset live-debconfig/git/repository-gid seen false

	db_settitle live-debconfig/title
	db_input low live-debconfig/git/repository-gid || true
	db_go

	db_get live-debconfig/git/repository-gid
	_REPOSITORY_GID="${RET}" # string (w/ empty)

	# repository permission
	db_get live-debconfig/git/repository-permission
	_REPOSITORY_PERMISSION="${RET}" # string (w/ empty)

	db_set live-debconfig/git/repository-permission "${_REPOSITORY_PERMISSION}"
	db_fset live-debconfig/git/repository-permission seen false

	db_settitle live-debconfig/title
	db_input low live-debconfig/git/repository-permission || true
	db_go

	db_get live-debconfig/git/repository-permission
	_REPOSITORY_PERMISSION="${RET}" # string (w/ empty)

	# repository command
	db_get live-debconfig/git/repository-command
	_REPOSITORY_COMMAND="${RET}" # string (w/ empty)

	db_set live-debconfig/git/repository-command "${_REPOSITORY_COMMAND}"
	db_fset live-debconfig/git/repository-command seen false

	db_settitle live-debconfig/title
	db_input low live-debconfig/git/repository-command || true
	db_go

	db_get live-debconfig/git/repository-command
	_REPOSITORY_COMMAND="${RET}" # string (w/ empty)
fi

## multiple repository (non-interactive)

_NUMBER="0"

while db_get live-debconfig/git/repository${_NUMBER}-url && [ "${RET}" ]
do
	# repository urls
	if db_get live-debconfig/git/repository${_NUMBER}-url
	then
		eval _REPOSITORY${_NUMBER}_URL="\"${RET}\"" # string (w/ empty)

		db_fset live-debconfig/git/repository${_NUMBER}-url seen false
		db_set live-debconfig/git/repository${_NUMBER}-url ""
	fi

	# repository directorys
	if db_get live-debconfig/git/repository${_NUMBER}-directory
	then
		eval _REPOSITORY${_NUMBER}_DIRECTORY="\"${RET}\"" # string (w/ empty)

		db_fset live-debconfig/git/repository${_NUMBER}-directory seen false
		db_set live-debconfig/git/repository${_NUMBER}-directory ""
	fi

	# repository uids
	if db_get live-debconfig/git/repository${_NUMBER}-uid
	then
		eval _REPOSITORY${_NUMBER}_UID="\"${RET}\"" # string (w/ empty)

		db_fset live-debconfig/git/repository${_NUMBER}-uid seen false
		db_set live-debconfig/git/repository${_NUMBER}-uid ""
	fi

	# repository gids
	if db_get live-debconfig/git/repository${_NUMBER}-gid
	then
		eval _REPOSITORY${_NUMBER}_GID="\"${RET}\"" # string (w/ empty)

		db_fset live-debconfig/git/repository${_NUMBER}-gid seen false
		db_set live-debconfig/git/repository${_NUMBER}-gid ""
	fi

	# repository permission
	if db_get live-debconfig/git/repository${_NUMBER}-permission
	then
		eval _REPOSITORY${_NUMBER}_PERMISSION="\"${RET}\"" # string (w/ empty)

		db_fset live-debconfig/git/repository${_NUMBER}-permission seen false
		db_set live-debconfig/git/repository${_NUMBER}-permission ""
	fi

	# repository commands
	if db_get live-debconfig/git/repository${_NUMBER}-command
	then
		eval _REPOSITORY${_NUMBER}_COMMAND="\"${RET}\"" # string (w/ empty)

		db_fset live-debconfig/git/repository${_NUMBER}-command seen false
		db_set live-debconfig/git/repository${_NUMBER}-command ""
	fi

	_NUMBER="$((${_NUMBER} + 1))"
done

_REPOSITORY_NUMBERS="${_NUMBER}"

db_stop

## checkout single repository

if [ -n "${_REPOSITORY_URL}" ] && [ -n "${_REPOSITORY_DIRECTORY}" ]
then
	_REPOSITORY_PARENT_DIRECTORY="$(dirname ${_REPOSITORY_DIRECTORY})"

	rmdir "${_REPOSITORY_DIRECTORY}" > /dev/null 2>&1 || true

	if [ ! -e "${_REPOSITORY_DIRECTORY}" ]
	then
		mkdir -p "${_REPOSITORY_DIRECTORY}"

		cd "${_REPOSITORY_PARENT_DIRECTORY}"
		git clone "${_REPOSITORY_URL}" "$(basename ${_REPOSITORY_DIRECTORY})"

		if [ -n "${_REPOSITORY_UID}" ]
		then
			_REPOSITORY_GID="${_REPOSITORY_GID:-${_REPOSITORY_UID}}"

			if getent passwd "${_REPOSITORY_UID}" > /dev/null 2>&1 && \
			   getent groups "${_REPOSITORY_GID}" > /dev/null 2>&1
			then
				chown ${_REPOSITORY_UID}:${_REPOSITORY_GID} ${_REPOSITORY_DIRECTORY} -R
			fi
		fi

		if [ -n "${_REPOSITORY_PERMISSION}" ]
		then
			chmod "${_REPOSITORY_PERMISSION}" "${_REPOSITORY_DIRECTORY}"
		fi

		if [ -n "${_REPOSITORY_COMMAND}" ]
		then
			cd "${_REPOSITORY_DIRECTORY}"
			${_REPOSITORY_COMMAND}
		fi
	else
		echo "I: Skipping ${_REPOSITORY_URL}, ${_REPOSITORY_DIRECTORY} already exists and is non-empty."
	fi
fi

## checkout multiple repositories

for _NUMBER in $(seq 0 ${_REPOSITORY_NUMBERS})
do
	eval _URL="$`echo _REPOSITORY${_NUMBER}_URL`"
	eval _DIRECTORY="$`echo _REPOSITORY${_NUMBER}_DIRECTORY`"
	eval _UID="$`echo _REPOSITORY${_NUMBER}_UID`"
	eval _GID="$`echo _REPOSITORY${_NUMBER}_GID`"
	eval _PERMISSION="$`echo _REPOSITORY${_NUMBER}_PERMISSION`"
	eval _COMMAND="$`echo _REPOSITORY${_NUMBER}_COMMAND`"

	if [ -z "${_URL}" ]
	then
		continue
	fi

	if [ -n "${_DIRECTORY}" ]
	then
		_PARENT_DIRECTORY="$(dirname ${_DIRECTORY})"

		rmdir "${_DIRECTORY}" > /dev/null 2>&1 || true

		if [ ! -e "${_DIRECTORY}" ]
		then
			mkdir -p "${_DIRECTORY}"

			cd "${_PARENT_DIRECTORY}"
			git clone "${_URL}" "$(basename ${_DIRECTORY})"

			if [ -n "${_UID}" ]
			then
				_GID="${_GID:-${_UID}}"

				if getent passwd "${_UID}" > /dev/null 2>&1 && \
				   getent groups "${_GID}" > /dev/null 2>&1
				then
					chown ${_UID}:${_GID} ${_DIRECTORY} -R
				fi
			fi

			if [ -n "${_PERMISSION}" ]
			then
				chmod "${_PERMISSION}" "${_DIRECTORY}"
			fi

			if [ -n "${_COMMAND}" ]
			then
				cd "${_DIRECTORY}"
				${_COMMAND}
			fi
		fi
	else
		echo "I: Skipping ${_URL}, ${_DIRECTORY} already exists and is non-empty."
	fi
done