-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatic.install
61 lines (56 loc) · 1.52 KB
/
static.install
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
## arg 1: the new package version
# pre_install() {
# do something here
# }
## arg 1: the new package version
post_install() (
local sharun_dir='/var/RunDir/sharun'
local shared="$sharun_dir/shared"
[ ! -d "$shared" ] && \
mkdir -p "$shared"
cd "$shared"
for dir in bin lib
do
if [ ! -e "$dir" ]
then ln -s ../../rootfs/usr/"$dir" "$dir"
fi
done
if [[ ! -L 'bin' && -d 'bin' ]]
then
local bin_diff=($(sort<<<"$(ls -A bin 2>/dev/null ; sed 's|/usr/bin/||g' \
"$sharun_dir/bin.list" 2>/dev/null)"|uniq -u|sed 's|^|/usr/bin/|g'))
local new_bins=()
for bin in "${bin_diff[@]}"
do
if grep -q "$bin" "$sharun_dir/bin.list"
then new_bins+=("$bin")
fi
done
if [ -n "$new_bins" ]
then
(unset LD_PRELOAD
"$sharun_dir/sharun" lib4bin -p -g -d "$sharun_dir" "${new_bins[@]}")
fi
fi
if [ ! -e 'lib/lib.path' ]
then echo '+' > 'lib/lib.path'
fi
)
## arg 1: the new package version
## arg 2: the old package version
# pre_upgrade() {
# do something here
# }
## arg 1: the new package version
## arg 2: the old package version
post_upgrade() {
post_install
}
## arg 1: the old package version
#pre_remove() {
# do something here
#}
## arg 1: the old package version
#post_remove() {
# do something here
#}