Skip to content

Commit

Permalink
Remove support for any_machine mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mikusaq committed Feb 3, 2025
1 parent bcb27fb commit ac2330a
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 21 deletions.
6 changes: 1 addition & 5 deletions doc/ConfigStructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,12 @@ Examples:
Platform String mode determines how the PlatformString is constructed.

``` plaintext
Mode = "auto" | "any_machine" | "explicit"
Mode = "auto" | "explicit"
```

**auto** - Constructs the PlatformString for a target machine automatically.
Example for Debian 11 (x86_64): "x86-64-debian-11"

**any_machine** - Constructs the platform string specific only to the Distro name and distro
release, with the machine part of the PlatformString set to "any".
Example for Debian 11 (x86_64): "any-debian-11"

**explicit** - User must fill in all three parts manually:

``` json
Expand Down
2 changes: 1 addition & 1 deletion example/package/cxxopts/cxxopts_v3_debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"Name": "cxxopts",
"VersionTag": "v3.0.5",
"PlatformString": {
"Mode": "any_machine"
"Mode": "auto"
},
"IsLibrary": true,
"IsDevLib": true,
Expand Down
2 changes: 1 addition & 1 deletion example/package/cxxopts/cxxopts_v3_release.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"Name": "cxxopts",
"VersionTag": "v3.0.5",
"PlatformString": {
"Mode": "any_machine"
"Mode": "auto"
},
"IsLibrary": true,
"IsDevLib": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"Name": "fleet-protocol-interface",
"VersionTag": "v2.0.0",
"PlatformString": {
"Mode": "any_machine"
"Mode": "auto"
},
"IsLibrary": true,
"IsDevLib": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"Name": "fleet-protocol-interface",
"VersionTag": "v2.0.0",
"PlatformString": {
"Mode": "any_machine"
"Mode": "auto"
},
"IsLibrary": true,
"IsDevLib": true,
Expand Down
2 changes: 1 addition & 1 deletion example/package/modbuspp/modbuspp_debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"Name": "modbuspp",
"VersionTag": "v0.3.1",
"PlatformString": {
"Mode": "any_machine"
"Mode": "auto"
},
"IsLibrary": true,
"IsDevLib": true,
Expand Down
2 changes: 1 addition & 1 deletion example/package/modbuspp/modbuspp_release.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"Name": "modbuspp",
"VersionTag": "v0.3.1",
"PlatformString": {
"Mode": "any_machine"
"Mode": "auto"
},
"IsLibrary": true,
"IsDevLib": true,
Expand Down
2 changes: 1 addition & 1 deletion example/package/nlohmann-json/nlohmann_json_debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"Name": "nlohmann-json",
"VersionTag": "v3.10.5",
"PlatformString": {
"Mode": "any_machine"
"Mode": "auto"
},
"IsLibrary": true,
"IsDevLib": true,
Expand Down
2 changes: 1 addition & 1 deletion example/package/nlohmann-json/nlohmann_json_release.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"Name": "nlohmann-json",
"VersionTag": "v3.10.5",
"PlatformString": {
"Mode": "any_machine"
"Mode": "auto"
},
"IsLibrary": true,
"IsDevLib": true,
Expand Down
11 changes: 3 additions & 8 deletions modules/bringauto_package/PlatformString.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ const (
// ModeExplicit denotes that the plafrom string is filled-up by user.
// Function determinePlatformString should not be used with ModeExplicit.
ModeExplicit PlatformStringMode = "explicit"
// ModeAnyMachine is a same as ModeAuto except Machine that is se to "any"
ModeAnyMachine = "any_machine"
// ModeAuto compute platform string automatically by lsb_release and uname
ModeAuto = "auto"
)
Expand All @@ -36,7 +34,7 @@ type PlatformString struct {
}

// PlatformStringExplicit represent explicit platform string
// constructed by ModeAuto, ModeAnyMachine or ModeExplicit
// constructed by ModeAuto or ModeExplicit
type PlatformStringExplicit struct {
DistroName string
DistroRelease string
Expand Down Expand Up @@ -83,7 +81,6 @@ func (pstr *PlatformString) CheckPrerequisites(args *bringauto_prerequisites.Arg
}
switch pstr.Mode {
case ModeAuto:
case ModeAnyMachine:
return nil
case ModeExplicit:
break
Expand All @@ -108,8 +105,8 @@ func (pstr *PlatformString) CheckPrerequisites(args *bringauto_prerequisites.Arg
return nil
}

// determinePlatformString tries to compute
// platform string for ModeAuto and ModeAnyMachine.
// determinePlatformString
// Computes platform string for ModeAuto.
// If the PlatformString is in ModeExplicit the panic raise.
func (pstr *PlatformString) determinePlatformString(credentials bringauto_ssh.SSHCredentials, docker *bringauto_docker.Docker) error {
if pstr.Mode == ModeExplicit {
Expand Down Expand Up @@ -137,8 +134,6 @@ func (pstr *PlatformString) determinePlatformString(credentials bringauto_ssh.SS
switch pstr.Mode {
case ModeAuto:
pstr.String.Machine = getSystemArchitecture(credentials)
case ModeAnyMachine:
pstr.String.Machine = "any"
default:
panic(fmt.Errorf("unsupported PlatformStringMode"))
}
Expand Down

0 comments on commit ac2330a

Please sign in to comment.