Diff

Differences From Artifact [22eddb5383]:

To Artifact [d5deebecbf]:


32
33
34
35
36
37
38


39



40



41
42
43
44
45
46
47
	pkgfile="$1"
else
	mode='dir'

	pkgsdir="$1"
fi
appfsdir="$2"






shift; shift




if [ -z "${pkgsdir}" -a -z "${pkgfile}" ] || [ -z "${appfsdir}" ]; then
	echo 'Usage: appfs-mk {--cpio <pkgfile>|<pkgsdir>} <appfsdir> [<site-key> [<site-certificate>]]' >&2

	exit 1
fi








>
>

>
>
>
|
>
>
>







32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
	pkgfile="$1"
else
	mode='dir'

	pkgsdir="$1"
fi
appfsdir="$2"
sitekey="$3"
sitecert="$4"

if [ -n "${sitekey}" ]; then
	sitekey="$(readlink -f "${sitekey}")"
fi

if [ -n "${sitecert}" ]; then
	sitecert="$(readlink -f "${sitecert}")"
fi

if [ -z "${pkgsdir}" -a -z "${pkgfile}" ] || [ -z "${appfsdir}" ]; then
	echo 'Usage: appfs-mk {--cpio <pkgfile>|<pkgsdir>} <appfsdir> [<site-key> [<site-certificate>]]' >&2

	exit 1
fi

245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
else
	indexfile="${appfsdir}/index.new"
fi

echo "${packagelistfile_hash},sha1" > "${indexfile}"

if [ -x "$(which 'appfs-cert' 2>/dev/null)" ]; then
	appfs-cert sign-site "${indexfile}" "$@"
fi

if [ -z "$APPFS_SIGN_IN_PLACE" ]; then
	mv "${indexfile}" "${appfsdir}/index"
fi

case "${mode}" in
	file)
		cd /
		rm -rf "${workdir}"
		;;
esac







|












253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
else
	indexfile="${appfsdir}/index.new"
fi

echo "${packagelistfile_hash},sha1" > "${indexfile}"

if [ -x "$(which 'appfs-cert' 2>/dev/null)" ]; then
	appfs-cert sign-site "${indexfile}" "${sitekey}" "${sitecert}"
fi

if [ -z "$APPFS_SIGN_IN_PLACE" ]; then
	mv "${indexfile}" "${appfsdir}/index"
fi

case "${mode}" in
	file)
		cd /
		rm -rf "${workdir}"
		;;
esac