[WIP 2/3] cli/insert: move several file/directory manipulation routines into a new...
[notmuch-archives.git] / 08 / b9da1bac0cd3ae4d9b084e057d9930b4d8baf7
1 Return-Path: <too@guru-group.fi>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id BCF7F431FB6\r
6         for <notmuch@notmuchmail.org>; Tue,  4 Sep 2012 07:49:16 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id KK4xdBF8ymcy for <notmuch@notmuchmail.org>;\r
16         Tue,  4 Sep 2012 07:49:14 -0700 (PDT)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 8C411431FBD\r
19         for <notmuch@notmuchmail.org>; Tue,  4 Sep 2012 07:49:14 -0700 (PDT)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id BE7F310014E; Tue,  4 Sep 2012 17:49:20 +0300 (EEST)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: notmuch@notmuchmail.org\r
24 Subject: Release checks v3\r
25 Date: Tue,  4 Sep 2012 17:49:11 +0300\r
26 Message-Id: <1346770153-14947-1-git-send-email-tomi.ollila@iki.fi>\r
27 X-Mailer: git-send-email 1.7.1\r
28 Cc: tomi.ollila@iki.fi\r
29 X-BeenThere: notmuch@notmuchmail.org\r
30 X-Mailman-Version: 2.1.13\r
31 Precedence: list\r
32 List-Id: "Use and development of the notmuch mail system."\r
33         <notmuch.notmuchmail.org>\r
34 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
35         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
36 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
37 List-Post: <mailto:notmuch@notmuchmail.org>\r
38 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
39 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
40         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
41 X-List-Received-Date: Tue, 04 Sep 2012 14:49:17 -0000\r
42 \r
43 This if V3 of release-check.sh patches, displacing\r
44 \r
45 id:"1346491928-2356-1-git-send-email-tomi.ollila@iki.fi"\r
46 \r
47 Changes:\r
48 \r
49 Bash kept, mainly for pipefail -- and that possible future pipeline \r
50 additions have more protection.\r
51 \r
52 Added set -o posix lessens drifts to more bashishms -- and somewhere was \r
53 mentioned that posix mode provides a bit more robust pipefail...\r
54 \r
55 Changed that one short circuit & continues to if... elif... fi construct.\r
56 \r
57 Used  *[^0-9.]*) for matching non-digit and non-dot characters; this\r
58 was really nice one.\r
59 \r
60 One formatting change (added newline).\r
61 \r
62 Removed last 'exit 0'.\r
63 \r
64 ---\r
65 \r
66 Something related: Some good pages for shell differences can be browsed at\r
67 http://www.in-ulm.de/~mascheck/\r
68 \r
69 Diffdiff of the changes follows:\r
70 \r
71 --- v2/release-checks.sh\r
72 +++ v3/release-checks.sh\r
73 @@ -10,13 +10,12 @@ then        echo\r
74         exit 1\r
75  fi\r
76  \r
77 +set -o posix\r
78  set -o pipefail # bash feature\r
79  \r
80  # Avoid locale-specific differences in output of executed commands\r
81  LANG=C LC_ALL=C; export LANG LC_ALL\r
82  \r
83 -readonly DEFAULT_IFS="$IFS"\r
84 -\r
85  readonly PV_FILE='bindings/python/notmuch/version.py'\r
86  \r
87  # Using array here turned out to be unnecessarily complicated\r
88 @@ -28,9 +27,10 @@ append_emsg ()\r
89  \r
90  for f in ./version debian/changelog NEWS "$PV_FILE"\r
91  do\r
92 -       test -f $f || { append_emsg "File '$f' is missing"; continue; }\r
93 -       test -r $f || { append_emsg "File '$f' is unreadable"; continue; }\r
94 -       test -s $f ||   append_emsg "File '$f' is empty"\r
95 +       if   [ ! -f "$f" ]; then append_emsg "File '$f' is missing"\r
96 +       elif [ ! -r "$f" ]; then append_emsg "File '$f' is unreadable"\r
97 +       elif [ ! -s "$f" ]; then append_emsg "File '$f' is empty"\r
98 +       fi\r
99  done\r
100  \r
101  if [ -n "$emsgs" ]\r
102 @@ -62,18 +62,15 @@ verfail ()\r
103  }\r
104  \r
105  echo -n "Checking that '$VERSION' is good with digits and periods... "\r
106 -if [ -z "${VERSION//[0123456789.]/}" ] # bash feature\r
107 -then\r
108 -       case $VERSION in\r
109 -               .*)     verfail "'$VERSION' begins with a period" ;;\r
110 -               *.)     verfail "'$VERSION' ends with a period" ;;\r
111 -               *..*)   verfail "'$VERSION' contains two consecutive periods" ;;\r
112 -               *.*)    echo Yes. ;;\r
113 -               *)      verfail "'$VERSION' is a single number" ;;\r
114 -       esac\r
115 -else\r
116 -       verfail "'$VERSION' contains other characters than digits and periods"\r
117 -fi\r
118 +case $VERSION in\r
119 +       *[^0-9.]*)\r
120 +               verfail "'$VERSION' contains other characters than digits and periods" ;;\r
121 +       .*)     verfail "'$VERSION' begins with a period" ;;\r
122 +       *.)     verfail "'$VERSION' ends with a period" ;;\r
123 +       *..*)   verfail "'$VERSION' contains two consecutive periods" ;;\r
124 +       *.*)    echo Yes. ;;\r
125 +       *)      verfail "'$VERSION' is a single number" ;;\r
126 +esac\r
127  \r
128  \r
129  # In the rest of this file, tests collect list of errors to be fixed\r
130 @@ -168,7 +165,9 @@ manfiles=`find man -type f | sort`\r
131  man_pages_ok=Yes\r
132  for mp in $manfiles\r
133  do\r
134 -       case $mp in *.[0-9]) ;; # fall below this 'case ... esac'\r
135 +       case $mp in\r
136 +               *.[0-9]) ;; # fall below this 'case ... esac'\r
137 +\r
138                 */Makefile.local | */Makefile ) continue ;;\r
139                 */.gitignore)   continue ;;\r
140                 *.bak)          continue ;;\r
141 @@ -201,7 +200,6 @@ echo 'All checks this script executed completed successfully.'\r
142  echo 'Make sure that everything else mentioned in RELEASING'\r
143  echo 'file is in order, too.'\r
144  \r
145 -exit 0\r
146  \r
147  # Local variables:\r
148  # mode: shell-script\r
149 \r
150 \r