From 2c4f30da2b7c47a9d48ea21de5d4cc104e397ad2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Apr 2026 12:55:54 +0000 Subject: [PATCH 1/2] Initial plan From 183c6f3d189e985ecdcc9df5365e93d497dd9a7b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Apr 2026 13:01:12 +0000 Subject: [PATCH 2/2] Replace OS detection with package manager detection in install scripts Agent-Logs-Url: https://github.com/microsoft/codespace-features/sessions/bfea62a2-b157-46cd-9bab-5cc9cad4e4d6 Co-authored-by: markphip <933108+markphip@users.noreply.github.com> --- src/artifacts-helper/devcontainer-feature.json | 2 +- src/artifacts-helper/install.sh | 5 +---- src/devtool/devcontainer-feature.json | 2 +- src/devtool/install.sh | 5 +---- src/go/devcontainer-feature.json | 2 +- src/go/install.sh | 6 ++---- src/microsoft-git/devcontainer-feature.json | 2 +- src/microsoft-git/install.sh | 8 ++------ 8 files changed, 10 insertions(+), 22 deletions(-) diff --git a/src/artifacts-helper/devcontainer-feature.json b/src/artifacts-helper/devcontainer-feature.json index 5074311..d2e9441 100644 --- a/src/artifacts-helper/devcontainer-feature.json +++ b/src/artifacts-helper/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "Azure Artifacts Credential Helper", "id": "artifacts-helper", - "version": "3.0.5", + "version": "3.0.6", "description": "Configures Codespace to authenticate with Azure Artifact feeds", "options": { "nugetURIPrefixes": { diff --git a/src/artifacts-helper/install.sh b/src/artifacts-helper/install.sh index 2fb3f09..87655ae 100755 --- a/src/artifacts-helper/install.sh +++ b/src/artifacts-helper/install.sh @@ -44,9 +44,6 @@ if [ "${ALIAS_AZ}" = "true" ]; then ALIASES_ARR+=('az') fi -# Source /etc/os-release to get OS info -. /etc/os-release - if [ "$(id -u)" -ne 0 ]; then echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' exit 1 @@ -70,7 +67,7 @@ check_packages() { export DEBIAN_FRONTEND=noninteractive -if [ "${ID}" = "mariner" ]; then +if command -v tdnf >/dev/null 2>&1; then tdnf install -y wget ca-certificates tdnf clean all else diff --git a/src/devtool/devcontainer-feature.json b/src/devtool/devcontainer-feature.json index 9648a08..89f9de2 100644 --- a/src/devtool/devcontainer-feature.json +++ b/src/devtool/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "DevTool", "id": "devtool", - "version": "1.0.3", + "version": "1.0.4", "description": "Install DevTool", "installsAfter": [ "ghcr.io/devcontainers/features/common-utils" diff --git a/src/devtool/install.sh b/src/devtool/install.sh index 2deb23a..4726fe5 100644 --- a/src/devtool/install.sh +++ b/src/devtool/install.sh @@ -3,9 +3,6 @@ set -e -# Source /etc/os-release to get OS info -. /etc/os-release - if [ "$(id -u)" -ne 0 ]; then echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' exit 1 @@ -30,7 +27,7 @@ check_packages() { export DEBIAN_FRONTEND=noninteractive -if [ "${ID}" = "mariner" ]; then +if command -v tdnf >/dev/null 2>&1; then tdnf install -y curl ca-certificates tar tdnf clean all else diff --git a/src/go/devcontainer-feature.json b/src/go/devcontainer-feature.json index 6e2ffcd..b83ac3b 100644 --- a/src/go/devcontainer-feature.json +++ b/src/go/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "go", - "version": "1.2.0", + "version": "1.2.1", "name": "Go", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/go", "description": "Installs Go and common Go utilities. Auto-detects latest version and installs needed dependencies.", diff --git a/src/go/install.sh b/src/go/install.sh index 1e163f3..02f260d 100755 --- a/src/go/install.sh +++ b/src/go/install.sh @@ -19,8 +19,6 @@ INSTALL_GO_TOOLS="${INSTALL_GO_TOOLS:-"true"}" GO_GPG_KEY_URI="https://dl.google.com/linux/linux_signing_key.pub" set -e -# Source /etc/os-release to get OS info -. /etc/os-release if [ "$(id -u)" -ne 0 ]; then echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' @@ -116,7 +114,7 @@ check_packages() { export DEBIAN_FRONTEND=noninteractive -if [ "${ID}" = "mariner" ]; then +if command -v tdnf >/dev/null 2>&1; then tdnf install -y curl ca-certificates gnupg2 tar g++ gcc make git build-essential else # Clean up @@ -252,7 +250,7 @@ find "${TARGET_GOROOT}" -type d -print0 | xargs -n 1 -0 chmod g+s find "${TARGET_GOPATH}" -type d -print0 | xargs -n 1 -0 chmod g+s # Clean up -if [ "${ID}" = "mariner" ]; then +if command -v tdnf >/dev/null 2>&1; then tdnf clean all else rm -rf /var/lib/apt/lists/* diff --git a/src/microsoft-git/devcontainer-feature.json b/src/microsoft-git/devcontainer-feature.json index a5fa034..9ce3e40 100644 --- a/src/microsoft-git/devcontainer-feature.json +++ b/src/microsoft-git/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "Microsoft Git for monorepo with GVFS support", "id": "microsoft-git", - "version": "1.0.8", + "version": "1.0.9", "description": "A fork of Git containing Microsoft-specific patches", "options": { "version": { diff --git a/src/microsoft-git/install.sh b/src/microsoft-git/install.sh index 0db328d..3835faf 100755 --- a/src/microsoft-git/install.sh +++ b/src/microsoft-git/install.sh @@ -9,9 +9,6 @@ GIT_VERSION=${VERSION:-"latest"} set -e -# Source /etc/os-release to get OS info -. /etc/os-release - if [ "$(id -u)" -ne 0 ]; then echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' exit 1 @@ -35,7 +32,7 @@ check_packages() { export DEBIAN_FRONTEND=noninteractive -if [ "${ID}" = "mariner" ]; then +if command -v tdnf >/dev/null 2>&1; then tdnf install -y curl ca-certificates else check_packages curl ca-certificates @@ -67,8 +64,7 @@ fi echo "Downloading Microsoft Git ${GIT_VERSION}..." -# If ID is mariner -if [ "${ID}" = "mariner" ]; then +if command -v tdnf >/dev/null 2>&1; then # We need to build Git from source release on Mariner tdnf install -y wget tar git pcre2 binutils build-essential openssl-devel expat-devel curl-devel python3-devel gettext asciidoc xmlto cronie wget -q https://github.com/microsoft/git/archive/refs/tags/v${GIT_VERSION}.tar.gz