Skip to content
Snippets Groups Projects

[master] pmb.helpers: Handle workdir version suffix from 2.3.x

Merged Luca Weiss requested to merge master-2.3.x-compat into master
All threads resolved!
1 file
+ 9
2
Compare changes
  • Side-by-side
  • Inline
  • 74c8aaab
    For the gitlab.com -> gitlab.postmarketos.org migration we needed to
    also migrate the workdir in pmb v2 since pmb v3 is not ready yet.
    
    Therefore we need to handle that "7-2.x" workdir version and migrate
    correctly when switching to pmbootstrap v3.
    
    See !2445
+ 9
2
@@ -82,10 +82,16 @@ def migrate_work_folder():
# Read current version
context = get_context()
current = 0
suffix: str | None = None
path = context.config.work / "version"
if os.path.exists(path):
with open(path) as f:
current = int(f.read().rstrip())
# pmb 2.3.x added a suffix due to conflicting work versions
# We need to be able to handle that going forward
version_parts = f.read().rstrip().split("-")
current = int(version_parts[0])
if len(version_parts) == 2:
suffix = version_parts[1]
# Compare version, print warning or do nothing
required = pmb.config.work_version
@@ -96,7 +102,8 @@ def migrate_work_folder():
" (from version " + str(current) + " to " + str(required) + ")!"
)
if current == 6:
# version 6 and version 7 from 2.3.x branch are equivalent for this and we need to migrate
if current == 6 or (current == 7 and suffix == "2.x"):
# Ask for confirmation
logging.info("Changelog:")
logging.info("* Major refactor for pmb 3.0.0")
Loading