File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,9 @@ PKG_NAME="fledge-${ADDITIONAL_LIB_NAME}"
92
92
ARCHITECTURE=` arch`
93
93
PACKAGE_NAME=" ${PKG_NAME} -${VERSION} "
94
94
BUILD_ROOT=" ${GIT_ROOT} /packages/build"
95
- GIT_TAG_INFO=$( git describe --tags | sed ' s/-/_/g' ) && COMMIT_COUNT=$( echo ${GIT_TAG_INFO} | cut -d_ -f2) || { COMMIT_COUNT=$( git rev-list --count HEAD) ; GIT_TAG_INFO=" v$VERSION_$COMMIT_COUNT_g $( git rev-parse --short HEAD) " ; }
95
+ # Get git tag info from "git describe" cmd and if that fails try another method
96
+ # Note: git describe command fails when repo does not have release/tag
97
+ GIT_TAG_INFO=$( git describe --tags) && GIT_TAG_INFO=$( echo ${GIT_TAG_INFO} | sed ' s/-/_/g' ) && COMMIT_COUNT=$( echo ${GIT_TAG_INFO} | cut -d_ -f2) || { COMMIT_COUNT=$( git rev-list --count HEAD) ; GIT_TAG_INFO=" v${VERSION} _${COMMIT_COUNT} _g$( git rev-parse --short HEAD) " ; }
96
98
branch_name=$( git rev-parse --abbrev-ref HEAD)
97
99
if [[ ${branch_name} = " main" ]] || [[ ${branch_name} =~ ^[0-9]+\. [0-9]+\. [0-9]+RC ]]; then COMMIT_COUNT=1; fi
98
100
PACKAGE_NAME=" ${PKG_NAME} -${VERSION} -${COMMIT_COUNT} "
Original file line number Diff line number Diff line change 135
135
else
136
136
pkg_name=" fledge-${plugin_type} -${plugin_name} "
137
137
fi
138
- git_tag_info=$( git describe --tags | sed ' s/-/_/g' ) && commit_count=$( echo ${git_tag_info} | cut -d_ -f2) || { commit_count=$( git rev-list --count HEAD) ; git_tag_info=" v$version_$commit_count_g $( git rev-parse --short HEAD) " ; }
138
+ # Get git tag info from "git describe" cmd and if that fails try another method
139
+ # Note: git describe command fails when repo does not have release/tag
140
+ git_tag_info=$( git describe --tags) && git_tag_info=$( echo ${git_tag_info} | sed ' s/-/_/g' ) && commit_count=$( echo ${git_tag_info} | cut -d_ -f2) || { commit_count=$( git rev-list --count HEAD) ; git_tag_info=" v${version} _${commit_count} _g$( git rev-parse --short HEAD) " ; }
139
141
if [[ ${BRANCH_NAME} = " main" ]] || [[ ${BRANCH_NAME} =~ ^[0-9]+\. [0-9]+\. [0-9]+RC ]]; then commit_count=1; fi
140
142
# Final package name
141
143
package_name=" ${pkg_name} -${version} -${commit_count} "
Original file line number Diff line number Diff line change 151
151
else
152
152
pkg_name=" fledge-service-${service_name} "
153
153
fi
154
- git_tag_info=$( git describe --tags | sed ' s/-/_/g' ) && commit_count=$( echo ${git_tag_info} | cut -d_ -f2) || { commit_count=$( git rev-list --count HEAD) ; git_tag_info=" v$version_$commit_count_g $( git rev-parse --short HEAD) " ; }
154
+ # Get git tag info from "git describe" cmd and if that fails try another method
155
+ # Note: git describe command fails when repo does not have release/tag
156
+ git_tag_info=$( git describe --tags) && git_tag_info=$( echo ${git_tag_info} | sed ' s/-/_/g' ) && commit_count=$( echo ${git_tag_info} | cut -d_ -f2) || { commit_count=$( git rev-list --count HEAD) ; git_tag_info=" v${version} _${commit_count} _g$( git rev-parse --short HEAD) " ; }
155
157
if [[ ${BRANCH_NAME} = " main" ]] || [[ ${BRANCH_NAME} =~ ^[0-9]+\. [0-9]+\. [0-9]+RC ]]; then commit_count=1; fi
156
158
package_name=" ${pkg_name} -${version} -${commit_count} "
157
159
You can’t perform that action at this time.
0 commit comments