libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug#9846: [PATCH 2/3] maint: use gnulib's git-version-gen instead of


From: Gary V. Vaughan
Subject: Re: bug#9846: [PATCH 2/3] maint: use gnulib's git-version-gen instead of mkstamp.
Date: Mon, 24 Oct 2011 13:11:26 +0700

[[moving to the correct list]]

Hi All,

It turns out that this patch isn't quite complete, because we were also
using mkstamp to count the number of datelines in our ChangeLogs to get
a serial number for ltversion.m4.

The appended patch counts the number of git commits in order to get a
serial number and also creates $(distdir)/.serial during make dist so that
the correct serial number is also available when building from a distribution
tarball.

Although I've kept it separate in this thread for easier review, I'll squash
it into the [PATCH 2/3] commit in 72 hours, pending any comments that need
addressing first.

On 23 Oct 2011, at 23:12, Gary V. Vaughan wrote:
> This changeset stops pretending that we're doing cvs releases from two
> or three branches.  I also need to fix the version numbering scheme
> documentation on the libtool webpages to match.  We can't use letters
> for alpha releases without patching the scripts, so I propose applying
> this and using the following version scheme from now on:
> 
>  major.minor[.micro[.patchcount-sha1fragment]]]
> 
>  - major will for all intents and purposes always be 2
>  - minor will go up by 1 when new features are added to a release
>  - micro will go up by 1 when bugs are fixed compared to the last release
>  - .patchcount-sha1fragment comes from git describe when using an unrelaeased
>    build from the git repo
> 
> If you like we can still use odd vs even in the minor position to
> differentiate development and bugfix releases.
> 
> I'll push in 72 hours, pending review comments, and update the versioning
> webpage to match the above.
> 
> * libltdl/config/mkstamp: File removed.
> * bootstrap.conf (gnulib_modules): Add git-version-gen.
> * configure.ac (AC_INIT, package_revision): Use git-version-gen to
> calculate version number.
> (TIMESTAMP): Removed.
> * libtoolize.m4sh, libltdl/config/ltmain.m4sh, libltdl/m4/libtool.m4
> (TIMESTAMP): Ditto.
> * Makefile.am (TIMESTAMP): Ditto.
> (MKSTAMP): Renamed from this...
> (git_version_gen): ...to this. Set revision here.  An alpha is now a
> release with an odd micro relase number.
> (rebuild): Don't reset revision here.
> (build_scripts): Remove mkstamp, add git-version-gen.
> (EXTRA_DIST, BUILT_SOURCES): Add .version.
> (libltdl/config/ltmain.sh, libltdl/m4/ltversion.m4, tests/package.m4):
> Don't depend on configure.ac or ChangeLog to determine when the
> version number has reved, use .version directly.
> (.version): Flush most recent configure calculated VERSION to disk.
> (dist-hook): Flush current VERSION to disk at dist time.
> 
> Signed-off-by: Gary V. Vaughan <address@hidden>


Makefile.am (dotserial): Distributed file to cache the serial
number for when git is not available to recalculate it when
building from a release tarball.
(dist-hook): Make sure .serial is created.
(libltdl/config/ltversion.m4): Use .serial when it is present
(in a dist tarball) or calculate with git otherwise (in a git
working directory).
(EXTRA_DIST): Add .serial file.

Signed-off-by: Gary V. Vaughan <address@hidden>
---
 Makefile.am |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index dc9997e..05ae14b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -139,7 +139,11 @@ $(ltversion_m4): $(ltversion_in) $(dotversion)
        done; \
        if $$rebuild; then \
          rm -f '$@'; \
-         serial=`echo "$$revision" |$(SED) 's,^1[.],,g'`; \
+         if test -f '$(srcdir)/.serial'; then \
+           serial=`cat '$(srcdir)/.serial'`; \
+         else \
+           serial=`$(git_commit_count)`; \
+         fi; \
          echo "$(bootstrap_edit) '$(ltversion_in)' > '$@'"; \
          $(bootstrap_edit) '$(ltversion_in)' > '$@'; \
          chmod a-w '$@'; \
@@ -485,6 +489,7 @@ install-data-local: $(lt_Makefile_in)
 edit_readme_alpha      = $(aux_dir)/edit-readme-alpha
 gitlog_to_changelog    = $(aux_dir)/gitlog-to-changelog
 
+dotserial              = $(distdir)/.serial
 dotversion             = $(srcdir)/.version
 tarball_version                = $(distdir)/.tarball-version
 readme                 = $(distdir)/README
@@ -513,10 +518,14 @@ $(readme): FORCE
        test -n `expr $(VERSION) : $(re_odd_version)` && \
          $(SHELL) $(edit_readme_alpha) '$@'
 
+git_commit_count = git log --pretty=oneline |wc -l |$(SED) 's,[        ],,g'
+
 dist-hook: $(changelog) $(dotversion) $(readme)
 ## Arrange so that .tarball-version appears only in the distribution
 ## tarball, and never in a checked-out repository.
        echo '$(VERSION)' > $(tarball_version)
+## ...and similarly for .serial.
+       $(git_commit_count) > $(dotserial)
 ## Ensure aclocal has not wrongly picked up old macro definitions.
        for macro in LT_INIT AC_PROG_LIBTOOL AM_PROG_LIBTOOL; do \
          if grep "$$macro" '$(srcdir)/aclocal.m4' '$(lt_aclocal_m4)'; then \
-- 
1.7.7

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]