libtool-patches
[Top][All Lists]
Advanced

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

49-gary-guess-last-release-version.patch


From: Gary V. Vaughan
Subject: 49-gary-guess-last-release-version.patch
Date: Fri, 21 Nov 2003 17:43:31 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030925 Thunderbird/0.3

Two related things, don't force `make dist' to fail if you have modified files compared to CVS (make cvs-dist has that property already), and try to codify more of the release process by guessing the previous release number.

Okay to commit?
--
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://www.oranda.demon.co.uk
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook
Index: ChangeLog
from  Gary V. Vaughan  <address@hidden>

        * configure.ac (LASTRELEASE): Calculate it as best as we can from
        AC_PACKAGE_VERSION.
        * Makefile.am (distdir): Remove dependency on timestamps so that
        it is possible to roll a dist without contacting the cvs server.
        Use `make cvs-release' for that.
        (cvs-news): Extracted from cvs-dist.
        (cvs-dist): Depend on cvs-news.
        (CHECK_LASTRELEASE): Check LASTRELEASE has been set.
        (prev-tarball): New rule.  Use LASTRELEASE to make sure the
        previous release tarball is present.
        (cvs-diff): Use CHECK_LASTRELEASE.
        (xdelta): Ditto.
        (cvs-release): Depend on prev-tarball, timestamps, cvs-news and
        fetch. Provided you set LASTRELEASE appropriately, making a full
        cvs release is just a matter of `make cvs-release', and submitting
        the files to ftp-upload.

Index: Makefile.am
===================================================================
RCS file: /cvsroot/libtool/libtool/Makefile.am,v
retrieving revision 1.79
diff -u -p -u -r1.79 Makefile.am
--- Makefile.am 17 Nov 2003 17:20:08 -0000 1.79
+++ Makefile.am 21 Nov 2003 17:34:09 -0000
@@ -51,18 +51,6 @@ libtoolize: $(srcdir)/libtoolize.in $(to
        CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_COMMANDS= $(SHELL) 
$(config_status)
        chmod +x $@
 
-# TSDEPS will be defined to TSDEPS_DIST at `make dist' time
-TSDEPS =
-TSDEPS_DIST = ChangeLog m4/libtool.m4
-CVS = cvs # set it to `:' to avoid CVS operations
-
-.PHONY: timestamps update-timestamps
-timestamps distdir: update-timestamps
-update-timestamps:
-       @if (cd $(srcdir) && test -d CVS && \
-           $(CVS) -n update $(TSDEPS_DIST) | grep '^M'); then \
-               echo "Cannot make dist before commit"; exit 1; else :; fi
-
 .PHONY: configure-subdirs
 configure-subdirs distdir: $(DIST_MAKEFILE_LIST)
 @DIST_MAKEFILE_LIST@:
@@ -83,19 +71,59 @@ install-data-hook:
 uninstall-local:
        -rm -rf $(DESTDIR)$(pkgdatadir)/libltdl
 
-################################################################
-##
-## Everything past here is useful to the maintainer, but probably not
-## to anybody else (snarfed from automake/Makefile.am).
-##
 
-XDELTA = xdelta
-XDELTA_OPTIONS = --pristine -9
+## ---------------------------------------------------------------- ##
+##  Everything past here is useful to the maintainer, but probably  ##
+##  not to anybody else (inspiration from automake/Makefile.am).    ##
+## ---------------------------------------------------------------- ##
+
+CHECK_LASTRELEASE = if test -z "$(LASTRELEASE)"; \
+                     then echo "LASTRELEASE is not set"; exit 1; fi
+
+.PHONY: cvs-release
+cvs-release: version-check prev-tarball cvs-news fetch cvs-dist cvs-diff xdelta
+       @$(CHECK_LASTRELEASE); tarname="$(PACKAGE)-$(VERSION).tar.gz"; \
+       diffname="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).diff.gz"; \
+       xdeltaname="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).xdelta"; \
+       echo " *** Upload $$tarname, $$tarname.sig,";\
+       echo " *** $$tarname.directive.asc, $$diffname,"; \
+       echo " *** $$diffname.sig, $$diffname.directive.asc,"; \
+       echo " *** $$xdeltaname, $$xdeltaname.sig and";\
+       echo " *** $$xdeltaname.directive.asc to either";\
+       echo " *** /incoming/alpha or /incoming/ftp on ftp-upload.gnu.org.";
+
+.PHONY: version-check
+version-check:
+       @case $(VERSION) in \
+       *[acegikmoqsuwy]) \
+         echo "Version \`$(VERSION)' is not a releasable version, please 
read:"; \
+         echo "    http://www.gnu.org/software/libtool/contribute.html";; \
+         exit 1; \
+         ;; \
+       esac
 
-GPG = gpg # set it to `:' to avoid gpg operations
+.PHONY: prev-tarball
+prev-tarball:
+## Make sure we have the previous release tarball in the tree.
+       @$(CHECK_LASTRELEASE); ofile="$(PACKAGE)-$(LASTRELEASE).tar.gz"; \
+       if test -f $$ofile; then :; \
+       else echo "Cannot make xdelta without $$ofile"; exit 1; fi
 
-.PHONY: cvs-dist cvs-diff xdelta cvs-release
-cvs-dist:
+# TSDEPS will be defined to TSDEPS_DIST at `make dist' time
+TSDEPS =
+TSDEPS_DIST = ChangeLog m4/libtool.m4
+CVS = cvs # set it to `:' to avoid CVS operations
+
+.PHONY: timestamps update-timestamps
+timestamps: update-timestamps
+update-timestamps:
+       @if (cd $(srcdir) && test -d CVS && \
+           $(CVS) -n update $(TSDEPS_DIST) | grep '^M'); then \
+               echo "Cannot make cvs-dist before commit"; exit 1; else :; fi
+
+
+.PHONY: cvs-news
+cvs-news: timestamps
 ## Make sure the NEWS file is up-to-date:
        @if sed '1,2d;3q' $(srcdir)/NEWS | grep -e "$(VERSION)" >/dev/null; \
        then :; \
@@ -103,6 +131,53 @@ cvs-dist:
          echo "NEWS not updated; not releasing" 1>&2; \
          exit 1; \
        fi
+
+## Program to use to fetch files.
+WGET = wget
+WGETSGO = $(WGET) http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
+
+## Files that we fetch and which we compare against.
+## FIXME should be a lot more here
+FETCHFILES = \
+./INSTALL \
+config/config.guess \
+libltdl/config.guess \
+config/config.sub \
+libltdl/config.sub \
+config/texinfo.tex
+
+## Fetch the latest versions of files we care about.
+.PHONY: fetch
+fetch:
+       rm -rf Fetchdir > /dev/null 2>&1
+       mkdir Fetchdir
+## If a get fails then that is a problem.
+       (cd Fetchdir && \
+       $(WGETSGO)/autoconf/autoconf/INSTALL; \
+       $(WGETSGO)/config/config/config.guess; \
+       $(WGETSGO)/config/config/config.sub; \
+       $(WGETSGO)/texinfo/texinfo/doc/texinfo.tex )
+## Don't exit after test because we want to give as many errors as
+## possible.
+       @stat=0; for file in $(FETCHFILES); do \
+         fetchedfile=Fetchdir/`echo $$file | sed 's,.*/,,g'`; \
+         if diff -u $(srcdir)/$$file $$fetchedfile \
+           >>Fetchdir/update.patch 2>/dev/null; then :; \
+         else \
+           stat=1; \
+           echo "Updating $(srcdir)/$$file..."; \
+           cp $$fetchedfile $(srcdir)/$$file; \
+         fi; \
+       done; \
+       test $$stat = 1 && \
+         echo "See Fetchdir/update.patch for a log of the changes."; \
+       exit $$stat
+
+
+GPG = gpg # set it to `:' to avoid gpg operations
+
+.PHONY: cvs-dist
+cvs-dist: cvs-news
 ## Build the distribution:
        $(MAKE) distcheck
 ## Finally, if everything was successful, commit the last changes and tag
@@ -121,23 +196,26 @@ cvs-dist:
          && $(GPG) --clearsign $$ofile.directive \
          && rm -f $$ofile.directive
 
+.PHONY: cvs-diff
 cvs-diff:
 ## Figure out which cvs tags we are diffing, and if the diff works we
 ## compress it and then generate the signatures needed for FSF ftp-upload:
        thisver=`echo "release-$(VERSION)" | sed 's/\./-/g'`; \
-       if test -z "$$OLDVERSION"; then \
-         prevno=`echo "$(VERSION)" - 0.01 | bc | sed 's/^\./0./'`; \
-       else prevno="$$OLDVERSION"; fi; \
-       prevver=release-`echo $$prevno | sed 's/\./-/g'`; \
-       ofile="$(PACKAGE)-$$prevno-$(VERSION).diff.gz"; \
+       $(CHECK_LASTRELEASE); \
+       prevver=release-`echo $(LASTRELEASE) | sed 's/\./-/g'`; \
+       ofile="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).diff.gz"; \
        $(CVS) -f rdiff -c -r $$prevver -r $$thisver $(PACKAGE) \
-           | GZIP=$(GZIP_ENV) gzip -c > $$ofile; \
+           | GZIP=$(GZIP_ENV) gzip -c > $$ofile \
          && $(GPG) --detach-sign $$ofile \
          && echo "directory: libtool" > $$ofile.directive \
          && $(GPG) --clearsign $$ofile.directive \
          && rm -f $$ofile.directive
 
-xdelta:
+XDELTA = xdelta
+XDELTA_OPTIONS = --pristine -9
+
+.PHONY: xdelta
+xdelta: prev-tarball
 ## Make sure xdelta exists;
        @if ($(XDELTA) --version 2>&1 | grep version)>/dev/null 2>/dev/null; \
        then :;\
@@ -148,57 +226,13 @@ xdelta:
 ## Generate the delta file (xdelta has wierd exit statuses, so we need to
 ## add some shell code to keep make happy), and then generate the signatures
 ## for FSF ftp-upload:
-       if test -z "$$OLDVERSION"; then \
-         prevno=`echo "$(VERSION)" - 0.01 | bc | sed 's/^\./0./'`; \
-       else prevno="$$OLDVERSION"; fi; \
-       ofile="$(PACKAGE)-$$prevno-$(VERSION).xdelta"; \
+       $(CHECK_LASTRELEASE); \
+       ofile="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).xdelta"; \
        ( test -z `$(XDELTA) delta $(XDELTA_OPTIONS) \
-           $(PACKAGE)-$$prevno.tar.gz $(PACKAGE)-$(VERSION).tar.gz \
+           $(PACKAGE)-$(LASTRELEASE).tar.gz $(PACKAGE)-$(VERSION).tar.gz \
            $$ofile 2>&1` \
          && : ) \
        && $(GPG) --detach-sign $$ofile \
        && echo "directory: libtool" > $$ofile.directive \
        && $(GPG) --clearsign $$ofile.directive \
        && rm -f $$ofile.directive
-
-cvs-release: cvs-dist cvs-diff xdelta
-
-## Program to use to fetch files.
-WGET = wget
-WGETSGO = $(WGET) http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
-
-## Files that we fetch and which we compare against.
-## FIXME should be a lot more here
-FETCHFILES = \
-./INSTALL \
-config/config.guess \
-libltdl/config.guess \
-config/config.sub \
-libltdl/config.sub \
-config/texinfo.tex
-
-## Fetch the latest versions of files we care about.
-fetch:
-       rm -rf Fetchdir > /dev/null 2>&1
-       mkdir Fetchdir
-## If a get fails then that is a problem.
-       (cd Fetchdir && \
-       $(WGETSGO)/autoconf/autoconf/INSTALL; \
-       $(WGETSGO)/config/config/config.guess; \
-       $(WGETSGO)/config/config/config.sub; \
-       $(WGETSGO)/texinfo/texinfo/doc/texinfo.tex )
-## Don't exit after test because we want to give as many errors as
-## possible.
-       @stat=0; for file in $(FETCHFILES); do \
-         fetchedfile=Fetchdir/`echo $$file | sed 's,.*/,,g'`; \
-         if diff -u $(srcdir)/$$file $$fetchedfile \
-           >>Fetchdir/update.patch 2>/dev/null; then :; \
-         else \
-           stat=1; \
-           echo "Updating $(srcdir)/$$file..."; \
-           cp $$fetchedfile $(srcdir)/$$file; \
-         fi; \
-       done; \
-       test $$stat = 1 && \
-         echo "See Fetchdir/update.patch for a log of the changes."; \
-       exit $$stat
Index: configure.ac
===================================================================
RCS file: /cvsroot/libtool/libtool/configure.ac,v
retrieving revision 1.24
diff -u -p -u -r1.24 configure.ac
--- configure.ac 19 Nov 2003 12:55:47 -0000 1.24
+++ configure.ac 21 Nov 2003 17:34:09 -0000
@@ -41,19 +41,66 @@ dnl AC_CONFIG_FILES([tests/atlocal])
 ## Display a configure time version banner. ##
 ## ---------------------------------------- ##
 
+# Calculating the previous version is somewhat involved, so do it once
+# here, and SUBST the result for the maintainer release rules.  The
+# versioning scheme we use is described here:
+#      http://www.gnu.org/software/libtool/contribute.html
+
+# First we break the version number up into its constituent parts.
+LT_MAJOR=`echo "AC_PACKAGE_VERSION" | sed ['s,\..*$,,g']`
+LT_MINOR=`echo "AC_PACKAGE_VERSION" | sed ['s,^[0-9]*\.\([0-9]*\).*$,\1,']`
+LT_MICRO=`echo "AC_PACKAGE_VERSION" | sed 
['s,^[0-9]*\.[0-9]*\(\.[0-9]*\).*$,\1,']`
+LT_ALPHA=`echo "AC_PACKAGE_VERSION" | sed ['s,^[0-9.]*,,']`
+
+test "$LT_MINOR" = "AC_PACKAGE_VERSION" && LT_MINOR=0
+test "$LT_MICRO" = "AC_PACKAGE_VERSION" && LT_MICRO=""
+
+# Then we try to work out what the release before this one would have been
+# numbered.  The only time we come unstuck is when this is the first release
+# from a stable branch (LT_MICRO=LT_ALPHA=""), so OLDVERSION is the last
+# release from the old stable branch, and we don't know what version that
+# was, so leave it unset so that the Makefile can complain.
+case $LT_ALPHA in
+  [[ab]])
+    case $LT_MICRO in
+      [.[01]])
+       LASTRELEASE="$LT_MAJOR.$LT_MINOR" ;;
+      *)
+       LASTRELEASE="$LT_MAJOR.$LT_MINOR$LT_MICRO" ;;
+    esac
+    ;;
+  [[cegikmoqsuwy]])
+    LASTRELEASE=`echo "AC_PACKAGE_VERSION" | tr 'c-y' 'b-w'` ;;
+  [[dfhjlnprtvxz]])
+    LASTRELEASE=`echo "AC_PACKAGE_VERSION" | tr 'd-z' 'b-x'` ;;
+  *) # No LT_ALPHA component
+    case $LT_MICRO in
+      .0)
+       LASTRELEASE="" ;;
+      .1)
+        LASTRELEASE="$LT_MAJOR.$LT_MINOR" ;;
+      .*)
+       lt_micro_value=`echo $LT_MICRO | sed 's,^\.,,'`
+       LASTRELEASE="$LT_MAJOR.$LT_MINOR.`expr $lt_micro_value - 1`" ;;
+      *)
+       LASTRELEASE="" ;;
+    esac
+    ;;
+esac
+AC_SUBST([LASTRELEASE])
+
 # This is a sanity check so we can see which version is used in bug reports.
 # It is assumed that we only want to see the date extension for cvs libtool
 # versions (i.e. "odd" letters) and not actual alpha releases.
 TIMESTAMP=
-case AC_PACKAGE_VERSION in
-  [*[acegikmoqsuwy])]
+case $LT_ALPHA in
+  [[acegikmoqsuwy]])
     TIMESTAMP=`${CONFIG_SHELL} ${ac_aux_dir}/mkstamp < ${srcdir}/ChangeLog`
     AS_BOX([Configuring AC_PACKAGE_TARNAME AC_PACKAGE_VERSION$TIMESTAMP])
     echo
     ;;
 esac
 AC_SUBST([TIMESTAMP])
-
 
 
 ## ------------------------ ##

Attachment: pgp32KA23vaRO.pgp
Description: PGP signature


reply via email to

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