blob: 2d3acc5be8b8058df1f9435927f8d6064f6729f9 (
plain)
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
|
#!/bin/sh
arch="$(uname -m)"
arch="${arch/i[2-6]/x}"
PV="__PV__"
PN="__PN__"
s_dir="/usr/share/${PN}"
t_dir="${HOME}/.local/share/${PN}"
mkdir -p "${t_dir}"
cd "${t_dir}";
IPV=$(cat .version 2>/dev/null)
if [[ "${IPV}" != "${PV}" ]]; then
cat .content 2>/dev/null | rev | while read t; do
if [[ -d "${t}" ]]; then
rmdir "${f}" &>/dev/null
else
rm "${t}" &>/dev/null
fi
done
echo -n '' > .content # truncate -s0 ?
cd "${s_dir}"
find * | while read t; do
if [[ -d "${t}" ]]; then
mkdir -p "${t_dir}/${t}"
else
# Hardlinks with owner/rights change is not allowed,
# and symlinks doesn't work (game engine dereferences
# them and still complains on missing write access)
cp "${s_dir}/${t}" "${t_dir}/${t}"
fi
echo "${t}" >> "${t_dir}"/.content
done
echo "${PV}" > "${t_dir}"/.version
fi
export LC_NUMERIC="C"
cd "${t_dir}";
exec "./KSP.${arch}" "$@"
|