From 88be91f08c8fcf6a5912b83dea31fcee090e0dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Kochen?= Date: Thu, 20 Apr 2023 14:13:22 +0200 Subject: [PATCH] swiftpm2nix: add support for workspace-state v6 --- pkgs/development/tools/swiftpm2nix/support.nix | 2 +- pkgs/development/tools/swiftpm2nix/swiftpm2nix.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/swiftpm2nix/support.nix b/pkgs/development/tools/swiftpm2nix/support.nix index 94076517ebfc..3c8e597f25ea 100644 --- a/pkgs/development/tools/swiftpm2nix/support.nix +++ b/pkgs/development/tools/swiftpm2nix/support.nix @@ -6,7 +6,7 @@ in rec { # Derive a pin file from workspace state. mkPinFile = workspaceState: - assert workspaceState.version == 5; + assert workspaceState.version >= 5 && workspaceState.version <= 6; json.generate "Package.resolved" { version = 1; object.pins = map (dep: { diff --git a/pkgs/development/tools/swiftpm2nix/swiftpm2nix.sh b/pkgs/development/tools/swiftpm2nix/swiftpm2nix.sh index 72051b4e448d..db00b1ad2b52 100755 --- a/pkgs/development/tools/swiftpm2nix/swiftpm2nix.sh +++ b/pkgs/development/tools/swiftpm2nix/swiftpm2nix.sh @@ -12,7 +12,8 @@ if [[ ! -f "$stateFile" ]]; then exit 1 fi -if [[ "$(jq .version $stateFile)" != "5" ]]; then +stateVersion="$(jq .version $stateFile)" +if [[ $stateVersion -lt 5 || $stateVersion -gt 6 ]]; then echo >&2 "Unsupported $stateFile version" exit 1 fi