From: Ben Crocker <bcrocker(a)redhat.com>
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(a)redhat.com>
---
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