maint.mk: provide "make upload" to ease uploading
authorAkim Demaille <akim@lrde.epita.fr>
Thu, 20 Sep 2012 09:10:34 +0000 (11:10 +0200)
committerAkim Demaille <akim@lrde.epita.fr>
Tue, 25 Sep 2012 09:50:54 +0000 (11:50 +0200)
See <http://lists.gnu.org/archive/html/bug-gnulib/2012-08/msg00028.html>.
Do not depend simply on the current $(VERSION), as there may have been
new commits since the tarball generation.  Rather, rely on $(RELEASE),
as "make release-commit" already does.

For consistency, add "make release RELEASE='X.Y TYPE'" as an alias for
"make TYPE".

* top/maint.mk (upload_command, upload, release): New.
(RELEASE_TYPE): If undefined, default to the second word of $(RELEASE).
(VERSION): first word of $(RELEASE) is always right.
(emit_upload_commands): Adjust.
* top/README-release: Update.

ChangeLog
top/README-release
top/maint.mk

index 0c63b76..1173ca7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
 2012-09-20  Akim Demaille  <akim@lrde.epita.fr>
 
+       maint.mk: provide "make upload" to ease uploading
+       See
+       <http://lists.gnu.org/archive/html/bug-gnulib/2012-08/msg00028.html>.
+       Do not depend simply on the current $(VERSION), as there may have been
+       new commits since the tarball generation.  Rather, rely on $(RELEASE),
+       as "make release-commit" already does.
+
+       For consistency, add "make release RELEASE='X.Y TYPE'" as an alias for
+       "make TYPE".
+
+       * top/maint.mk (upload_command, upload, release): New.
+       (RELEASE_TYPE): If undefined, default to the second word of $(RELEASE).
+       (VERSION): first word of $(RELEASE) is always right.
+       (emit_upload_commands): Adjust.
+       * top/README-release: Update.
+
+2012-09-20  Akim Demaille  <akim@lrde.epita.fr>
+
        maint.mk: silent rules
        With help from Stefano Lattarini.
        * top/maint.mk (writable-files): Use $(AM_V_GEN).
index 9c47528..17f026a 100644 (file)
@@ -31,18 +31,18 @@ Here are most of the steps we (maintainers) follow when making a release.
 
     make check syntax-check distcheck
 
-* To (i) set the date, version number, and release type [stable/alpha/beta]
-  on line 3 of NEWS, (ii) commit that, and (iii) tag the release, run
+* To (i) set the date, version number, and release TYPE on line 3 of
+  NEWS, (ii) commit that, and (iii) tag the release, run
 
-    make release-commit RELEASE='X.Y stable'
+    # "TYPE" must be stable, beta or alpha
+    make release-commit RELEASE='X.Y TYPE'
 
 * Run the following to create release tarballs.  Your choice selects the
   corresponding upload-to destination in the emitted gnupload command.
   The different destinations are specified in cfg.mk.  See the definitions
   of gnu_ftp_host-{alpha,beta,stable}.
 
-    # "TYPE" must be stable, beta or alpha
-    make TYPE
+    make release RELEASE='X.Y TYPE'
 
 * Test the tarball.  Copy it to a few odd-ball systems and ensure that
   it builds and passes all tests.
@@ -53,7 +53,10 @@ Here are most of the steps we (maintainers) follow when making a release.
 
 Once all the builds and tests have passed,
 
-* Run the gnupload command that was suggested by your "make TYPE" run above.
+* Run the gnupload command that was suggested by your "make release"
+  run above, or run
+
+    make upload RELEASE='X.Y TYPE'
 
 * Wait a few minutes (maybe up to 30?) and then use the release URLs to
   download all tarball/signature pairs and use gpg --verify to ensure
index 1851815..26ebc37 100644 (file)
@@ -107,6 +107,13 @@ my_distdir = $(PACKAGE)-$(VERSION)
 # Old releases are stored here.
 release_archive_dir ?= ../release
 
+# If RELEASE_TYPE is undefined, but RELEASE is, use its second word.
+# But overwrite VERSION.
+ifdef RELEASE
+  VERSION := $(word 1, $(RELEASE))
+  RELEASE_TYPE ?= $(word 2, $(RELEASE))
+endif
+
 # Validate and return $(RELEASE_TYPE), or die.
 RELEASE_TYPES = alpha beta stable
 release-type = $(call member-check,RELEASE_TYPE,$(RELEASE_TYPES))
@@ -1329,16 +1336,22 @@ ftp-gnu = ftp://ftp.gnu.org/gnu
 www-gnu = http://www.gnu.org
 
 upload_dest_dir_ ?= $(PACKAGE)
+upload_command =                                               \
+  $(srcdir)/$(_build-aux)/gnupload $(GNUPLOADFLAGS)            \
+  --to $(gnu_rel_host):$(upload_dest_dir_)                     \
+  $(rel-files)
 emit_upload_commands:
        @echo =====================================
        @echo =====================================
-       @echo "$(srcdir)/$(_build-aux)/gnupload $(GNUPLOADFLAGS) \\"
-       @echo "    --to $(gnu_rel_host):$(upload_dest_dir_) \\"
-       @echo "  $(rel-files)"
+       @echo '$(upload_command)'
        @echo '# send the ~/announce-$(my_distdir) e-mail'
        @echo =====================================
        @echo =====================================
 
+.PHONY: upload
+upload:
+       $(AM_V_GEN)$(upload_command)
+
 define emit-commit-log
   printf '%s\n' 'maint: post-release administrivia' ''                 \
     '* NEWS: Add header line for next release.'                                \
@@ -1384,7 +1397,7 @@ public-submodule-commit:
 gl_public_submodule_commit ?= public-submodule-commit
 check: $(gl_public_submodule_commit)
 
-.PHONY: alpha beta stable
+.PHONY: alpha beta stable release
 ALL_RECURSIVE_TARGETS += alpha beta stable
 alpha beta stable: $(local-check) writable-files $(submodule-checks)
        $(AM_V_GEN)test $@ = stable                                     \
@@ -1398,6 +1411,8 @@ alpha beta stable: $(local-check) writable-files $(submodule-checks)
        $(AM_V_at)$(MAKE) $(release-prep-hook) RELEASE_TYPE=$@
        $(AM_V_at)$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
 
+release: $(release-type)
+
 # Override this in cfg.mk if you follow different procedures.
 release-prep-hook ?= release-prep