Skip to content

Commit 7a4c9ed

Browse files
committed
Why it failed on your PR: package/version and the Debian changelog (which sets the .deb name) didn’t match. CI built kframework-frontend_7.1.0_amd64.deb but the script
tried to move …_7.1.314_amd64.deb. That often happens when the branch has a newer `package/version` bump but didn’t pick up the matching changelog edits from develop, or only one of the two was updated. This should help improve PR builds that may currently be out of sync but won't cause tests to fail because the version / changelog don't agree. Issues are mitigated because branch will require to be up to date before merging.
1 parent 4c74101 commit 7a4c9ed

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

package/debian/build-package

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,16 @@ mv package/debian/${subdir}/rules.${base_distro} debian/rules
1919

2020
dpkg-buildpackage
2121

22-
mv ../${subdir}_$(cat package/version)_amd64.deb ${pkg_name}
22+
# The .deb filename uses the Debian package version from debian/changelog, which can
23+
# differ from package/version; glob the artifact dpkg actually produced.
24+
shopt -s nullglob
25+
matches=(../"${subdir}"_*_amd64.deb)
26+
if [ "${#matches[@]}" -eq 0 ]; then
27+
echo "error: no ../${subdir}_*_amd64.deb after dpkg-buildpackage" >&2
28+
exit 1
29+
fi
30+
if [ "${#matches[@]}" -gt 1 ]; then
31+
echo "error: expected one ../${subdir}_*_amd64.deb, got: ${matches[*]}" >&2
32+
exit 1
33+
fi
34+
mv "${matches[0]}" "${pkg_name}"

0 commit comments

Comments
 (0)