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 33set -ex
44
55wheeldir=" $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)
715
8- wheeldir=/tmp
9- wheel=" $( find " ${wheeldir} " -type f -name ' sambacc-*.whl' ) " \
1016
11- if ! [ " $( echo " $wheel " | wc -l ) " = 1 ]; then
17+ if [ " ${ # wheels[@]} " -gt 1 ]; then
1218 echo " more than one wheel file found"
1319 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
1429fi
1530
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
1846
1947if [ " $container_json_file " ]; then
2048 ln -sf " $container_json_file " /etc/samba/container.json
You can’t perform that action at this time.
0 commit comments