-
Notifications
You must be signed in to change notification settings - Fork 19
/
_update-tox-files-single
executable file
·73 lines (70 loc) · 2.16 KB
/
_update-tox-files-single
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
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash -e
# Update tox.ini files from global/*. Assumes git clones have already
# been performed. Does not commit, push, or submit/review.
# See `batch-example` for usage as a batch of charm updates.
#
# Note this MUST be called from root of the charm that is being done.
script_dir="$( cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"
charm_type="$($script_dir/what-is-binary .)"
echo "===== $charm ($charm_type) ====="
# Systematically copy tox.ini files into repos
case $charm_type in
classic-zaza)
cp -fvp $script_dir/global/$charm_type/tox.ini tox.ini
cp -fvp $script_dir/global/$charm_type/rename.sh rename.sh
;;
source-zaza)
cp -fvp $script_dir/global/source-zaza/tox-source-wheels.ini tox.ini
cp -fvp $script_dir/global/source-zaza/src/tox.ini src/tox.ini
cp -fvp $script_dir/global/source-zaza/rename.sh rename.sh
;;
source-binary-zaza)
cp -fvp $script_dir/global/source-zaza/tox-binary-wheels.ini tox.ini
cp -fvp $script_dir/global/source-zaza/src/tox.ini src/tox.ini
;;
ops-zaza)
cp -fvp $script_dir/global/$charm_type/tox.ini tox.ini
;;
ops-unknown)
cp -fvp $script_dir/global/$charm_type/tox.ini tox.ini
;;
*)
echo "UNKNOWN TYPE -- do nothing"
;;
esac
# Ensure certain directories exist, even if not otherwise required.
# Makes all repos consistent with things like the flake8 command paths.
# https://bugs.launchpad.net/bugs/1843826
case $charm_type in
classic-zaza)
if [ ! -d files ]; then
mkdir -v files
touch files/.gitkeep
fi
;;
source-zaza)
if [ ! -d src/files ]; then
mkdir -v src/files
touch src/files/.gitkeep
fi
;;
source-binary-zaza)
if [ ! -d src/files ]; then
mkdir -v src/files
touch src/files/.gitkeep
fi
;;
ops-unknown)
if [ ! -d tests ]; then
mkdir -v tests
fi
;;
ops-zaza)
if [ ! -d tests ]; then
mkdir -v tests
fi
;;
*)
echo "UNKNOWN TYPE -- do nothing"
;;
esac