bug-gnulib
[Top][All Lists]
Advanced

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

Re: announce-gen -- not flexible enough


From: Jim Meyering
Subject: Re: announce-gen -- not flexible enough
Date: Sun, 13 Dec 2009 15:25:15 +0100

> +# Override this in cfg.mk if you have different post-release procedures.
> +post-release-hook ?= default-post-release-administrivia
> +
>  # Prevent programs like 'sort' from considering distinct strings to be equal.
>  # Doing it here saves us from having to set LC_ALL elsewhere in this file.
>  export LC_ALL = C
> @@ -761,12 +764,17 @@ alpha beta stable: $(local-check) writable-files 
> no-submodule-changes
>       $(MAKE) news-check
>       $(MAKE) distcheck
>       $(MAKE) dist XZ_OPT=-9ev
> +     $(MAKE) post-release-administrivia
> +     $(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
> +
> +post-release-administrivia: $(post-release-hook)
> +
> +default-post-release-administrivia:
>       $(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
>       if test -d $(release_archive_dir); then                 \
>         ln $(rel-files) $(release_archive_dir);               \
>         chmod a-w $(rel-files);                               \
>       fi
> -     $(MAKE) -s emit_upload_commands RELEASE_TYPE=$@

Thanks.
I've made corrections that do the following:
  - rename the rule: it's not "post-release" but release-preparatory
  - add a .PHONY
  - remove a level of indirection
  - avoid breaking the announcement-generating code:
     Once you move the "$(MAKE) -s announcement address@hidden"
     command into another rule, "$@" is no longer valid.
     Instead, rely on RELEASE_TYPE being set in the environment.


>From 7c0853eed19893c284b40a16db82bd59c3bceff2 Mon Sep 17 00:00:00 2001
From: Alfred M. Szmidt <address@hidden>
Date: Sun, 13 Dec 2009 15:11:14 +0100
Subject: [PATCH] maint.mk: allow a project to override release-prep rules

* top/maint.mk (alpha, beta, stable): Move release-preparatory rules
into a new rule.
(release-prep): New rule.
(release-prep-hook): New overridable variable.
---
 ChangeLog    |    8 ++++++++
 top/maint.mk |   13 +++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 31df9e0..8ebca9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-12-05  Alfred M. Szmidt  <address@hidden>
+
+       maint.mk: allow a project to override release-prep rules
+       * top/maint.mk (alpha, beta, stable): Move release-preparatory rules
+       into a new rule.
+       (release-prep): New rule.
+       (release-prep-hook): New overridable variable.
+
 2009-12-13  Jim Meyering  <address@hidden>

        maint.mk (null_AM_MAKEFLAGS, built_programs): remove unused definitions
diff --git a/top/maint.mk b/top/maint.mk
index f0fdee4..be061a6 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -750,12 +750,21 @@ alpha beta stable: $(local-check) writable-files 
no-submodule-changes
        $(MAKE) news-check
        $(MAKE) distcheck
        $(MAKE) dist XZ_OPT=-9ev
-       $(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
+       $(MAKE) $(release-prep-hook) RELEASE_TYPE=$@
+       $(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
+
+# Override this in cfg.mk if you follow different procedures.
+release-prep-hook ?= release-prep
+
+.PHONY: release-prep
+release-prep:
+       case $$RELEASE_TYPE in alpha|beta|stable) ;; \
+         *) echo "invalid RELEASE_TYPE: $$RELEASE_TYPE" 1>&2; exit 1;; esac
+       $(MAKE) -s announcement > /tmp/announce-$(my_distdir)
        if test -d $(release_archive_dir); then                 \
          ln $(rel-files) $(release_archive_dir);               \
          chmod a-w $(rel-files);                               \
        fi
-       $(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
        echo $(VERSION) > $(prev_version_file)
        $(MAKE) update-NEWS-hash
        perl -pi -e '$$. == 3 and print "$(noteworthy)\n\n\n"' NEWS
--
1.6.6.rc2.275.g51e2d




reply via email to

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