Re: [PATCH V2 1/2] devel: add release-checks.sh
authorMichal Nazarewicz <mina86@mina86.com>
Mon, 3 Sep 2012 12:03:41 +0000 (14:03 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:19 +0000 (09:49 -0800)
c4/3296eb7b550ba7bf532e32ca0e14f70e4ec1fb [new file with mode: 0644]

diff --git a/c4/3296eb7b550ba7bf532e32ca0e14f70e4ec1fb b/c4/3296eb7b550ba7bf532e32ca0e14f70e4ec1fb
new file mode 100644 (file)
index 0000000..8ba1f4c
--- /dev/null
@@ -0,0 +1,395 @@
+Return-Path: <mpn@google.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id B482C431FB6\r
+       for <notmuch@notmuchmail.org>; Mon,  3 Sep 2012 05:03:51 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 1FdwKoRGXXzd for <notmuch@notmuchmail.org>;\r
+       Mon,  3 Sep 2012 05:03:50 -0700 (PDT)\r
+Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com\r
+ [74.125.83.53])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 63841431FAF   for <notmuch@notmuchmail.org>; Mon,  3 Sep 2012 05:03:50 -0700\r
+ (PDT)\r
+Received: by eekb47 with SMTP id b47so2241177eek.26\r
+       for <notmuch@notmuchmail.org>; Mon, 03 Sep 2012 05:03:49 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\r
+ s=20120113;   h=sender:from:to:cc:subject:in-reply-to:organization:references\r
+       :user-agent:x-face:face:x-pgp:x-pgp-fp:date:message-id:mime-version\r
+       :content-type; bh=mgvhuXIPc+i17l42CQQaDhwU50WckjlXG4UmaXULU8E=;\r
+       b=WpH322MsNcdujFytTh1VztN7IYzZAZyDESRUEPIWAIEIbFtZE3phcKO01rEvS1Rwto\r
+       Rcauk8dYVXQNC5I67AxO+3c5zze2aeSlf13cOeKXk5WXwDmI3lkjBwe9MASZvTqEA4Rv\r
+       KxEcLuuqIADp9eJZxuOWu2yI4F3PDeQ/ov++f+MXeaN+dELaxBb7yszkLnhaHc1aNXfW\r
+       OA0ilxIjTIUPvpF7f9+gnU5oNV1TDKMvZ9GKpQhKt3KDQN9gvq/dQAdULa4TXI//1+NE\r
+       g0h0kzzXgyi6QIt/I+6BxREo1OocNa7ruObqZOydjPSQU7SaXmBx9l++kx2253DM44HP    UIKg==\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=google.com; s=20120113;\r
+       h=sender:from:to:cc:subject:in-reply-to:organization:references\r
+       :user-agent:x-face:face:x-pgp:x-pgp-fp:date:message-id:mime-version\r
+       :content-type:x-gm-message-state;\r
+       bh=mgvhuXIPc+i17l42CQQaDhwU50WckjlXG4UmaXULU8E=;\r
+       b=bVaSf+hjiQ60Mv1dLOXqCxkOXJjb0O2NCBc/fT9mnm8yQl08VzK83aVNMVV9+w1XBo\r
+       egeXbxozclkw9jnlaecbs4Ixmp/zSYm2sozo7hdT0fIQmyYvteTBVIr/tIyHbJmFoz/V\r
+       SGGeHCPMJt+9zNFaJDavEgKLvKeHjr54HDrJO6Cy0mezdY8GP9h3JcMpfwQzUb+ShqsN\r
+       6vwGdmyuaowNae4kNeak1nx4o7QEjxYq3Sgjp9m8gsHgXaudHTBhfCAOeoK3F/7Ll6Mc\r
+       613cZsgWIFKVTlOeAOkxNdqejJcPsdNRn2w5DF6xaOvYCQ/UPzrnsPW7hnUAmgGNSvFO\r
+       2fpQ==\r
+Received: by 10.14.204.200 with SMTP id h48mr21403773eeo.7.1346673829205;\r
+       Mon, 03 Sep 2012 05:03:49 -0700 (PDT)\r
+Received: by 10.14.204.200 with SMTP id h48mr21403758eeo.7.1346673829045;\r
+       Mon, 03 Sep 2012 05:03:49 -0700 (PDT)\r
+Received: from mpn-glaptop ([2620:0:105f:5:f2de:f1ff:fe35:1a72])\r
+       by mx.google.com with ESMTPS id i8sm35886935eeo.16.2012.09.03.05.03.47\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Mon, 03 Sep 2012 05:03:47 -0700 (PDT)\r
+Sender: Michal Nazarewicz <mpn@google.com>\r
+From: Michal Nazarewicz <mina86@mina86.com>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH V2 1/2] devel: add release-checks.sh\r
+In-Reply-To: <1346491928-2356-1-git-send-email-tomi.ollila@iki.fi>\r
+Organization: http://mina86.com/\r
+References: <1346491928-2356-1-git-send-email-tomi.ollila@iki.fi>\r
+User-Agent: Notmuch/0.14+2~g416b120 (http://notmuchmail.org) Emacs/24.2.50.1\r
+       (x86_64-unknown-linux-gnu)\r
+X-Face: PbkBB1w#)bOqd`iCe"Ds{e+!C7`pkC9a|f)Qo^BMQvy\q5x3?vDQJeN(DS?|-^$uMti[3D*#^_Ts"pU$jBQLq~Ud6iNwAw_r_o_4]|JO?]}P_}Nc&"p#D(ZgUb4uCNPe7~a[DbPG0T~!&c.y$Ur,=N4RT>]dNpd;       KFrfMCylc}gc??'U2j,!8%xdD\r
+Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWbfGlUPDDHgE57V0jUupKjgIObY0PLrom9mH4dFRK4gmjPs41MxjOgAAACQElEQVQ4jW3TMWvbQBQHcBk1xE6WyALX1069oZBMlq+ouUwpEQQ6uRjttkWP4CmBgGM0BQLBdPFZYPsyFUo6uEtKDQ7oy/U96XR2Ux8ehH/89Z6enqxBcS7Lg81jmSuujrfCZcLI/TYYvbGj+jbgFpHJ/bqQAUISj8iLyu4LuFHJTosxsucO4jSDNE0Hq3hwK/ceQ5sx97b8LcUDsILfk+ovHkOIsMbBfg43VuQ5Ln9YAGCkUdKJoXR9EclFBhixy3EGVz1K6eEkhxCAkeMMnqoAhAKwhoUJkDrCqvbecaYINlFKSRS1i12VKH1XpUd4qxL876EkMcDvHj3s5RBajHHMlA5iK32e0C7VgG0RlzFPvoYHZLRmAC0BmNcBruhkE0KsMsbEc62ZwUJDxWUdMsMhVqovoT96i/DnX/ASvz/6hbCabELLk/6FF/8PNpPCGqcZTGFcBhhAaZZDbQPaAB3+KrWWy2XgbYDNIinkdWAFcCpraDE/knwe5DBqGmgzESl1p2E4MWAz0VUPgYYzmfWb9yS4vCvgsxJriNTHoIBz5YteBvg+VGISQWUqhMiByPIPpygeDBE6elD973xWwKkEiHZAHKjhuPsFnBuArrzxtakRcISv+XMIPl4aGBUJm8Emk7qBYU8IlgNEIpiJhk/No24jHwkKTFHDWfPniR4iw5vJaw2nzSjfq2zffcE/GDjRC2dn0J0XwPAbDL84TvaFCJEU4Oml9pRyEUhR3Cl2t01AoEjRbs0sYugp14/4X5n4pU4EHHnMAAAAAElFTkSuQmCC\r
+X-PGP: 50751FF4\r
+X-PGP-FP: AC1F 5F5C D418 88F8 CC84 5858 2060 4012 5075 1FF4\r
+Date: Mon, 03 Sep 2012 14:03:41 +0200\r
+Message-ID: <xa1t7gsbwbxe.fsf@mina86.com>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/mixed; boundary="=-=-="\r
+X-Gm-Message-State: ALoCoQlMVStqqKWVmrNVCe2V8KoM9OGZWoA3aWFuYjyMv1nsnhAYvvS2gGve6d8200Wu//j+bYTkPAmuIlW+cQW8jLyEBjLJFKEs+gVSiZu10bzVeoll4ffspt42d60ADLC2MtBX/8bH5rK05ZvTIjeGcLLKF47xzJRV9CVXE7EHbqT3UF9sO9vRPUDmnTF4e079FLH9+/Cx\r
+Cc: Tomi Ollila <tomi.ollila@iki.fi>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 03 Sep 2012 12:03:51 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+Tomi Ollila <tomi.ollila@iki.fi> writes:\r
+> diff --git a/devel/release-checks.sh b/devel/release-checks.sh\r
+> new file mode 100755\r
+> index 0000000..7dadefa\r
+> --- /dev/null\r
+> +++ b/devel/release-checks.sh\r
+> @@ -0,0 +1,211 @@\r
+> +#!/usr/bin/env bash\r
+\r
+On a side note, the whole script could be relatively easily rewritten\r
+not to use bash at all and work with plain POSIX shell.\r
+\r
+> +\r
+> +set -eu\r
+> +#set -x # or enter bash -x ... on command line\r
+> +\r
+> +if [ x"${BASH_VERSION-}" =3D x ]\r
+\r
+-n perhaps?\r
+\r
+> +then        echo\r
+> +    echo "Please execute this script using 'bash' interpreter"\r
+> +    echo\r
+> +    exit 1\r
+> +fi\r
+> +\r
+> +set -o pipefail # bash feature\r
+> +\r
+> +# Avoid locale-specific differences in output of executed commands\r
+> +LANG=3DC LC_ALL=3DC; export LANG LC_ALL\r
+> +\r
+> +readonly DEFAULT_IFS=3D"$IFS"\r
+\r
+Never used.\r
+\r
+> +\r
+> +readonly PV_FILE=3D'bindings/python/notmuch/version.py'\r
+> +\r
+> +# Using array here turned out to be unnecessarily complicated\r
+> +emsgs=3D''\r
+> +append_emsg ()\r
+> +{\r
+> +    emsgs=3D"${emsgs:+$emsgs\n}  $1"\r
+> +}\r
+> +\r
+> +for f in ./version debian/changelog NEWS "$PV_FILE"\r
+> +do\r
+> +    test -f $f || { append_emsg "File '$f' is missing"; continue; }\r
+> +    test -r $f || { append_emsg "File '$f' is unreadable"; continue; }\r
+> +    test -s $f ||   append_emsg "File '$f' is empty"\r
+\r
+if ! [ -f "$f" ]; then\r
+       append_emsg "File '$f' is missing"\r
+elif ! [ -r "$f" ]; then\r
+       append_emsg "File '$f' is unreadable"\r
+elif ! [ -s "$f" ]; then\r
+       append_emsg "File '$f' is empty"\r
+fi\r
+\r
+> +done\r
+> +\r
+> +if [ -n "$emsgs" ]\r
+> +then\r
+> +    echo 'Release files problems; fix these and try again:'\r
+> +    echo -e "$emsgs"\r
+> +    exit 1\r
+> +fi\r
+> +\r
+> +if read VERSION\r
+> +then\r
+> +    if read rest\r
+> +    then    echo "'version' file contains more than one line"\r
+> +            exit 1\r
+> +    fi\r
+> +else\r
+> +    echo "Reading './version' file failed (suprisingly!)"\r
+> +    exit 1\r
+> +fi < ./version\r
+> +\r
+> +readonly VERSION\r
+> +\r
+> +verfail ()\r
+> +{\r
+> +    echo No.\r
+> +    echo "$@"\r
+> +    echo "Please follow the instructions in RELEASING to choose a version"\r
+> +    exit 1\r
+> +}\r
+> +\r
+> +echo -n "Checking that '$VERSION' is good with digits and periods... "\r
+> +if [ -z "${VERSION//[0123456789.]/}" ] # bash feature\r
+> +then\r
+> +    case $VERSION in\r
+> +            .*)     verfail "'$VERSION' begins with a period" ;;\r
+> +            *.)     verfail "'$VERSION' ends with a period" ;;\r
+> +            *..*)   verfail "'$VERSION' contains two consecutive periods" ;;\r
+> +            *.*)    echo Yes. ;;\r
+> +            *)      verfail "'$VERSION' is a single number" ;;\r
+> +    esac\r
+> +else\r
+> +    verfail "'$VERSION' contains other characters than digits and periods"\r
+> +fi\r
+\r
+The outer condition can be put inside of case as so:\r
+\r
+       *[^0-9.]*)      verfail "'$VERSION' contains other characters than digits and p=\r
+eriods"\r
+\r
+This makes it more readable by putting all checks in case rather than\r
+splitting one to an outer if.\r
+\r
+> +\r
+> +\r
+> +# In the rest of this file, tests collect list of errors to be fixed\r
+> +\r
+> +echo -n "Checking that this is Debian package for notmuch... "\r
+> +read deb_notmuch deb_version rest < debian/changelog\r
+> +if [ "$deb_notmuch" =3D 'notmuch' ]\r
+\r
+if [ x"$deb_notmuch" =3D xnotmuch ]\r
+\r
+And so in the rest of the conditions below.\r
+\r
+> +then\r
+> +    echo Yes.\r
+> +else\r
+> +    echo No.\r
+> +    append_emsg "Package name '$deb_notmuch' is not 'notmuch' in debian/cha=\r
+ngelog"\r
+> +fi\r
+> +\r
+> +echo -n "Checking that Debian package version is $VERSION-1... "\r
+> +\r
+> +if [ "$deb_version" =3D "($VERSION-1)" ]\r
+> +then\r
+> +    echo Yes.\r
+> +else\r
+> +    echo No.\r
+> +    append_emsg "Version '$deb_version' is not '($VERSION-1)' in debian/cha=\r
+ngelog"\r
+> +fi\r
+> +\r
+> +echo -n "Checking that python bindings version is $VERSION... "\r
+> +py_version=3D`python -c "execfile('$PV_FILE'); print __VERSION__"`\r
+> +if [ "$py_version" =3D "$VERSION" ]\r
+> +then\r
+> +    echo Yes.\r
+> +else\r
+> +    echo No.\r
+> +    append_emsg "Version '$py_version' is not '$VERSION' in $PV_FILE"\r
+> +fi\r
+> +\r
+> +echo -n "Checking that this is Notmuch NEWS... "\r
+> +read news_notmuch news_version news_date < NEWS\r
+> +if [ "$news_notmuch" =3D "Notmuch" ]\r
+> +then\r
+> +    echo Yes.\r
+> +else\r
+> +    echo No.\r
+> +    append_emsg "First word '$news_notmuch' is not 'Notmuch' in NEWS file"\r
+> +fi\r
+> +\r
+> +echo -n "Checking that NEWS version is $VERSION... "\r
+> +if [ "$news_version" =3D "$VERSION" ]\r
+> +then\r
+> +    echo Yes.\r
+> +else\r
+> +    echo No.\r
+> +    append_emsg "Version '$news_version' in NEWS file is not '$VERSION'"\r
+> +fi\r
+> +\r
+> +#eval `date '+year=3D%Y mon=3D%m day=3D%d'`\r
+> +today0utc=3D`date --date=3D0Z +%s` # gnu date feature\r
+> +\r
+> +echo -n "Checking that NEWS date is right... "\r
+> +case $news_date in\r
+> + '('[2-9][0-9][0-9][0-9]-[01][0-9]-[0123][0-9]')')\r
+> +    newsdate0utc=3D`nd=3D${news_date#\\(}; date --date=3D"${nd%)} 0Z" +%s`\r
+> +    ddiff=3D$((newsdate0utc - today0utc))\r
+> +    if [ $ddiff -lt -86400 ] # since beginning of yesterday...\r
+> +    then\r
+> +            echo No.\r
+> +            append_emsg "Date $news_date in NEWS file is too much in the past"\r
+> +    elif [ $ddiff -gt 172800 ] # up to end of tomorrow...\r
+> +    then\r
+> +            echo No.\r
+> +            append_emsg "Date $news_date in NEWS file is too much in the future"\r
+> +    else\r
+> +            echo Yes.\r
+> +    fi ;;\r
+> + *)\r
+> +    echo No.\r
+> +    append_emsg "Date '$news_date' in NEWS file is not in format (yyyy-mm-d=\r
+d)"\r
+> +esac\r
+> +\r
+> +readonly DATE=3D${news_date//[()]/} # bash feature\r
+> +manthdata ()\r
+> +{\r
+> +    set x $*\r
+\r
+Uh?  Did you mean =E2=80=9Cset -- $*=E2=80=9D?\r
+\r
+> +    if [ $# !=3D 7 ]\r
+> +    then\r
+> +            append_emsg "'$mp' has too many '.TH' lines"\r
+> +            man_mismatch=3D1\r
+> +    fi\r
+> +    man_date=3D${5-} man_version=3D${7-}\r
+> +}\r
+> +\r
+> +echo -n "Checking that manual page dates and versions are $DATE and $VER=\r
+SION... "\r
+> +manfiles=3D`find man -type f | sort`\r
+> +man_pages_ok=3DYes\r
+> +for mp in $manfiles\r
+> +do\r
+> +    case $mp in *.[0-9]) ;; # fall below this 'case ... esac'\r
+\r
+Perhaps new line after =E2=80=9Cin=E2=80=9D?\r
+\r
+> +            */Makefile.local | */Makefile ) continue ;;\r
+> +            */.gitignore)   continue ;;\r
+> +            *.bak)          continue ;;\r
+> +\r
+> +            *)      append_emsg "'$mp': extra file"\r
+> +                    man_pages_ok=3DNo\r
+> +                    continue\r
+> +    esac\r
+> +    manthdata `sed -n '/^[.]TH NOTMUCH/ { y/"/ /; p; }' "$mp"`\r
+\r
+Alternatively =E2=80=9C\.=E2=80=9D instead of =E2=80=9C[.]=E2=80=9D.\r
+\r
+> +    if [ "$man_version" !=3D "$VERSION" ]\r
+> +    then    append_emsg "Version '$man_version' is not '$VERSION' in $mp"\r
+> +            mman_pages_ok=3DNo\r
+> +    fi\r
+> +    if [ "$man_date" !=3D "$DATE" ]\r
+> +    then    append_emsg "DATE '$man_date' is not '$DATE' in $mp"\r
+> +            man_pages_ok=3DNo\r
+> +    fi\r
+> +done\r
+> +echo $man_pages_ok.\r
+> +\r
+> +if [ -n "$emsgs" ]\r
+> +then\r
+> +    echo\r
+> +    echo 'Release check failed; check these issues:'\r
+> +    echo -e "$emsgs"\r
+> +    exit 1\r
+> +fi\r
+> +\r
+> +echo 'All checks this script executed completed successfully.'\r
+> +echo 'Make sure that everything else mentioned in RELEASING'\r
+> +echo 'file is in order, too.'\r
+> +\r
+> +exit 0\r
+\r
+Unnecessary.\r
+\r
+> +\r
+> +# Local variables:\r
+> +# mode: shell-script\r
+> +# sh-basic-offset: 8\r
+> +# tab-width: 8\r
+> +# End:\r
+> +# vi: set sw=3D8 ts=3D8\r
+\r
+--=20\r
+Best regards,                                         _     _\r
+.o. | Liege of Serenely Enlightened Majesty of      o' \,=3D./ `o\r
+..o | Computer Science,  Micha=C5=82 =E2=80=9Cmina86=E2=80=9D Nazarewicz   =\r
+ (o o)\r
+ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--\r
+--=-=-=\r
+Content-Type: multipart/signed; boundary="==-=-=";\r
+       micalg=pgp-sha1; protocol="application/pgp-signature"\r
+\r
+--==-=-=\r
+Content-Type: text/plain\r
+\r
+\r
+--==-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.10 (GNU/Linux)\r
+\r
+iQIcBAEBAgAGBQJQRJydAAoJECBgQBJQdR/0nucP/R6zc1d5OupCMuJSpCoO7Ivh\r
+4dK7QsW5D52tm9gBP7ZCVZUVI1r8hUKpolH8sQ4HW+D3bedmMdb49ys5BwoKLALh\r
+jh7T7Okuz4kOkoRTgN/9XOo+uYUO7b0NkmXTlhUS0B2qPAPmcMR7W9qPx7raBP50\r
+cZTQi2pDiYNHXdWUH7DV8DbqaphZkElQU2DJdVcjGginCey9z4weJN3wY9MWDhtk\r
+RYHr3xzkxHIdpMdpzj6+m4UGU4e70TmeqZMDOQn+5fC8TqwZpKSGqaEX3i3Mq9e1\r
+LcypWwQyTqTK4wOzR4I5qYcLTW6joNVpTH7eqTeZ9kyNrBuZYTszQgRBAt8No325\r
+s189aUlGsBKy0tyxAL/UEpvCO8lTnk0+7iJHavdRaKzMGFT6y5i6WQDuruUDGmeh\r
+TL/zNYrdmNTQDCjvi2FbaPsX6BhPKANnHElb0iyCU4GSfNwJ/LQm0e6Z4OfOSUg8\r
+hW6kL1QsSoqIsKThjkBqeA++2uf+GBKjAh1uzvJlWxmn+kz8pD/1WoHnH1w/RccJ\r
+z3QJ2Wuky5NxmSAL4+op6rXry9IcorGvELRs/LUhaMHT3FwpyH6G0JlT82L+FsqB\r
+P7/h+Vmc59OWfCXCzlepeLjqDQLQwRGzmo9XCBWEm0q6K3QbVVuxN/LyPgZ1Elzz\r
+6UtZ6WBOKNqeDcRMtXhF\r
+=iuqg\r
+-----END PGP SIGNATURE-----\r
+--==-=-=--\r
+\r
+--=-=-=--\r