* [PATCH 2/3] lib: Replace NOTMUCH_*_VERSION with LIBNOTMUCH_*_VERSION
2013-12-04 16:19 [PATCH 1/3] lib: Make VERSION macros agree with soname version Austin Clements
@ 2013-12-04 16:19 ` Austin Clements
2013-12-04 16:19 ` [PATCH 3/3] lib: Bump library version from 3.0.0 to 3.1.0 Austin Clements
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Austin Clements @ 2013-12-04 16:19 UTC (permalink / raw)
To: notmuch
This makes it clear that these macros refer to the *library* version,
and not to the notmuch application-level release. Since there are no
consumers of these macros yet, this is now or never.
---
lib/notmuch.h | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/lib/notmuch.h b/lib/notmuch.h
index 42188a8..cb108ef 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -45,9 +45,9 @@ NOTMUCH_BEGIN_DECLS
* The library version number. This must agree with the soname
* version in Makefile.local.
*/
-#define NOTMUCH_MAJOR_VERSION 3
-#define NOTMUCH_MINOR_VERSION 0
-#define NOTMUCH_MICRO_VERSION 0
+#define LIBNOTMUCH_MAJOR_VERSION 3
+#define LIBNOTMUCH_MINOR_VERSION 0
+#define LIBNOTMUCH_MICRO_VERSION 0
/*
* Check the version of the notmuch library being compiled against.
@@ -55,19 +55,19 @@ NOTMUCH_BEGIN_DECLS
* Return true if the library being compiled against is of the
* specified version or above. For example:
*
- * #if NOTMUCH_CHECK_VERSION(0, 18, 0)
- * (code requiring notmuch 0.18 or above)
+ * #if LIBNOTMUCH_CHECK_VERSION(3, 0, 0)
+ * (code requiring libnotmuch 3.0.0 or above)
* #endif
*
- * NOTMUCH_CHECK_VERSION has been defined since version 0.17.0; you
+ * LIBNOTMUCH_CHECK_VERSION has been defined since version 3.0.0; you
* can use #if !defined(NOTMUCH_CHECK_VERSION) to check for versions
* prior to that.
*/
-#define NOTMUCH_CHECK_VERSION (major, minor, micro) \
- (NOTMUCH_MAJOR_VERSION > (major) || \
- (NOTMUCH_MAJOR_VERSION == (major) && NOTMUCH_MINOR_VERSION > (minor)) || \
- (NOTMUCH_MAJOR_VERSION == (major) && NOTMUCH_MINOR_VERSION == (minor) && \
- NOTMUCH_MICRO_VERSION >= (micro)))
+#define LIBNOTMUCH_CHECK_VERSION (major, minor, micro) \
+ (LIBNOTMUCH_MAJOR_VERSION > (major) || \
+ (LIBNOTMUCH_MAJOR_VERSION == (major) && LIBNOTMUCH_MINOR_VERSION > (minor)) || \
+ (LIBNOTMUCH_MAJOR_VERSION == (major) && LIBNOTMUCH_MINOR_VERSION == (minor) && \
+ LIBNOTMUCH_MICRO_VERSION >= (micro)))
typedef int notmuch_bool_t;
--
1.8.4.rc3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/3] lib: Bump library version from 3.0.0 to 3.1.0
2013-12-04 16:19 [PATCH 1/3] lib: Make VERSION macros agree with soname version Austin Clements
2013-12-04 16:19 ` [PATCH 2/3] lib: Replace NOTMUCH_*_VERSION with LIBNOTMUCH_*_VERSION Austin Clements
@ 2013-12-04 16:19 ` Austin Clements
2013-12-04 17:38 ` [PATCH 1/1] devel/release-checks.sh: adjust to LIBNOTMUCH version checks Tomi Ollila
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Austin Clements @ 2013-12-04 16:19 UTC (permalink / raw)
To: notmuch
This version of the library introduces LIBNOTMUCH_CHECK_VERSION and
the *_VERSION macros. Bumping the version number is also necessary to
make the comment on LIBNOTMUCH_CHECK_VERSION no longer a lie.
---
lib/Makefile.local | 2 +-
lib/notmuch.h | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/Makefile.local b/lib/Makefile.local
index cd2c60d..c56cba9 100644
--- a/lib/Makefile.local
+++ b/lib/Makefile.local
@@ -11,7 +11,7 @@ LIBNOTMUCH_VERSION_MAJOR = 3
# the time of release for any additions to the library interface,
# (and when it is incremented, the release version of the library should
# be reset to 0).
-LIBNOTMUCH_VERSION_MINOR = 0
+LIBNOTMUCH_VERSION_MINOR = 1
# The release version the library interface. This should be incremented at
# the time of release if there have been no changes to the interface, (but
diff --git a/lib/notmuch.h b/lib/notmuch.h
index cb108ef..d30768d 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -46,7 +46,7 @@ NOTMUCH_BEGIN_DECLS
* version in Makefile.local.
*/
#define LIBNOTMUCH_MAJOR_VERSION 3
-#define LIBNOTMUCH_MINOR_VERSION 0
+#define LIBNOTMUCH_MINOR_VERSION 1
#define LIBNOTMUCH_MICRO_VERSION 0
/*
@@ -55,11 +55,11 @@ NOTMUCH_BEGIN_DECLS
* Return true if the library being compiled against is of the
* specified version or above. For example:
*
- * #if LIBNOTMUCH_CHECK_VERSION(3, 0, 0)
- * (code requiring libnotmuch 3.0.0 or above)
+ * #if LIBNOTMUCH_CHECK_VERSION(3, 1, 0)
+ * (code requiring libnotmuch 3.1.0 or above)
* #endif
*
- * LIBNOTMUCH_CHECK_VERSION has been defined since version 3.0.0; you
+ * LIBNOTMUCH_CHECK_VERSION has been defined since version 3.1.0; you
* can use #if !defined(NOTMUCH_CHECK_VERSION) to check for versions
* prior to that.
*/
--
1.8.4.rc3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 1/1] devel/release-checks.sh: adjust to LIBNOTMUCH version checks
2013-12-04 16:19 [PATCH 1/3] lib: Make VERSION macros agree with soname version Austin Clements
2013-12-04 16:19 ` [PATCH 2/3] lib: Replace NOTMUCH_*_VERSION with LIBNOTMUCH_*_VERSION Austin Clements
2013-12-04 16:19 ` [PATCH 3/3] lib: Bump library version from 3.0.0 to 3.1.0 Austin Clements
@ 2013-12-04 17:38 ` Tomi Ollila
2013-12-04 18:39 ` Jani Nikula
2013-12-04 18:36 ` [PATCH 1/3] lib: Make VERSION macros agree with soname version Jani Nikula
` (2 subsequent siblings)
5 siblings, 1 reply; 8+ messages in thread
From: Tomi Ollila @ 2013-12-04 17:38 UTC (permalink / raw)
To: notmuch; +Cc: tomi.ollila
NOTMUCH_VERSION_* macros in lib/notmuch.h are replaced with
LIBNOTMUCH_VERSION_* macros. Check that the values of those
match the LIBNOTMUCH_*_VERSION values in lib/Makefile.local.
---
devel/release-checks.sh | 41 ++++++++++++++++++++---------------------
1 file changed, 20 insertions(+), 21 deletions(-)
diff --git a/devel/release-checks.sh b/devel/release-checks.sh
index d6410ad..7be57df 100755
--- a/devel/release-checks.sh
+++ b/devel/release-checks.sh
@@ -77,37 +77,36 @@ case $VERSION in
*) verfail "'$VERSION' is a single number" ;;
esac
-_set_version_components ()
-{
- VERSION_MAJOR=$1
- VERSION_MINOR=$2
- VERSION_MICRO=${3:-0} # set to 0 in case $3 is unset or "null" (string)
-}
+echo -n "Checking that LIBNOTMUCH version macros & variables match ... "
+# lib/notmuch.h
+LIBNOTMUCH_MAJOR_VERSION=broken
+LIBNOTMUCH_MINOR_VERSION=broken
+LIBNOTMUCH_MICRO_VERSION=broken
+# lib/Makefile.local
+LIBNOTMUCH_VERSION_MAJOR=broken
+LIBNOTMUCH_VERSION_MINOR=broken
+LIBNOTMUCH_VERSION_RELEASE=broken
+
+eval `awk 'NF == 3 && $1 == "#define" && $2 ~ /^LIBNOTMUCH_[A-Z]+_VERSION$/ \
+ && $3 ~ /^[0-9]+$/ { print $2 "=" $3 }' lib/notmuch.h`
-IFS=.
-_set_version_components $VERSION
-IFS=$DEFAULT_IFS
+eval `awk 'NF == 3 && $1 ~ /^LIBNOTMUCH_VERSION_[A-Z]+$/ && $2 == "=" \
+ && $3 ~ /^[0-9]+$/ { print $1 "=" $3 }' lib/Makefile.local`
-echo -n "Checking that libnotmuch version macros match $VERSION... "
-NOTMUCH_MAJOR_VERSION=broken
-NOTMUCH_MINOR_VERSION=broken
-NOTMUCH_MICRO_VERSION=broken
-eval `awk 'NF == 3 && $1 == "#define" && $2 ~ /^NOTMUCH_[A-Z]+_VERSION$/ \
- && $3 ~ /^[0-9]+$/ { print $2 "=" $3 }' lib/notmuch.h`
check_version_component ()
{
- eval local v1=\$VERSION_$1
- eval local v2=\$NOTMUCH_$1_VERSION
+ eval local v1=\$LIBNOTMUCH_$1_VERSION
+ eval local v2=\$LIBNOTMUCH_VERSION_$2
if [ $v1 != $v2 ]
- then append_emsg "NOTMUCH_$1_VERSION is defined as '$v2' in lib/notmuch.h instead of '$v1'"
+ then append_emsg "LIBNOTMUCH_$1_VERSION ($v1) does not equal LIBNOTMUCH_VERSION_$2 ($v2)"
fi
}
old_emsg_count=$emsg_count
-check_version_component MAJOR
-check_version_component MINOR
-check_version_component MICRO
+check_version_component MAJOR MAJOR
+check_version_component MINOR MINOR
+check_version_component MICRO RELEASE
[ $old_emsg_count = $emsg_count ] && echo Yes. || echo No.
echo -n "Checking that this is Debian package for notmuch... "
--
1.8.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/1] devel/release-checks.sh: adjust to LIBNOTMUCH version checks
2013-12-04 17:38 ` [PATCH 1/1] devel/release-checks.sh: adjust to LIBNOTMUCH version checks Tomi Ollila
@ 2013-12-04 18:39 ` Jani Nikula
0 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2013-12-04 18:39 UTC (permalink / raw)
To: Tomi Ollila, notmuch; +Cc: tomi.ollila
On Wed, 04 Dec 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> NOTMUCH_VERSION_* macros in lib/notmuch.h are replaced with
> LIBNOTMUCH_VERSION_* macros. Check that the values of those
> match the LIBNOTMUCH_*_VERSION values in lib/Makefile.local.
> ---
> devel/release-checks.sh | 41 ++++++++++++++++++++---------------------
> 1 file changed, 20 insertions(+), 21 deletions(-)
>
> diff --git a/devel/release-checks.sh b/devel/release-checks.sh
> index d6410ad..7be57df 100755
> --- a/devel/release-checks.sh
> +++ b/devel/release-checks.sh
> @@ -77,37 +77,36 @@ case $VERSION in
> *) verfail "'$VERSION' is a single number" ;;
> esac
>
> -_set_version_components ()
> -{
> - VERSION_MAJOR=$1
> - VERSION_MINOR=$2
> - VERSION_MICRO=${3:-0} # set to 0 in case $3 is unset or "null" (string)
> -}
> +echo -n "Checking that LIBNOTMUCH version macros & variables match ... "
> +# lib/notmuch.h
> +LIBNOTMUCH_MAJOR_VERSION=broken
> +LIBNOTMUCH_MINOR_VERSION=broken
> +LIBNOTMUCH_MICRO_VERSION=broken
> +# lib/Makefile.local
> +LIBNOTMUCH_VERSION_MAJOR=broken
> +LIBNOTMUCH_VERSION_MINOR=broken
> +LIBNOTMUCH_VERSION_RELEASE=broken
Does the test pass if both values are "broken"? Should the other set be
borken? Am I being too pessimistic? :)
At a glance, the patch looks good, but admittedly didn't spend too much
time on it.
BR,
Jani.
> +
> +eval `awk 'NF == 3 && $1 == "#define" && $2 ~ /^LIBNOTMUCH_[A-Z]+_VERSION$/ \
> + && $3 ~ /^[0-9]+$/ { print $2 "=" $3 }' lib/notmuch.h`
>
> -IFS=.
> -_set_version_components $VERSION
> -IFS=$DEFAULT_IFS
> +eval `awk 'NF == 3 && $1 ~ /^LIBNOTMUCH_VERSION_[A-Z]+$/ && $2 == "=" \
> + && $3 ~ /^[0-9]+$/ { print $1 "=" $3 }' lib/Makefile.local`
>
> -echo -n "Checking that libnotmuch version macros match $VERSION... "
> -NOTMUCH_MAJOR_VERSION=broken
> -NOTMUCH_MINOR_VERSION=broken
> -NOTMUCH_MICRO_VERSION=broken
> -eval `awk 'NF == 3 && $1 == "#define" && $2 ~ /^NOTMUCH_[A-Z]+_VERSION$/ \
> - && $3 ~ /^[0-9]+$/ { print $2 "=" $3 }' lib/notmuch.h`
>
> check_version_component ()
> {
> - eval local v1=\$VERSION_$1
> - eval local v2=\$NOTMUCH_$1_VERSION
> + eval local v1=\$LIBNOTMUCH_$1_VERSION
> + eval local v2=\$LIBNOTMUCH_VERSION_$2
> if [ $v1 != $v2 ]
> - then append_emsg "NOTMUCH_$1_VERSION is defined as '$v2' in lib/notmuch.h instead of '$v1'"
> + then append_emsg "LIBNOTMUCH_$1_VERSION ($v1) does not equal LIBNOTMUCH_VERSION_$2 ($v2)"
> fi
> }
>
> old_emsg_count=$emsg_count
> -check_version_component MAJOR
> -check_version_component MINOR
> -check_version_component MICRO
> +check_version_component MAJOR MAJOR
> +check_version_component MINOR MINOR
> +check_version_component MICRO RELEASE
> [ $old_emsg_count = $emsg_count ] && echo Yes. || echo No.
>
> echo -n "Checking that this is Debian package for notmuch... "
> --
> 1.8.0
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] lib: Make VERSION macros agree with soname version
2013-12-04 16:19 [PATCH 1/3] lib: Make VERSION macros agree with soname version Austin Clements
` (2 preceding siblings ...)
2013-12-04 17:38 ` [PATCH 1/1] devel/release-checks.sh: adjust to LIBNOTMUCH version checks Tomi Ollila
@ 2013-12-04 18:36 ` Jani Nikula
2013-12-05 14:48 ` David Bremner
2013-12-07 2:35 ` David Bremner
5 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2013-12-04 18:36 UTC (permalink / raw)
To: Austin Clements, notmuch
On Wed, 04 Dec 2013, Austin Clements <amdragon@MIT.EDU> wrote:
> We have two distinct "library version" numbers: the soname version and
> the version macros. We need both for different reasons: the version
> macros enable easy compile-time version detection (and conditional
> compilation), while the soname version enables runtime version
> detection (which includes the version checking done by things like the
> Python bindings).
>
> However, currently, these two version numbers are different, which is
> unnecessary and can lead to confusion (especially in things like
> Debian, which include the soname version in the package name). This
> patch makes them the same by bumping the version macros up to agree
> with the soname version.
The patches look good to me. Thanks for spotting and fixing this in the
nick of time before releasing.
BR,
Jani.
>
> (We should probably keep the version number in just one place so they
> can't get out of sync, but that can be done in another patch.)
> ---
> lib/Makefile.local | 3 +++
> lib/notmuch.h | 8 ++++++--
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/lib/Makefile.local b/lib/Makefile.local
> index 155ac02..cd2c60d 100644
> --- a/lib/Makefile.local
> +++ b/lib/Makefile.local
> @@ -18,6 +18,9 @@ LIBNOTMUCH_VERSION_MINOR = 0
> # simply compatible changes to the implementation).
> LIBNOTMUCH_VERSION_RELEASE = 0
>
> +# Note: Don't forget to change the VERSION macros in notmuch.h when
> +# any of the above change.
> +
> ifeq ($(PLATFORM),MACOSX)
> LIBRARY_SUFFIX = dylib
> # On OS X, library version numbers go before suffix.
> diff --git a/lib/notmuch.h b/lib/notmuch.h
> index 7c3a30c..42188a8 100644
> --- a/lib/notmuch.h
> +++ b/lib/notmuch.h
> @@ -41,8 +41,12 @@ NOTMUCH_BEGIN_DECLS
> #define TRUE 1
> #endif
>
> -#define NOTMUCH_MAJOR_VERSION 0
> -#define NOTMUCH_MINOR_VERSION 17
> +/*
> + * The library version number. This must agree with the soname
> + * version in Makefile.local.
> + */
> +#define NOTMUCH_MAJOR_VERSION 3
> +#define NOTMUCH_MINOR_VERSION 0
> #define NOTMUCH_MICRO_VERSION 0
>
> /*
> --
> 1.8.4.rc3
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] lib: Make VERSION macros agree with soname version
2013-12-04 16:19 [PATCH 1/3] lib: Make VERSION macros agree with soname version Austin Clements
` (3 preceding siblings ...)
2013-12-04 18:36 ` [PATCH 1/3] lib: Make VERSION macros agree with soname version Jani Nikula
@ 2013-12-05 14:48 ` David Bremner
2013-12-07 2:35 ` David Bremner
5 siblings, 0 replies; 8+ messages in thread
From: David Bremner @ 2013-12-05 14:48 UTC (permalink / raw)
To: Austin Clements, notmuch
Austin Clements <amdragon@MIT.EDU> writes:
> However, currently, these two version numbers are different, which is
> unnecessary and can lead to confusion (especially in things like
> Debian, which include the soname version in the package name). This
> patch makes them the same by bumping the version macros up to agree
> with the soname version.
The series looks OK to me.
d
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] lib: Make VERSION macros agree with soname version
2013-12-04 16:19 [PATCH 1/3] lib: Make VERSION macros agree with soname version Austin Clements
` (4 preceding siblings ...)
2013-12-05 14:48 ` David Bremner
@ 2013-12-07 2:35 ` David Bremner
5 siblings, 0 replies; 8+ messages in thread
From: David Bremner @ 2013-12-07 2:35 UTC (permalink / raw)
To: Austin Clements, notmuch
Austin Clements <amdragon@MIT.EDU> writes:
>
> However, currently, these two version numbers are different, which is
> unnecessary and can lead to confusion (especially in things like
> Debian, which include the soname version in the package name). This
> patch makes them the same by bumping the version macros up to agree
> with the soname version.
>
pushed to master and release
d
^ permalink raw reply [flat|nested] 8+ messages in thread