File tree Expand file tree Collapse file tree 1 file changed +34
-6
lines changed Expand file tree Collapse file tree 1 file changed +34
-6
lines changed Original file line number Diff line number Diff line change 3
3
set -ex
4
4
5
5
wheeldir=" $1 "
6
- container_json_file=" $2 "
6
+ if ! [ -d " ${wheeldir} " ]; then
7
+ echo " no directory: ${wheeldir} "
8
+ exit 2
9
+ fi
10
+
11
+ mapfile -d ' ' wheels < \
12
+ <( find " ${wheeldir} " -type f -name ' sambacc-*.whl' -print0)
13
+ mapfile -d ' ' rpmfiles < \
14
+ <( find " ${wheeldir} " -type f -name ' *sambacc-*.noarch.rpm' -print0)
7
15
8
- wheeldir=/tmp
9
- wheel=" $( find " ${wheeldir} " -type f -name ' sambacc-*.whl' ) " \
10
16
11
- if ! [ " $( echo " $wheel " | wc -l ) " = 1 ]; then
17
+ if [ " ${ # wheels[@]} " -gt 1 ]; then
12
18
echo " more than one wheel file found"
13
19
exit 1
20
+ elif [ " ${# wheels[@]} " -eq 1 ]; then
21
+ action=install-wheel
22
+ fi
23
+
24
+ if [ " ${# rpmfiles[@]} " -gt 1 ]; then
25
+ echo " more than one rpm file found"
26
+ exit 1
27
+ elif [ " ${# rpmfiles[@]} " -eq 1 ]; then
28
+ action=install-rpm
14
29
fi
15
30
16
- pip install " $wheel "
17
- rm -f " $wheel "
31
+ case $action in
32
+ install-wheel)
33
+ pip install " ${wheels[0]} "
34
+ container_json_file=" /usr/local/share/sambacc/examples/addc.json"
35
+ ;;
36
+ install-rpm)
37
+ dnf install -y " ${rpmfiles[0]} "
38
+ dnf clean all
39
+ container_json_file=" /usr/share/sambacc/examples/addc.json"
40
+ ;;
41
+ * )
42
+ echo " no install package(s) found"
43
+ exit 1
44
+ ;;
45
+ esac
18
46
19
47
if [ " $container_json_file " ]; then
20
48
ln -sf " $container_json_file " /etc/samba/container.json
You can’t perform that action at this time.
0 commit comments