]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
use ls to expand spec count
authorElan Ruusamäe <glen@delfi.ee>
Sat, 9 Jan 2016 16:01:45 +0000 (18:01 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Sat, 9 Jan 2016 16:01:45 +0000 (18:01 +0200)
shrc.sh

diff --git a/shrc.sh b/shrc.sh
index d0f91f7b6fb9a18739da061b53fd24b903eb3df4..b616a4109da1d6da31657c96460002359172bbe6 100755 (executable)
--- a/shrc.sh
+++ b/shrc.sh
@@ -335,7 +335,7 @@ __bash_parse_git_branch() {
 
 # if we are in rpm subdir and have exactly one .spec in the dir, include package version
 __package_rpmversion() {
-       if [[ $PWD =~ $(rpm -E %_topdir) ]] && [ "$(echo *.spec | wc -w)" = 1 ]; then
+       if [[ $PWD =~ $(rpm -E %_topdir) ]] && [ "$(\ls *.spec 2>/dev/null | wc -w)" = 1 ]; then
                # give only first version (ignore subpackages)
                rpm --specfile *.spec -q --qf '%{VERSION}\n' | head -n1
        fi
This page took 0.034875 seconds and 4 git commands to generate.