Skip to content
Merged
Show file tree
Hide file tree
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
31 changes: 0 additions & 31 deletions carveracontroller/Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,34 +686,3 @@ def digitize_v(version):
cleaned_parts.append(0)

return cleaned_parts[0] * 1000 * 1000 + cleaned_parts[1] * 1000 + cleaned_parts[2]


def _version_numeric_parts(version, count=3):
cleaned_parts = []
for part in version.split(".")[:count]:
numeric_part = ""
for char in part:
if char.isdigit():
numeric_part += char
else:
break
cleaned_parts.append(int(numeric_part if numeric_part else "0"))
while len(cleaned_parts) < count:
cleaned_parts.append(0)
return cleaned_parts


def digitize_major_minor(version):
major, minor = _version_numeric_parts(version, 2)
return major * 1000 + minor


def is_unversioned_controller(ctl_version):
major, minor, patch = _version_numeric_parts(ctl_version, 3)
return major == 0 and minor == 0 and patch == 0


def is_dev_version_pair(fw_version, ctl_version):
fw_major, _ = _version_numeric_parts(fw_version, 2)
ctl_major, _ = _version_numeric_parts(ctl_version, 2)
return fw_major > 2025 and ctl_major > 2025
14 changes: 9 additions & 5 deletions carveracontroller/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4796,13 +4796,17 @@ def onFirmwareDetected(self, version, *args):
content.add_widget(btns)
popup.open()

# Warn when community firmware major.minor is ahead of the controller.
# Skip for unversioned controllers (0.0.0) and date-based YYYY.dev builds.
fw_v = Utils.digitize_v(version) if version else 0
ctl_v = Utils.digitize_v(self.ctl_version) if self.ctl_version else 0
fw_major, ctl_major = fw_v // 1_000_000, ctl_v // 1_000_000
if (
app.is_community_firmware
and version
and self.ctl_version
and not Utils.is_unversioned_controller(self.ctl_version)
and not Utils.is_dev_version_pair(version, self.ctl_version)
and Utils.digitize_major_minor(version) > Utils.digitize_major_minor(self.ctl_version)
and fw_v
and ctl_v
and not (fw_major >= 2026 and ctl_major >= 2026)
and fw_v // 1000 > ctl_v // 1000
):
content = BoxLayout(orientation="vertical", padding=dp(15))
lbl = Label(
Expand Down
13 changes: 2 additions & 11 deletions scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,17 +326,8 @@ def version_type(version_string):
"Must be in X.Y.Z[-SUFFIX] format (e.g., 1.2.3, v1.2.3, 2.0.0-RC1, or v2.0.0-RC1)"
)

# Remove 'v' prefix if present
version_string = version_string.lstrip("v")

# Split version into parts
parts = version_string.split(".")

# If first part is 4 digits, take last 2 digits
if len(parts[0]) == 4:
parts[0] = parts[0][-2:]

return ".".join(parts)
# Remove 'v' prefix if present; keep full YYYY for date-based dev versions
return version_string.lstrip("v")


def rename_release_file(os_name, package_version):
Expand Down
Loading