[OS-BUILD PATCH 11/20] [redhat] expand_srpm.sh: Fix syntax flagged by shellcheck

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ben Crocker <bcrocker@xxxxxxxxxx>

SC2034: tree appears unused. Verify use (or export if used externally).
SC2035: Use ./*glob* or -- *glob* so names with dashes won't become options.
SC2086: Double quote to prevent globbing and word splitting.

Signed-off-by: Ben Crocker <bcrocker@xxxxxxxxxx>
---
 redhat/scripts/expand_srpm.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/redhat/scripts/expand_srpm.sh b/redhat/scripts/expand_srpm.sh
index ba38db2867d0..1f89b24f17d4 100755
--- a/redhat/scripts/expand_srpm.sh
+++ b/redhat/scripts/expand_srpm.sh
@@ -4,6 +4,7 @@
 # $2: cloned tree
 # $3: package name
 # $4: name of srpm
+# shellcheck disable=SC2034     # tree, redhat unused
 
 tree="$1";
 cloned="$2";
@@ -11,10 +12,10 @@ package_name="$3";
 redhat="$1/redhat";
 srpm="$4";
 
-cd $cloned/$package_name || die "\"$cloned\" doesn't seem to have a dist-git clone";
+cd "$cloned/$package_name" || die "\"$cloned\" doesn't seem to have a dist-git clone";
 
 # delete everything in the cloned tree to avoid having stale files
-rm -r *
+rm -r -- *
 
 git reset HEAD -- sources
 git checkout sources
@@ -22,7 +23,7 @@ echo "*.xz" > .gitignore
 echo "*.bz2" >> .gitignore
 
 # expand the srpm into the tree
-rpm2cpio $srpm | cpio -idmv
+rpm2cpio "$srpm" | cpio -idmv
 
 git add -A
 
-- 
GitLab
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux