bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] build: ensure that a release build fails when a submodule is unc


From: Jim Meyering
Subject: [PATCH] build: ensure that a release build fails when a submodule is unclean
Date: Sat, 02 May 2009 22:34:57 +0200

With coreutils-7.3, I mistakenly included a locally modified (i.e.,
not-committed -- and buggy!) version of lib/getdate.y in the release tarball.

How could it happen?
While there is a rule to ensure that no version-controlled file
in coreutils proper is included in a release, that rule was not
extended to cover uncommitted changes in a git submodule like Gnulib/.

The following addition to maint.mk is to ensure I don't repeat that mistake.

I'll make a new coreutils release shortly.

>From 181a69f91ee2e3699b5e4a5a21f1fc3c843568e5 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sat, 2 May 2009 22:20:10 +0200
Subject: [PATCH] build: ensure that a release build fails when a submodule is 
unclean

* top/maint.mk (no-submodule-changes): New rule.
(alpha beta major): Depend on it.
---
 ChangeLog    |    6 ++++++
 top/maint.mk |   14 +++++++++++++-
 2 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index aacbc0c..3d72119 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-05-02  Jim Meyering  <address@hidden>
+
+       build: ensure that a release build fails when a submodule is unclean
+       * top/maint.mk (no-submodule-changes): New rule.
+       (alpha beta major): Depend on it.
+
 2009-05-02  Bruno Haible  <address@hidden>

        Remove incompatibility between modules fnmatch-posix and fnmatch-gnu.
diff --git a/top/maint.mk b/top/maint.mk
index b7f6868..f34f6bf 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -676,9 +676,21 @@ define emit-commit-log
     '* cfg.mk (old_NEWS_hash): Auto-update.'
 endef

+.PHONY: no-submodule-changes
+no-submodule-changes:
+       if test -d .git; then                                           \
+         diff=$$(git submodule -q foreach git diff-index --name-only HEAD) \
+           || exit 1;                                                  \
+         case $$diff in '') ;;                                         \
+           *) echo '$(ME): submodule files are locally modified:';     \
+               echo "$$diff"; exit 1;; esac;                           \
+       else                                                            \
+         : ;                                                           \
+       fi
+
 .PHONY: alpha beta major
 ALL_RECURSIVE_TARGETS += alpha beta major
-alpha beta major: $(local-check) writable-files
+alpha beta major: $(local-check) writable-files no-submodule-changes
        test $@ = major                                         \
          && { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$' \
               || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\
--
1.6.3.rc4.190.g4648




reply via email to

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