File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change 1
1
pkg_origin=" codeforphilly"
2
2
pkg_name=" chime"
3
- pkg_version=" 0.1.0"
4
3
pkg_maintainer=
" Code for Philly <[email protected] >"
5
4
pkg_license=(' MIT' )
6
5
pkg_deps=(
@@ -17,6 +16,39 @@ pkg_bin_dirs=(
17
16
)
18
17
pkg_svc_user=" root"
19
18
19
+ pkg_version () {
20
+ if [ -n " ${pkg_last_tag} " ]; then
21
+ if [ ${pkg_last_tag_distance} -eq 0 ]; then
22
+ echo " ${pkg_last_version} "
23
+ else
24
+ echo " ${pkg_last_version} -git+${pkg_last_tag_distance} .${pkg_commit} "
25
+ fi
26
+ else
27
+ echo " ${pkg_last_version} -git.${pkg_commit} "
28
+ fi
29
+ }
30
+
31
+ do_before () {
32
+ do_default_before
33
+
34
+ # configure git repository
35
+ export GIT_DIR=" ${PLAN_CONTEXT} /../.git"
36
+
37
+ # load version information from git
38
+ pkg_commit=" $( git rev-parse --short HEAD) "
39
+ pkg_last_tag=" $( git describe --tags --abbrev=0 ${pkg_commit} || true 2> /dev/null) "
40
+
41
+ if [ -n " ${pkg_last_tag} " ]; then
42
+ pkg_last_version=${pkg_last_tag# v}
43
+ pkg_last_tag_distance=" $( git rev-list ${pkg_last_tag} ..${pkg_commit} --count) "
44
+ else
45
+ pkg_last_version=" 0.0.0"
46
+ fi
47
+
48
+ # initialize pkg_version
49
+ update_pkg_version
50
+ }
51
+
20
52
do_prepare () {
21
53
python -m venv " ${pkg_prefix} "
22
54
source " ${pkg_prefix} /bin/activate"
You can’t perform that action at this time.
0 commit comments