Re: [PATCH] Include extra information in mutt version string for developer builds
* David Champion on Wednesday, September 15, 2010 at 23:46:04 -0500 > # HG changeset patch > # User David Champion > # Date 1284612294 18000 > # Branch HEAD > # Node ID 1c6c5a4e168219a6e26ba6143cabe9f7564dfcac > # Parent 59aad6c21703484a9a298536efd4d971039d0a61 > Include extra information in mutt version string for developer builds. Good idea. > When a build is based on an hg clone, include extra information about > the changeset node, distance from a tagged release, and mq applied patch > count. > > For example, after this patch is applied my mutt build identifies itself > (in mutt -v and in ) as: > > Mutt 1.5.21+26,mq+22 (7edc2073390d) (2010-09-15) > > I have applied 26 changesets applied since 1.5.21 was tagged, 22 of > which are in my mq patch series. A 1.5.21 release build that is not > mercurial-based would still appear simply as "1.5.21". > > diff -r 59aad6c21703 -r 1c6c5a4e1682 configure.ac > --- a/configure.acWed Sep 15 11:47:39 2010 -0700 > +++ b/configure.acWed Sep 15 23:44:54 2010 -0500 > @@ -7,7 +7,7 @@ > AC_INIT([mutt.h]) > AM_CONFIG_HEADER([config.h]) > > -mutt_cv_version=`cat $srcdir/VERSION` > +mutt_cv_version=`./version` > AM_INIT_AUTOMAKE(mutt, $mutt_cv_version) > AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/VERSION']) > > diff -r 59aad6c21703 -r 1c6c5a4e1682 version > --- /dev/null Thu Jan 01 00:00:00 1970 + > +++ b/version Wed Sep 15 23:44:54 2010 -0500 > @@ -0,0 +1,36 @@ > +#!/bin/sh > + > +[ -d .hg ] || { cat VERSION; exit 0; } > +hg >/dev/null 2>&1 || { cat VERSION; exit 0; } > + > +# This is a mercurial repo and we have the hg command > + > +cur=$(hg id -n -r .) > +qparent=$(hg log -r qparent --template='{rev}\n' 2>/dev/null || echo $cur) > +qdelta=$(expr $cur - $qparent) > + > +# The while loop is wonky but some shells (bash) have trouble with piping > +# into "read", as with "echo 1 2 | read one two". > +hg parents --template='{latesttag} {latesttagdistance} {node|short}\n' | > while read tag dist node; do You are aware that the latesttag and latesttagdistance keywords are only available since Mercurial 1.4? > + # first translate release tags into ##.##.## notation > + case "$tag" in > + mutt-*-rel) tag=`echo $tag | sed -e 's/mutt-//' -e > 's/-rel//' | tr - .`;; > + esac > + > + # if we have nonzero distance from the latest tag, include that info > + if [ $dist -eq 0 ]; then > + dist="" > + else > + dist="+$dist" > + fi > + > + # if we have mq patches applied, mention it > + if [ $qdelta -eq 0 ]; then > + qdist="" > + else > + qdist=",mq+$qdelta" > + fi > + > + echo "$tag$dist$qdist ($node)" > + exit 0 > +done c -- theatre - books - texts - movies Black Trash Productions at home: http://www.blacktrash.org Black Trash Productions on Facebook: http://www.facebook.com/blacktrashproductions
Re: [ANNOUNCE] 1.5.21 released
On Wed, Sep 15, 2010 at 10:31:22 -0700, Brendan Cully wrote: > After much too long, I'm happy to announce the release of mutt 1.5.21, Hurray! Thanks! 1.) freshmeat.net please. 2.) an update of the NNTP patches please :-) Moritz
Re: [PATCH] Include extra information in mutt version string for developer builds
Creative nit-pick mood. :-) > +[ -d .hg ] || { cat VERSION; exit 0; } > +hg >/dev/null 2>&1 || { cat VERSION; exit 0; } { [ -d .hg ] && hg >/dev/null 2>&1 } || { cat VERSION; exit 0; } BTW, I think it's cool, if and when it works. Moritz
Re: [ANNOUNCE] 1.5.21 released
On 16-09-2010 17:18:01 +0200, Moritz Barsnick wrote: > On Wed, Sep 15, 2010 at 10:31:22 -0700, Brendan Cully wrote: > > After much too long, I'm happy to announce the release of mutt 1.5.21, > > Hurray! Thanks! > > 1.) freshmeat.net please. > 2.) an update of the NNTP patches please :-) sidebar patch needs love too. Compressed folders patch applies with small fixes, but I haven't tested it. -- Fabian Groffen Gentoo on a different level
Re: [ANNOUNCE] 1.5.21 released
Hello, On Thu, Sep 16, 2010 at 05:18:01PM +0200, Moritz Barsnick wrote: MB> 2.) an update of the NNTP patches please :-) Done. MB> Moritz -- Vsevolod Volkov (VVV-UANIC) mailto:v...@mutt.org.ua http://mutt.org.ua/download
Re: [PATCH] Include extra information in mutt version string for developer builds
* On 16 Sep 2010, Christian Ebert wrote: > > +hg parents --template='{latesttag} {latesttagdistance} {node|short}\n' | > > while read tag dist node; do > > You are aware that the latesttag and latesttagdistance keywords > are only available since Mercurial 1.4? Thanks, I had forgotten it was so new. New version upcoming with a workaround for older Mercurial. -- David Champion * d...@uchicago.edu * IT Services * University of Chicago
[PATCH] Include extra information in mutt version string for developer builds
Take 2. Includes Moritz Barsnick's changes and simulates {latesttag} when running in a Mercurial release that does not have it, per Christian Ebert. # HG changeset patch # User David Champion # Date 1284678222 18000 # Branch HEAD # Node ID c16ee46e288f86a297e014d65d277b9d6a0d22c0 # Parent 59aad6c21703484a9a298536efd4d971039d0a61 Include extra information in mutt version string for developer builds. When a build is based on an hg clone, include extra information about the changeset node, distance from a tagged release, and mq applied patch count. For example, after this patch is applied my mutt build identifies itself (in mutt -v and in ) as: Mutt 1.5.21+26,mq+22 (7edc2073390d) (2010-09-15) I have applied 26 changesets applied since 1.5.21 was tagged, 22 of which are in my mq patch series. A 1.5.21 release build that is not mercurial-based would still appear simply as "1.5.21". diff -r 59aad6c21703 -r c16ee46e288f configure.ac --- a/configure.ac Wed Sep 15 11:47:39 2010 -0700 +++ b/configure.ac Thu Sep 16 18:03:42 2010 -0500 @@ -7,7 +7,7 @@ AC_INIT([mutt.h]) AM_CONFIG_HEADER([config.h]) -mutt_cv_version=`cat $srcdir/VERSION` +mutt_cv_version=`./version` AM_INIT_AUTOMAKE(mutt, $mutt_cv_version) AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/VERSION']) diff -r 59aad6c21703 -r c16ee46e288f version --- /dev/null Thu Jan 01 00:00:00 1970 + +++ b/version Thu Sep 16 18:03:42 2010 -0500 @@ -0,0 +1,60 @@ +#!/bin/sh + +# Ensure that we have a repo here and that mercurial is installed. If +# not, just cat the VERSION file; it contains the latest release number. +{ [ -d .hg ] && hg >/dev/null 2>&1; } || { cat VERSION; exit 0; } + +# This is a mercurial repo and we have the hg command. + +# Get essential properties of the current working copy +set -- $(hg parents --template='{rev} {node|short}\n') +rev="$1" +node="$2" + +# translate release tags into ##.##.## notation +cleantag () { + case "$1" in + mutt-*-rel) echo "$1" | sed -e 's/mutt-//' -e 's/-rel//' | tr - . ;; + *) echo "$1" ;; + esac +} + +getdistance_old () { + # fudge it + tmp=$(hg tags | sort -n +1 | egrep 'mutt-.*rel' | tail -1 | cut -d: -f1) + latesttag=$(echo $tmp | awk '{print $1}') + latestrev=$(echo $tmp | awk '{print $2}') + distance=$(($rev - $latestrev)) + echo $latesttag $distance +} + +getdistance_new () { + hg parents --template='{latesttag} {latesttagdistance}\n' +} + + +# latesttag appeared in hg 1.4. Test for it. +[ "$(hg log -r . --template='{latesttag}')" = '' ] && +set -- $(getdistance_old) || +set -- $(getdistance_new) + +tag=$(cleantag "$1") +dist=$2 + +if [ $dist -eq 0 ]; then + dist= +else + dist="+$dist" +fi + +# if we have mq patches applied, mention it +qparent=$(hg log -r qparent --template='{rev}\n' 2>/dev/null || echo $rev) +qdelta=$(expr $rev - $qparent) +if [ $qdelta -eq 0 ]; then + qdist="" +else + qdist=",mq+$qdelta" +fi + +echo "$tag$dist$qdist ($node)" +exit 0
Re: [PATCH] Include extra information in mutt version string for developer builds
* David Champion on Thursday, September 16, 2010 at 18:11:44 -0500 > Take 2. Includes Moritz Barsnick's changes and simulates {latesttag} > when running in a Mercurial release that does not have it, per Christian > Ebert. > > > # HG changeset patch > # User David Champion > # Date 1284678222 18000 > # Branch HEAD > # Node ID c16ee46e288f86a297e014d65d277b9d6a0d22c0 > # Parent 59aad6c21703484a9a298536efd4d971039d0a61 > Include extra information in mutt version string for developer builds. > > When a build is based on an hg clone, include extra information about > the changeset node, distance from a tagged release, and mq applied patch > count. > > For example, after this patch is applied my mutt build identifies itself > (in mutt -v and in ) as: > > Mutt 1.5.21+26,mq+22 (7edc2073390d) (2010-09-15) > > I have applied 26 changesets applied since 1.5.21 was tagged, 22 of > which are in my mq patch series. A 1.5.21 release build that is not > mercurial-based would still appear simply as "1.5.21". > > diff -r 59aad6c21703 -r c16ee46e288f configure.ac > --- a/configure.acWed Sep 15 11:47:39 2010 -0700 > +++ b/configure.acThu Sep 16 18:03:42 2010 -0500 > @@ -7,7 +7,7 @@ > AC_INIT([mutt.h]) > AM_CONFIG_HEADER([config.h]) > > -mutt_cv_version=`cat $srcdir/VERSION` > +mutt_cv_version=`./version` > AM_INIT_AUTOMAKE(mutt, $mutt_cv_version) > AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/VERSION']) > > diff -r 59aad6c21703 -r c16ee46e288f version > --- /dev/null Thu Jan 01 00:00:00 1970 + > +++ b/version Thu Sep 16 18:03:42 2010 -0500 This doesn't apply on case-insensitive filesystems - I'm using the default HFS+ on MacOS X, which is indeed case-insensitive. So, no precise version header in this mail yet ;-) c -- theatre - books - texts - movies Black Trash Productions at home: http://www.blacktrash.org Black Trash Productions on Facebook: http://www.facebook.com/blacktrashproductions
mail_check_recent does not work with homespool
Hi, I have the new mail_check_recent variable set to yes. It works, except for my spoolfile which is compiled in: ./configure --with-homespool=Maildir ... At least I guess it's because of this. It would be nice to have this working on my spool again. Thanks for all the work! c -- \black\trash movie _SAME TIME SAME PLACE_ --->> http://www.blacktrash.org/underdogma/stsp.php \black\trash audio _ANOTHER TIME ANOTHER PLACE_ --->> http://www.blacktrash.org/underdogma/atap.html
Re: mail_check_recent does not work with homespool
On Fri, Sep 17, 2010 at 01:46:41AM +0200, Christian Ebert wrote: I have the new mail_check_recent variable set to yes. It works, except for my spoolfile which is compiled in: ./configure --with-homespool=Maildir ... At least I guess it's because of this. It would be nice to have this working on my spool again. I presume you are using Maildir format mailboxes? Does it work with any maildir mailbox? One thing to check is "stat $Maildir/new" and see if the mtime value on the directory is updated when a new message is placed in that directory. Thanks, me
Re: Include extra information in mutt version string for developer builds
On 16Sep2010 17:21, Moritz Barsnick wrote: | Creative nit-pick mood. :-) | | > +[ -d .hg ] || { cat VERSION; exit 0; } | > +hg >/dev/null 2>&1 || { cat VERSION; exit 0; } | | { [ -d .hg ] && hg >/dev/null 2>&1 } || { cat VERSION; exit 0; } semicolon needed: --^ I suspect precedence would let you skip the {} around the &&, too, but I've never liked relying on it. I _would_ change the: cat VERSION; exit 0 into: exec cat VERSION That has two advantages: - tiny performance optimisation - much more important, if VERSION is missing (== cat fails) the script should _not_ exit 0 !! Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ "Vy can't ve chust climb?" - John Salathe
Re: [PATCH] Include extra information in mutt version string for developer builds
* On 16 Sep 2010, Christian Ebert wrote: > > This doesn't apply on case-insensitive filesystems - I'm using > the default HFS+ on MacOS X, which is indeed case-insensitive. > > So, no precise version header in this mail yet ;-) Good point... wretched filesystem. I use a Mac too (but Solaris for mutt) so I should have caught this. I also addressed Cameron's observations on "exec cat" and improved performance around the double awk I was using. Although I think performance optimizations for a one-time compilation tool are sort of not worth a lot of time, why depend on awk when the shell can handle it just fine? # HG changeset patch # User David Champion # Date 1284693682 18000 # Branch HEAD # Node ID fd7c217aeaee54ac69ab6de29954ade243431008 # Parent 59aad6c21703484a9a298536efd4d971039d0a61 Include extra information in mutt version string for developer builds. When a build is based on an hg clone, include extra information about the changeset node, distance from a tagged release, and mq applied patch count. For example, after this patch is applied my mutt build identifies itself (in mutt -v and in ) as: Mutt 1.5.21+26,mq+22 (7edc2073390d) (2010-09-15) I have applied 26 changesets applied since 1.5.21 was tagged, 22 of which are in my mq patch series. A 1.5.21 release build that is not mercurial-based would still appear simply as "1.5.21". diff -r 59aad6c21703 -r fd7c217aeaee configure.ac --- a/configure.ac Wed Sep 15 11:47:39 2010 -0700 +++ b/configure.ac Thu Sep 16 22:21:22 2010 -0500 @@ -7,7 +7,7 @@ AC_INIT([mutt.h]) AM_CONFIG_HEADER([config.h]) -mutt_cv_version=`cat $srcdir/VERSION` +mutt_cv_version=`./version.sh` AM_INIT_AUTOMAKE(mutt, $mutt_cv_version) AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/VERSION']) diff -r 59aad6c21703 -r fd7c217aeaee version.sh --- /dev/null Thu Jan 01 00:00:00 1970 + +++ b/version.shThu Sep 16 22:21:22 2010 -0500 @@ -0,0 +1,60 @@ +#!/bin/sh + +# Ensure that we have a repo here and that mercurial is installed. If +# not, just cat the VERSION file; it contains the latest release number. +{ [ -d .hg ] && hg >/dev/null 2>&1; } || exec cat VERSION + +# This is a mercurial repo and we have the hg command. + +# Get essential properties of the current working copy +set -- $(hg parents --template='{rev} {node|short}\n') +rev="$1" +node="$2" + +# translate release tags into ##.##.## notation +cleantag () { + case "$1" in + mutt-*-rel) echo "$1" | sed -e 's/mutt-//' -e 's/-rel//' | tr - . ;; + *) echo "$1" ;; + esac +} + +getdistance_old () { + # fudge it + set -- $(hg tags | sort -n +1 | egrep 'mutt-.*rel' | tail -1 | cut -d: -f1) + latesttag="$1" + latestrev="$2" + distance=$(($rev - $latestrev)) + echo $latesttag $distance +} + +getdistance_new () { + hg parents --template='{latesttag} {latesttagdistance}\n' +} + + +# latesttag appeared in hg 1.4. Test for it. +[ "$(hg log -r . --template='{latesttag}')" = '' ] && +set -- $(getdistance_old) || +set -- $(getdistance_new) + +tag=$(cleantag "$1") +dist=$2 + +if [ $dist -eq 0 ]; then + dist= +else + dist="+$dist" +fi + +# if we have mq patches applied, mention it +qparent=$(hg log -r qparent --template='{rev}\n' 2>/dev/null || echo $rev) +qdelta=$(expr $rev - $qparent) +if [ $qdelta -eq 0 ]; then + qdist="" +else + qdist=",mq+$qdelta" +fi + +echo "$tag$dist$qdist ($node)" +exit 0 -- David Champion * d...@uchicago.edu * IT Services * University of Chicago