unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Release checks v3
@ 2012-09-04 14:49 Tomi Ollila
  2012-09-04 14:49 ` [PATCH v3 1/2] devel: add release-checks.sh Tomi Ollila
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Tomi Ollila @ 2012-09-04 14:49 UTC (permalink / raw)
  To: notmuch; +Cc: tomi.ollila

This if V3 of release-check.sh patches, displacing

id:"1346491928-2356-1-git-send-email-tomi.ollila@iki.fi"

Changes:

Bash kept, mainly for pipefail -- and that possible future pipeline 
additions have more protection.

Added set -o posix lessens drifts to more bashishms -- and somewhere was 
mentioned that posix mode provides a bit more robust pipefail...

Changed that one short circuit & continues to if... elif... fi construct.

Used  *[^0-9.]*) for matching non-digit and non-dot characters; this
was really nice one.

One formatting change (added newline).

Removed last 'exit 0'.

---

Something related: Some good pages for shell differences can be browsed at
http://www.in-ulm.de/~mascheck/

Diffdiff of the changes follows:

--- v2/release-checks.sh
+++ v3/release-checks.sh
@@ -10,13 +10,12 @@ then	echo
 	exit 1
 fi
 
+set -o posix
 set -o pipefail # bash feature
 
 # Avoid locale-specific differences in output of executed commands
 LANG=C LC_ALL=C; export LANG LC_ALL
 
-readonly DEFAULT_IFS="$IFS"
-
 readonly PV_FILE='bindings/python/notmuch/version.py'
 
 # Using array here turned out to be unnecessarily complicated
@@ -28,9 +27,10 @@ append_emsg ()
 
 for f in ./version debian/changelog NEWS "$PV_FILE"
 do
-	test -f $f || { append_emsg "File '$f' is missing"; continue; }
-	test -r $f || { append_emsg "File '$f' is unreadable"; continue; }
-	test -s $f ||   append_emsg "File '$f' is empty"
+	if   [ ! -f "$f" ]; then append_emsg "File '$f' is missing"
+	elif [ ! -r "$f" ]; then append_emsg "File '$f' is unreadable"
+	elif [ ! -s "$f" ]; then append_emsg "File '$f' is empty"
+	fi
 done
 
 if [ -n "$emsgs" ]
@@ -62,18 +62,15 @@ verfail ()
 }
 
 echo -n "Checking that '$VERSION' is good with digits and periods... "
-if [ -z "${VERSION//[0123456789.]/}" ] # bash feature
-then
-	case $VERSION in
-		.*)	verfail "'$VERSION' begins with a period" ;;
-		*.)	verfail "'$VERSION' ends with a period" ;;
-		*..*)	verfail "'$VERSION' contains two consecutive periods" ;;
-		*.*)	echo Yes. ;;
-		*)	verfail "'$VERSION' is a single number" ;;
-	esac
-else
-	verfail "'$VERSION' contains other characters than digits and periods"
-fi
+case $VERSION in
+	*[^0-9.]*)
+		verfail "'$VERSION' contains other characters than digits and periods" ;;
+	.*)	verfail "'$VERSION' begins with a period" ;;
+	*.)	verfail "'$VERSION' ends with a period" ;;
+	*..*)	verfail "'$VERSION' contains two consecutive periods" ;;
+	*.*)	echo Yes. ;;
+	*)	verfail "'$VERSION' is a single number" ;;
+esac
 
 
 # In the rest of this file, tests collect list of errors to be fixed
@@ -168,7 +165,9 @@ manfiles=`find man -type f | sort`
 man_pages_ok=Yes
 for mp in $manfiles
 do
-	case $mp in *.[0-9]) ;; # fall below this 'case ... esac'
+	case $mp in
+		*.[0-9]) ;; # fall below this 'case ... esac'
+
 		*/Makefile.local | */Makefile ) continue ;;
 		*/.gitignore)	continue ;;
 		*.bak)		continue ;;
@@ -201,7 +200,6 @@ echo 'All checks this script executed completed successfully.'
 echo 'Make sure that everything else mentioned in RELEASING'
 echo 'file is in order, too.'
 
-exit 0
 
 # Local variables:
 # mode: shell-script

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-05 11:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-04 14:49 Release checks v3 Tomi Ollila
2012-09-04 14:49 ` [PATCH v3 1/2] devel: add release-checks.sh Tomi Ollila
2012-09-04 14:49 ` [PATCH v3 2/2] {., man}/Makefile.local: edit/remove release-checks.sh related targets Tomi Ollila
2012-09-04 15:41 ` Release checks v3 Michal Nazarewicz
2012-09-05 11:45 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).