* [gentoo-commits] gentoo-projects commit in pax-utils/tests/source: dotest space space.py
@ 2011-03-17 3:58 Mike Frysinger (vapier)
0 siblings, 0 replies; only message in thread
From: Mike Frysinger (vapier) @ 2011-03-17 3:58 UTC (permalink / raw
To: gentoo-commits
vapier 11/03/17 03:58:01
Modified: dotest
Added: space
Removed: space.py
Log:
avoid using python and md5sum when possible
Revision Changes Path
1.4 pax-utils/tests/source/dotest
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/tests/source/dotest?rev=1.4&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/tests/source/dotest?rev=1.4&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/tests/source/dotest?r1=1.3&r2=1.4
Index: dotest
===================================================================
RCS file: /var/cvsroot/gentoo-projects/pax-utils/tests/source/dotest,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- dotest 14 Feb 2010 01:14:19 -0000 1.3
+++ dotest 17 Mar 2011 03:58:01 -0000 1.4
@@ -88,17 +88,17 @@
testit src.style
-# Stupid BSD makes us check for this..
-if [ $(type -P md5sum) != "" ]; then
- for x in $(find "${top_srcdir}" '(' -name '*.c' -o -name '*.h' ')' ); do
- python "${srcdir}"/space.py $x > $x~
- if [[ $(md5sum $x | awk '{print $1}') != $(md5sum $x~ | awk '{print $1}') ]]; then
- diff -u $x $x~
- #cp $x~ $x
- fi
- rm $x~
- done > src.space
- testit src.space
-fi
+#
+# Auto clean up the space issues
+#
+for x in $(find ../.. '(' -name '*.c' -o -name '*.h' ')' ); do
+ ./space "$x" > "$x~"
+ if ! diff -u "$x" "$x~" ; then
+ echo "New file: $x~"
+ else
+ rm -f "$x~"
+ fi
+done > src.space
+testit src.space
exit ${ret}
1.1 pax-utils/tests/source/space
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/tests/source/space?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/tests/source/space?rev=1.1&content-type=text/plain
Index: space
===================================================================
#!/bin/sh
# Usage: space <file>
# Trim trailing whitespace and consecutive newlines.
i=$1
if [ $# != 1 ] ; then
cat <<-EOF
Usage: ${0##/*} <file>
Trim trailing whitespace and consecutive newlines.
EOF
fi
sed -r '/[[:space:]]+$/s:[[:space:]]+$::' "$i" | \
awk '{
if (NF == 0) {
while (NF == 0)
if (getline == 0)
exit
print ""
}
print
}'
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-03-17 3:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-17 3:58 [gentoo-commits] gentoo-projects commit in pax-utils/tests/source: dotest space space.py Mike Frysinger (vapier)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox