Skip to content

Commit 9a1ebcd

Browse files
committed
Add VERSIONS-SKIP to handle projects stuck on bad latest versions
1 parent d80c4c7 commit 9a1ebcd

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-6
lines changed

tasks/Makefile.package

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ export AUTO_UPDATE_ENABLED ?= true
9999
VERSION_ENV = $(PACKAGE_NAME)_VERSION
100100
RELEASE_ENV = $(PACKAGE_NAME)_RELEASE
101101
ifneq ($(strip $($(VERSION_ENV))),)
102-
PACKAGE_VERSION=$(strip $($(VERSION_ENV)))
102+
export PACKAGE_VERSION=$(strip $($(VERSION_ENV)))
103103
# $() is hack to include leading space in variable assignment
104104
PACKAGE_VERSION_OVERRIDE = $() (overridden by $(VERSION_ENV) environment variable)
105105
ifneq ($(strip $($(RELEASE_ENV))),)
106-
PACKAGE_RELEASE=$(strip $($(RELEASE_ENV)))
106+
export PACKAGE_RELEASE=$(strip $($(RELEASE_ENV)))
107107
PACKAGE_RELEASE_OVERRIDE = $() (overridden by $(RELEASE_ENV) environment variable)
108108
else # If the package version is overridden, but the release is not, then set the release to 0
109-
PACKAGE_RELEASE=0
109+
export PACKAGE_RELEASE=0
110110
PACKAGE_RELEASE_OVERRIDE = $() (because version overridden by $(VERSION_ENV) environment variable)
111111
endif
112112
endif
@@ -212,7 +212,9 @@ _version_by_semver: $(LOCAL_BIN)/vert
212212
echo "ERROR: failed to obtain version matching '$${version_pin}' for $(VENDOR)/$(PACKAGE_REPO_NAME) (got: $${releases[@]:0:10}...)" >&2; \
213213
exit 1; \
214214
elif [ "$${local_version}" != "$${current_version}" ]; then \
215-
if ! env PATH='$(PATH)' vert ">$${local_version}$(DEFAULT_PIN_SUFFIX)" "$${current_version}" >/dev/null; then \
215+
if [ -f VERSIONS-SKIP ] && grep -qFx "$${current_version}" VERSIONS-SKIP; then \
216+
echo "NOT UPGRADING $(PACKAGE_NAME) from $${local_version} to $${current_version} because $${current_version} is disallowed by VERSIONS-SKIP" >&2; \
217+
elif ! env PATH='$(PATH)' vert ">$${local_version}$(DEFAULT_PIN_SUFFIX)" "$${current_version}" >/dev/null; then \
216218
echo "NOT \"Upgrading\" $(PACKAGE_NAME) from $${local_version} to OLDER $${current_version}" >&2; \
217219
exit 1; \
218220
else \
@@ -238,8 +240,12 @@ GITHUB_LATEST_RELEASE:
238240
echo "ERROR: failed to obtain version matching '$${version_pin}' for $(VENDOR)/$(PACKAGE_REPO_NAME) (got: $${releases[@]:0:10}...)" >&2; \
239241
exit 1; \
240242
elif [ "$${local_version}" != "$${current_version}" ]; then \
241-
echo "Upgrading $(PACKAGE_NAME) from $${local_version} to $${current_version}"; \
242-
echo "$${current_version}" > VERSION; \
243+
if [ -f VERSIONS-SKIP ] && grep -qFx "$${current_version}" VERSIONS-SKIP; then \
244+
echo "NOT UPGRADING $(PACKAGE_NAME) from $${local_version} to $${current_version} because $${current_version} is disallowed by VERSIONS-SKIP" >&2; \
245+
else \
246+
echo "Upgrading $(PACKAGE_NAME) from $${local_version} to $${current_version}"; \
247+
echo "$${current_version}" > VERSION; \
248+
fi; \
243249
fi; \
244250
else \
245251
echo "NOT \"Upgrading\" $(PACKAGE_NAME) from $${local_version} to $${current_version} because auto-update is disabled" >&2; \

vendor/rakkess/VERSIONS-SKIP

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This file, VERSIONS-SKIP, is optional and rarely needed.
2+
# It contains a list of versions to skip when updating
3+
# the current version (auto-update), usually because there is
4+
# something wrong with the release. Each version must be on a
5+
# separate line with no leading or trailing spaces.
6+
# Blank lines are ignored.
7+
8+
0.5.1
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This file, VERSIONS-SKIP, is optional and rarely needed.
2+
# It contains a list of versions to skip when updating
3+
# the current version (auto-update), usually because there is
4+
# something wrong with the release. Each version must be on a
5+
# separate line with no leading or trailing spaces.
6+
# Blank lines are ignored.
7+
8+
3.1.14

0 commit comments

Comments
 (0)