From: Tomi Ollila <tomi.ollila@iki.fi>
To: notmuch@notmuchmail.org
Cc: tomi.ollila@iki.fi
Subject: Release checks v3
Date: Tue, 4 Sep 2012 17:49:11 +0300 [thread overview]
Message-ID: <1346770153-14947-1-git-send-email-tomi.ollila@iki.fi> (raw)
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
next reply other threads:[~2012-09-04 14:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-04 14:49 Tomi Ollila [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1346770153-14947-1-git-send-email-tomi.ollila@iki.fi \
--to=tomi.ollila@iki.fi \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).