[arch-projects] [devtools] [PATCH 2/3] commitpkg: Avoid unnecessary use of grep(1)

Lukas Fleischer archlinux at cryptocrack.de
Wed Aug 10 09:17:59 EDT 2011


Use bash patterns instead of using grep(1) to check if a source file
contains the string "://".

Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
---
 commitpkg |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/commitpkg b/commitpkg
index 999c35f..07c28d4 100755
--- a/commitpkg
+++ b/commitpkg
@@ -79,9 +79,9 @@ esac
 
 # check if all local source files are under version control
 for s in "${source[@]}"; do
-	echo "$s" | grep -Fvq '://' && \
-	svn status "$s" | grep -q '^\?' && \
-	abort "$s is not under version control"
+	if [[ $s != *://* ]] && svn status "$s" | grep -q '^\?'; then
+		abort "$s is not under version control"
+	fi
 done
 
 # check if changelog and install files are under version control
-- 
1.7.6



More information about the arch-projects mailing list