Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci) add version test #1286

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

silentJET85
Copy link
Contributor

closes #1285

./deb-get purge "${APP}"
PUBLISHED_VER=$(./deb-get show "${APP}" | grep "Published:" | grep -oE '[^[:space:]]+$' || :)
INSTALLED_VER=$(dpkg-query -Wf '${Version}' "${APP}" || :)
if [ ! -z "${PUBLISHED_VER// /}" ] && [ "${PUBLISHED_VER}" != "${INSTALLED_VER}" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use the same dpkg test that deb-get uses for update rather than an exact string comparison here.

if [ "${STATUS}" == "install ok installed" ] && dpkg --compare-versions "${VERSION_PUBLISHED}" gt "${VERSION_INSTALLED}"; then

so

Suggested change
if [ ! -z "${PUBLISHED_VER// /}" ] && [ "${PUBLISHED_VER}" != "${INSTALLED_VER}" ]; then
if [ -n "${PUBLISHED_VER// /}" ] && dpkg --compare-versions "${PUBLISHED_VER}" gt "${INSTALLED_VER}" ; then

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't ne be preferable over gt in this instance? I'd think it would potentially catch more problems.

@philclifford
Copy link
Member

Nice idea, but has the potential to be troublesome so will need a heap of testing (and may generate some work attending to "failures".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: ci version test
2 participants