Skip to content

Conversation

@pvalena
Copy link
Contributor

@pvalena pvalena commented Jun 9, 2025

That causes dropindirs_sort() to look for .conf files in / due to
expansion:

for d in "$@"; do
    for i in "$d/"*"$suffix"; do

Fixes #1275

(cherry picked from commit 000cfa0c278c0858e81c8dd2ff7231f069f0afb1)

Resolves: RHEL-92584

@pvalena pvalena self-assigned this Jun 9, 2025
@github-actions github-actions bot changed the title fix(dracut.sh): don't pass empty string as dir (RHEL-92584) fix(dracut.sh): don't pass empty string as dir Jun 9, 2025
@github-actions
Copy link

github-actions bot commented Jun 9, 2025

Commit validation

Tracker - RHEL-92584

The following commits need an inspection

commit note
d25f886 - fix(dracut.sh): don't pass empty string as dir Missing upstream reference ‼️

Tracker validation

Success

🟢 Tracker RHEL-92584 has set desired product: rhel-9.7
🟢 Tracker RHEL-92584 has set desired component: dracut
🟢 Tracker RHEL-92584 has been approved
🟢 Tracker RHEL-92584 has set severity


Pull Request validation

Failed

🔴 Failed or pending checks - test (centos:stream9, 35)[failure],test (centos:stream9, 31)[failure],test (centos:stream9, 30)[failure],test (centos:stream9, 14)[failure],test (centos:stream9, 15)[failure],test (centos:stream9, 36)[failure],test (centos:stream9, 03)[failure],centos-9-stream (centos:stream9, 01)[cancelled],centos-9-stream (centos:stream9, 16)[cancelled],centos-9-stream (centos:stream9, 98)[cancelled],centos-9-stream (centos:stream9, 40)[cancelled],centos-9-stream (centos:stream9, 20)[cancelled],centos-9-stream (centos:stream9, 11)[cancelled],centos-9-stream (centos:stream9, 13)[cancelled],centos-9-stream (centos:stream9, 12)[cancelled],centos-9-stream (centos:stream9, 10)[cancelled],centos-9-stream (centos:stream9, 02)[cancelled],centos-9-stream (centos:stream9, 41)[cancelled],centos-9-stream (centos:stream9, 17)[cancelled],centos-9-stream (centos:stream9, 21)[cancelled],basic (centos:stream9, 04)[failure],testing-farm:centos-stream-9-x86_64[in_progress],rpm-build:centos-stream-9-aarch64[in_progress],rpm-build:centos-stream-9-x86_64[in_progress],test (centos:stream9, 16)[in_progress],test (centos:stream9, 13)[in_progress],test (centos:stream9, 40)[in_progress],test (centos:stream9, 21)[in_progress],test (centos:stream9, 17)[in_progress],test (centos:stream9, 98)[in_progress],test (centos:stream9, 12)[in_progress],test (centos:stream9, 11)[in_progress],test (centos:stream9, 10)[in_progress],test (centos:stream9, 01)[in_progress],test (centos:stream9, 20)[in_progress],test (centos:stream9, 02)[in_progress],lint-shell[in_progress]
🔴 Review - Missing review from a member (1 required)

That causes dropindirs_sort() to look for .conf files in / due to
expansion:

    for d in "$@"; do
        for i in "$d/"*"$suffix"; do

Fixes #1275

(cherry picked from commit 000cfa0c278c0858e81c8dd2ff7231f069f0afb1)

Resolves: RHEL-92584
@pvalena pvalena force-pushed the rhel-9-fix-92584 branch from 41738e3 to d25f886 Compare June 9, 2025 21:16
@github-actions
Copy link

github-actions bot commented Jun 9, 2025

sh-checker report

To get the full details, please check in the job output.

shellcheck errors

'shellcheck ' returned error 1 finding the following syntactical issues:

----------

In .distro/backport_fix.sh line 1:
#!/usr/bin/zsh
^-- SC1071: ShellCheck only supports sh/bash/dash/ksh scripts. Sorry!

For more information:
  https://www.shellcheck.net/wiki/SC1071 -- ShellCheck only supports sh/bash/...
----------

You can address the above issues in one of three ways:
1. Manually correct the issue in the offending shell script;
2. Disable specific issues by adding the comment:
  # shellcheck disable=NNNN
above the line that contains the issue, where NNNN is the error code;
3. Add '-e NNNN' to the SHELLCHECK_OPTS setting in your .yml action file.



shfmt errors

'shfmt -s' returned error 1 finding the following formatting issues:

----------
--- .distro/backport_fix.sh.orig
+++ .distro/backport_fix.sh
@@ -6,142 +6,142 @@
 set -xe
 zsh -n "$0"
 
-[[ -z "$EDITOR" ]] && EDITOR=nano
+[[ -z $EDITOR ]] && EDITOR=nano
 
 : "OPT: continue after solving cherry-pick conflict"
-[[ "$1" == "-c" ]] && {
-  {
-    shift ||:
-  } 2>/dev/null
-  CON=y
-  :
+[[ $1 == "-c" ]] && {
+    {
+        shift || :
+    } 2> /dev/null
+    CON=y
+    :
 } || CON=
 
 : "OPT: delete conflicting branch"
-[[ "$1" == "-d" ]] && {
-  {
-    shift ||:
-  } 2>/dev/null
-  DEL=y
-  :
+[[ $1 == "-d" ]] && {
+    {
+        shift || :
+    } 2> /dev/null
+    DEL=y
+    :
 } || DEL=
 
 : "OPT: Fedora distro"
-[[ "$1" == "-f" ]] && {
-  {
-    shift ||:
-  } 2>/dev/null
-  FED=y
-  :
+[[ $1 == "-f" ]] && {
+    {
+        shift || :
+    } 2> /dev/null
+    FED=y
+    :
 } || FED=
 
 : "OPT: local changes only"
-[[ "$1" == "-l" ]] && {
-  {
-    shift ||:
-  } 2>/dev/null
-  LOC=y
+[[ $1 == "-l" ]] && {
+    {
+        shift || :
+    } 2> /dev/null
+    LOC=y
 
 } || LOC=
 
 : "OPT: expect ref (commit-ish to get commits from) instead of PR #"
-[[ "$1" == "-r" ]] && {
-  {
-    shift ||:
-  } 2>/dev/null
-  REF=y
+[[ $1 == "-r" ]] && {
+    {
+        shift || :
+    } 2> /dev/null
+    REF=y
 
 } || REF=
 
 : "OPT: skip already applied commits"
-[[ "$1" == "-s" ]] && {
-  SKI="$2"
-  {
-    shift 2 ||:
-  } 2>/dev/null
-  :
+[[ $1 == "-s" ]] && {
+    SKI="$2"
+    {
+        shift 2 || :
+    } 2> /dev/null
+    :
 } || SKI=0
 
 : 'No more opts (check order)'
 {
-  [[ -n "$1" ]] && [[ "${1:0:1}" == "-" ]] && exit 4
+    [[ -n $1 ]] && [[ ${1:0:1} == "-" ]] && exit 4
 
-} 2>/dev/null
+} 2> /dev/null
 
-{ echo ; } 2>/dev/null
+{ echo; } 2> /dev/null
 
 : 'DISTRO version #'
 rv="${1}"
 {
-  [[ -n "$rv" ]]
-  shift
-} 2>/dev/null
+    [[ -n $rv ]]
+    shift
+} 2> /dev/null
 
 : 'Jira issue #'
 bn="${1}"
 {
-  [[ -n "$bn" ]]
-  shift ||:
-} 2>/dev/null
+    [[ -n $bn ]]
+    shift || :
+} 2> /dev/null
 
 : 'Dracut pull request or REF'
 pr="${1}"
 {
-  [[ -n "${pr}" ]]
-  shift ||:
-} 2>/dev/null
+    [[ -n ${pr} ]]
+    shift || :
+} 2> /dev/null
 
 : 'Commit count'
 cc="${1:-1}"
 {
-  [[ -n "$cc" ]]
-  shift ||:
-} 2>/dev/null
+    [[ -n $cc ]]
+    shift || :
+} 2> /dev/null
 
 : 'Commits origin repo'
 or="${1:-upstream-ng}"
 {
-  [[ -n "$or" ]]
-  shift ||:
-} 2>/dev/null
+    [[ -n $or ]]
+    shift || :
+} 2> /dev/null
 
 : 'No extra arg'
 {
-  [[ -z "$1" ]]
+    [[ -z $1 ]]
 
-} 2>/dev/null
+} 2> /dev/null
 
-{ echo ; } 2>/dev/null
+{ echo; } 2> /dev/null
 
-[[ -z "$FED" ]] && dist=rhel || dist=fedora
+[[ -z $FED ]] && dist=rhel || dist=fedora
 
 remote="${dist}-${rv}"
 
-[[ -z "$REF" ]] && rf="pr${pr}" || rf="${or}/${pr}"
+[[ -z $REF ]] && rf="pr${pr}" || rf="${or}/${pr}"
 
-{ echo ; } 2>/dev/null
+{ echo; } 2> /dev/null
 
-[[ -z "$CON" ]] && {
-  : "Create ${remote}-fix-${bn}?"
-  read '?-->continue?'
+[[ -z $CON ]] && {
+    : "Create ${remote}-fix-${bn}?"
+    read '?-->continue?'
 
-  gitt
-  gitc "${remote}"
+    gitt
+    gitc "${remote}"
 
-  [[ -n "$DEL" ]] && gitbd "${remote}-fix-${bn}" ||:
+    [[ -n $DEL ]] && gitbd "${remote}-fix-${bn}" || :
 
-  gitp "${remote}"
+    gitp "${remote}"
 
-  gitcb "${remote}-fix-${bn}"
+    gitcb "${remote}-fix-${bn}"
 
-  gitrh "${remote}/main"
+    gitrh "${remote}/main"
 
-  [[ -z "$REF" ]] && gitf "${or}" "refs/pull/${pr}/head:${rf}"
+    [[ -z $REF ]] && gitf "${or}" "refs/pull/${pr}/head:${rf}"
 }
 
 : "List Commits"
 cis="$(gitl1 "${rf}" "-${cc}" --reverse | cut -d' ' -f1)"
-[[ -n "${cis}" ]]
+[[ -n ${cis} ]]
 
 com="\nCherry-picked commits:\n${cis}\n"
 
@@ -153,72 +153,72 @@
 
 i=0
 echo "${cis}" \
-| while read ci; do
-    [[ -n "${ci}" ]] || continue
+    | while read ci; do
+        [[ -n ${ci} ]] || continue
 
-    i=$(($i+1))
+        i=$((i + 1))
 
-    [[ $i -le $SKI ]] && continue
+        [[ $i -le $SKI ]] && continue
 
-    gityx "${ci}" || {
+        gityx "${ci}" || {
 
-      mod="$(gits | grep '^\s*both modified: ')" ||:
+            mod="$(gits | grep '^\s*both modified: ')" || :
 
-      [[ -z "$mod" ]] || {
+            [[ -z $mod ]] || {
 
-        mod="$(echo "$mod" | tr -s ' ' | cut -d' ' -f3)"
+                mod="$(echo "$mod" | tr -s ' ' | cut -d' ' -f3)"
 
-        ls -d $mod
+                ls -d $mod
 
-        $EDITOR $mod
+                $EDITOR $mod
 
-        gita $mod
+                gita $mod
 
-        gitdh
+                gitdh
 
-        gits
+                gits
 
-        exit 2
-      }
+                exit 2
+            }
 
-      gits | grep -q '^nothing to commit' \
-        && {
-          gits | grep 'git cherry-pick --skip'
+            gits | grep -q '^nothing to commit' \
+                && {
+                    gits | grep 'git cherry-pick --skip'
 
-          gity --skip
-          :
-        } || {
+                    gity --skip
+                    :
+                } || {
 
-          gits
+                gits
 
-          exit 3
+                exit 3
+            }
         }
-    }
-  done
+    done
 
 read '?-->continue?'
 
-[[ -z "$CON" ]] && {
-  [[ ${cc} -gt 1 ]] && {
+[[ -z $CON ]] && {
+    [[ ${cc} -gt 1 ]] && {
 
-    gitei HEAD~${cc}
-    :
-  } || {
+        gitei HEAD~${cc}
+        :
+    } || {
 
-    gitia --amend
-  }
-  :
+        gitia --amend
+    }
+    :
 } || {
-  gits | grep -q '^\s*both modified: ' \
-    && gita `gits | grep '^\s*both modified: ' | tr -s ' ' | cut -d' ' -f3`
+    gits | grep -q '^\s*both modified: ' \
+        && gita $(gits | grep '^\s*both modified: ' | tr -s ' ' | cut -d' ' -f3)
 
-  gityc ||:
+    gityc || :
 }
 
-gitl ||:
-gitlp ||:
+gitl || :
+gitlp || :
 
-[[ -z "$LOC" ]] || exit 0
+[[ -z $LOC ]] || exit 0
 
 gituu "${remote}"
 
----------

You can reformat the above files to meet shfmt's requirements by typing:

  shfmt -s -w filename


@pvalena
Copy link
Contributor Author

pvalena commented Jun 9, 2025

LGTM.

@pvalena pvalena merged commit 6d0f4d4 into main Jun 9, 2025
21 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants