Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions scripts/lint-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,16 @@ check_version() {
local version_old_is_bad=""
dpkg --validate-version "${version_old}" &> /dev/null || version_old_is_bad="0~invalid"

# Did this package get "resurrected" from disabled-packages?
if [[ "$version_old" == '0-0' ]]; then
case "$(git diff --name-status --word-diff=porcelain "${base_commit}" -- "disabled-packages/${package_name}/build.sh" 2> /dev/null)" in
Copy link
Member

Choose a reason for hiding this comment

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

do you think these other cases also need to be handled, or can be ignored?

  • package hypothetically moved from x11-packages to packages or some other combination
  • deleted package restored that was hypothetically completely deleted instead of being moved to disabled-packages

i think that i have seen both of those situations happen before but i'm not sure if i really have.

Copy link
Member Author

Choose a reason for hiding this comment

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

Had not considered those two.
The "fully deleted from the codebase" case seems reasonable to answer with, if it's gone it's gone and is thus no longer the linter's concern, although that would still face the same issue as described for the disabled-packages/ resurrection case described above.
Moving between package channels should probably be handled.

I think I have some ideas for how we could check this, but I'll need to test how reliable git diff --follow is for detecting these cases.

'D'*) # Check that there's a delete of the build script from disabled-packages/$package_name/build.sh
echo "PASS - ${version_new} (restored from disabled-packages)"
continue
;;
esac
fi

# If ${version_new} isn't greater than "$version_old" that's an issue.
# If ${version_old} isn't valid this check is a no-op.
if dpkg --compare-versions "$version_new" le "${version_old_is_bad:-$version_old}"; then
Expand Down