Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-tools.git;a=commitdiff;h=ff00e2fe92f8d00e0dc77f9ed42ad638f72dbabe

commit ff00e2fe92f8d00e0dc77f9ed42ad638f72dbabe
Author: Miklos Vajna <vmik...@frugalware.org>
Date:   Wed May 5 13:36:41 2010 +0200

fblint: use perl for trailing newline check

ed's output is not part ed's api so it may silently change, breaking
fblint. use perl instead

diff --git a/fblint b/fblint
index 510d717..f5eb4d9 100755
--- a/fblint
+++ b/fblint
@@ -2,7 +2,7 @@
#
#   fblint for Frugalware
#
-#   Copyright (c) 2006, 2007, 2008, 2009 by Miklos Vajna 
<vmik...@frugalware.org>
+#   Copyright (c) 2006, 2007, 2008, 2009, 2010 by Miklos Vajna 
<vmik...@frugalware.org>
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
@@ -190,7 +190,7 @@ if [ "`get_root`" = "stable" -o "`get_root`" = "$codename" 
]; then
check "unchanged pkgrel" "echo $pkgrel | grep -q '$codename'"
fi
check "trailing whitespace" "! grep -q ' $' $_fblint_fb"
-check "existence of trailing newline" "[ '`echo 'q' | ed -s $_fblint_fb 2>&1`' 
!= 'Newline appended' ]"
+check "existence of trailing newline" "! cat $_fblint_fb |perl -le '@a=<>; 
exit \$a[\$#a] =~ /\\n$/s ? 1 : 0'"
[ "$_fblint_verbose" ] && echo "done: $_fblint_done, failed $_fblint_failed"

if [ $_fblint_failed -gt 0 ]; then
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to