Skip to content

fix: sed pipeline passes stray stdin '-' argument - #949

Open
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:codequality/nvidia-driver-sed-pipeline-passes-stray-stdin-argument
Open

fix: sed pipeline passes stray stdin '-' argument#949
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:codequality/nvidia-driver-sed-pipeline-passes-stray-stdin-argument

Conversation

@andrewwhitecdw

Copy link
Copy Markdown

This PR addresses the following issue in ubuntu24.04/nvidia-driver: sed pipeline passes stray stdin '-' argument.

Changes

  • ubuntu24.04/nvidia-driver: sed pipeline passes stray stdin '-' argument.

Details

--- a/ubuntu24.04/nvidia-driver
+++ b/ubuntu24.04/nvidia-driver
@@ -1,1 +1,1 @@
-    ls -1 boot/vmlinuz-* | sed  's/\/boot\/vmlinuz-//g' - > version
+    ls -1 boot/vmlinuz-* | sed  's/\/boot\/vmlinuz-//g' > version

Tests

  • tests/test_sed_pipeline.sh
--- /dev/null
+++ tests/test_sed_pipeline.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+set -eu
+
+DRIVER_FILE="ubuntu24.04/nvidia-driver"
+
+if grep -F "    ls -1 boot/vmlinuz-* | sed  's/\\/boot\\/vmlinuz-//g' - > version" "$DRIVER_FILE"; then
+    echo "FAIL: sed pipeline still passes stray '-' argument" >&2
+    exit 1
+fi
+
+tmpdir=$(mktemp -d)
+trap 'rm -rf "$tmpdir"' EXIT
+mkdir -p "$tmpdir/boot"
+touch "$tmpdir/boot/vmlinuz-5.4.0-test"
+cd "$tmpdir"
+result=$(ls -1 boot/vmlinuz-* | sed 's/\/boot\/vmlinuz-//g')
+if [ "$result" != "5.4.0-test" ]; then
+    echo "FAIL: sed pipeline produced '$result', expected '5.4.0-test'" >&2
+    exit 1
+fi
+
+echo "PASS: sed pipeline is clean and produces correct output"

Contributor guidelines

Per this repo's CONTRIBUTING.md:

  • All commits are signed off (Signed-off-by trailer, DCO).

Signed-off-by: andrewwhitecdw <andrewwhitecdw@users.noreply.github.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant