diff --git a/.gitignore b/.gitignore index 2d8c216..f69a42b 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ features/src/**/installer_* # Cache for prepared and cleaned feature for packaging/publishing .prepared-feature/ + +.devcontainer/devcontainer-lock.json diff --git a/features/src/system-packages/README.md b/features/src/system-packages/README.md index a9738ed..3d2e20d 100755 --- a/features/src/system-packages/README.md +++ b/features/src/system-packages/README.md @@ -6,7 +6,7 @@ Install arbitrary system packages using the system package manager. ```json "features": { - "ghcr.io/postfinance/devcontainer-features/system-packages:1.0.0": { + "ghcr.io/postfinance/devcontainer-features/system-packages:1.0.1": { "packages": "" } } diff --git a/features/src/system-packages/devcontainer-feature.json b/features/src/system-packages/devcontainer-feature.json index 740e47a..761bda5 100644 --- a/features/src/system-packages/devcontainer-feature.json +++ b/features/src/system-packages/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "system-packages", - "version": "1.0.0", + "version": "1.0.1", "name": "System Packages", "description": "Install arbitrary system packages using the system package manager.", "options": { @@ -14,4 +14,4 @@ "default": "" } } -} \ No newline at end of file +} diff --git a/installer/system.go b/installer/system.go index 4450ba0..6e9612f 100644 --- a/installer/system.go +++ b/installer/system.go @@ -107,17 +107,19 @@ func (s *system) OsInfo() *OsInfo { if err := scanner.Err(); err != nil { return } + // We do not know which values are provided by the OS, so we take what + // we can get and set undefined values to "unknown" vendor, ok := infoMap["ID"] if !ok { - return + vendor = "unknown" } codename, ok := infoMap["VERSION_CODENAME"] if !ok { - return + codename = "unknown" } versionId, ok := infoMap["VERSION_ID"] if !ok { - return + versionId = "unknown" } s.osInfo = &OsInfo{ Vendor: vendor, @@ -125,10 +127,6 @@ func (s *system) OsInfo() *OsInfo { VersionId: versionId, } }) - if s.osInfo == nil { - // Fill with unknown if we couldn't read the OS info - s.osInfo = &OsInfo{Vendor: "unknown", Codename: "unknown", VersionId: "unknown"} - } return s.osInfo }