Skip to content

Commit e8a4481

Browse files
Merge branch 'develop' into FOGL-4103
2 parents db98878 + 4a9756e commit e8a4481

File tree

8 files changed

+14
-12
lines changed

8 files changed

+14
-12
lines changed

make_deb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ fi
129129
version=`cat ${FLEDGE_ROOT}/VERSION | tr -d ' ' | grep 'fledge_version=' | head -1 | sed -e 's/\(.*\)=\(.*\)/\2/g'`
130130
BUILD_ROOT="${PKG_ROOT}/packages/Debian/build/${architecture}"
131131
# Final package name
132-
if [[ $skip_build == 0 ]] && ([[ ${branch} != "main" ]] && [[ ! ${branch} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]]); then package_name="fledge_${version}-${commit_count}_${architecture}"; version=${git_tag_info:1}; else package_name="fledge_${version}_${architecture}"; fi
132+
if [[ $skip_build == 0 ]] && ([[ ${branch} != "main" ]] && [[ ! ${branch} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]] && [[ ! ${branch} =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]); then package_name="fledge_${version}-${commit_count}_${architecture}"; version=${git_tag_info:1}; else package_name="fledge_${version}_${architecture}"; fi
133133

134134
# Print the summary of findings
135135
echo "The package root directory is : ${PKG_ROOT}"
@@ -165,7 +165,7 @@ cd "${package_name}"
165165
cp -R ${PKG_ROOT}/packages/Debian/common/* .
166166
cp -R ${PKG_ROOT}/packages/Debian/${architecture}/* .
167167
sed -i "s/Version: 1.0.0/Version: ${version}/g" DEBIAN/control
168-
if [[ $skip_build == 0 ]] && ([[ ${branch} = "main" ]] || [[ ${branch} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]]); then echo "Build: ${git_tag_info:1}" >> DEBIAN/control; fi
168+
if [[ $skip_build == 0 ]] && ([[ ${branch} = "main" ]] || [[ ${branch} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]] || [[ ${branch} =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]); then echo "Build: ${git_tag_info:1}" >> DEBIAN/control; fi
169169
mkdir -p usr/local/fledge
170170
cd usr/local/fledge
171171
cp -R ${FLEDGE_ROOT}/* .

make_rpm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ BUILD_ROOT="${PKG_ROOT}/packages/RPM/build/BUILDROOT"
174174
mkdir -p ${PKG_ROOT}/packages/RPM/build/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
175175
mkdir -p ${PKG_ROOT}/packages/RPM/build/RPMS/x86_64
176176

177-
if [[ $skip_build == 1 ]] || ([[ ${branch} = "main" ]] || [[ ${branch} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]]); then commit_count=1; fi
177+
if [[ $skip_build == 1 ]] || ([[ ${branch} = "main" ]] || [[ ${branch} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]] || [[ ${branch} =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]); then commit_count=1; fi
178178
# Final package name
179179
package_name="${pkg_name}-${version}-${commit_count}.${architecture}"
180180

others/make_deb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ pkg_name="fledge-${ADDITIONAL_LIB_NAME}"
9393
arch_name=$(dpkg --print-architecture)
9494
git_tag_info=$(git describe --tags) && 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)"; }
9595
branch_name=$(git rev-parse --abbrev-ref HEAD)
96-
if [[ ${branch_name} != "main" ]] && [[ ! ${branch_name} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]]; then package_name="${pkg_name}_${version}-${commit_count}_${architecture}"; version=${git_tag_info:1}; else package_name="${pkg_name}_${version}_${architecture}"; fi
96+
if [[ $branch_name == "HEAD" ]]; then branch_name=$(git describe --tags); fi
97+
if [[ ${branch_name} != "main" ]] && [[ ! ${branch_name} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]] && [[ ! ${branch_name} =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then package_name="${pkg_name}_${version}-${commit_count}_${architecture}"; version=${git_tag_info:1}; else package_name="${pkg_name}_${version}_${architecture}"; fi
9798

9899
if [ ! -d "${archive}/${architecture}" ]; then
99100
mkdir -p "${archive}/${architecture}"
@@ -119,7 +120,7 @@ sed -i "s/__NAME__/${pkg_name}/g" DEBIAN/control
119120
sed -i "s/__ARCH__/${arch_name}/g" DEBIAN/control
120121
sed -i "s/__REQUIRES__/fledge (${fledge_version})/g" DEBIAN/control
121122
sed -i "s/__DESCRIPTION__/${description}/g" DEBIAN/control
122-
if [[ ${branch_name} = "main" ]] || [[ ${branch_name} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]]; then echo "Build: ${git_tag_info:1}" >> DEBIAN/control; fi
123+
if [[ ${branch_name} = "main" ]] || [[ ${branch_name} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]] || [[ ${branch_name} =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then echo "Build: ${git_tag_info:1}" >> DEBIAN/control; fi
123124

124125
# Debian file structure
125126
mkdir -p usr/local/lib

others/make_rpm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ BUILD_ROOT="${GIT_ROOT}/packages/build"
9696
# Note: git describe command fails when repo does not have release/tag
9797
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)"; }
9898
branch_name=$(git rev-parse --abbrev-ref HEAD)
99-
if [[ ${branch_name} = "main" ]] || [[ ${branch_name} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]]; then COMMIT_COUNT=1; fi
99+
if [[ $branch_name == "HEAD" ]]; then branch_name=$(git describe --tags); fi
100+
if [[ ${branch_name} = "main" ]] || [[ ${branch_name} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]] || [[ ${branch_name} =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then COMMIT_COUNT=1; fi
100101
PACKAGE_NAME="${PKG_NAME}-${VERSION}-${COMMIT_COUNT}"
101102

102103
if [ ! -d "${ARCHIVE_PATH}/${ARCHITECTURE}" ]; then

plugins/make_deb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ do
126126
git_tag_info=$(git describe --tags) && 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)"; }
127127
# Final package name
128128
archname=$(dpkg --print-architecture)
129-
if [[ ${BRANCH_NAME} != "main" ]] && [[ ! ${BRANCH_NAME} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]]; then package_name="${pkg_name}_${version}-${commit_count}_${arch}"; version=${git_tag_info:1}; else package_name="${pkg_name}_${version}_${arch}"; fi
129+
if [[ ${BRANCH_NAME} != "main" ]] && [[ ! ${BRANCH_NAME} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]] && [[ ! ${BRANCH_NAME} =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then package_name="${pkg_name}_${version}-${commit_count}_${arch}"; version=${git_tag_info:1}; else package_name="${pkg_name}_${version}_${arch}"; fi
130130

131131
# Print the summary of findings
132132
echo "The package root directory is : ${GIT_ROOT}"
@@ -204,7 +204,7 @@ do
204204
fi
205205
done < "${GIT_ROOT}/additional_lib.version"
206206
fi
207-
if [[ ${BRANCH_NAME} = "main" ]] || [[ ${BRANCH_NAME} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]]; then echo "Build: ${git_tag_info:1}" >> ${deb_path}/control; fi
207+
if [[ ${BRANCH_NAME} = "main" ]] || [[ ${BRANCH_NAME} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]] || [[ ${BRANCH_NAME} =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then echo "Build: ${git_tag_info:1}" >> ${deb_path}/control; fi
208208

209209
# install notes
210210
if [ -f "${GIT_ROOT}/install_notes.txt" ]; then

plugins/make_rpm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ do
138138
# Get git tag info from "git describe" cmd and if that fails try another method
139139
# Note: git describe command fails when repo does not have release/tag
140140
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)"; }
141-
if [[ ${BRANCH_NAME} = "main" ]] || [[ ${BRANCH_NAME} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]]; then commit_count=1; fi
141+
if [[ ${BRANCH_NAME} = "main" ]] || [[ ${BRANCH_NAME} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]] || [[ ${BRANCH_NAME} =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then commit_count=1; fi
142142
# Final package name
143143
package_name="${pkg_name}-${version}-${commit_count}"
144144

service/make_deb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ do
127127
git_tag_info=$(git describe --tags) && 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)"; }
128128
# Final package name
129129
archname=$(dpkg --print-architecture)
130-
if [[ ${BRANCH_NAME} != "main" ]] && [[ ! ${BRANCH_NAME} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]]; then package_name="${pkg_name}_${version}-${commit_count}_${architecture}"; version=${git_tag_info:1}; else package_name="${pkg_name}_${version}_${architecture}"; fi
130+
if [[ ${BRANCH_NAME} != "main" ]] && [[ ! ${BRANCH_NAME} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]] && [[ ! ${BRANCH_NAME} =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then package_name="${pkg_name}_${version}-${commit_count}_${architecture}"; version=${git_tag_info:1}; else package_name="${pkg_name}_${version}_${architecture}"; fi
131131

132132
# Print the summary of findings
133133
echo "The package root directory is : ${GIT_ROOT}"
@@ -189,7 +189,7 @@ do
189189
desc=`cat "${GIT_ROOT}/Description"`
190190
sed -i "s/__DESCRIPTION__/${desc}/g" ${deb_path}/control
191191
sed -i "s|__INSTALL_DIR__|${install_dir}|g" ${deb_path}/postinst
192-
if [[ ${BRANCH_NAME} = "main" ]] || [[ ${BRANCH_NAME} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]]; then echo "Build: ${git_tag_info:1}" >> ${deb_path}/control; fi
192+
if [[ ${BRANCH_NAME} = "main" ]] || [[ ${BRANCH_NAME} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]] || [[ ${BRANCH_NAME} =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then echo "Build: ${git_tag_info:1}" >> ${deb_path}/control; fi
193193

194194
# Debian file structure
195195
mkdir -p usr/local/fledge

service/make_rpm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ do
154154
# Get git tag info from "git describe" cmd and if that fails try another method
155155
# Note: git describe command fails when repo does not have release/tag
156156
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)"; }
157-
if [[ ${BRANCH_NAME} = "main" ]] || [[ ${BRANCH_NAME} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]]; then commit_count=1; fi
157+
if [[ ${BRANCH_NAME} = "main" ]] || [[ ${BRANCH_NAME} =~ ^[0-9]+\.[0-9]+\.[0-9]+RC ]] || [[ ${BRANCH_NAME} =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then commit_count=1; fi
158158
package_name="${pkg_name}-${version}-${commit_count}"
159159

160160
# Print the summary of findings

0 commit comments

Comments
 (0)