Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/atf Fix the bundling of the version number in b...



details:   https://anonhg.NetBSD.org/src/rev/07cdcbb74298
branches:  trunk
changeset: 326729:07cdcbb74298
user:      jmmv <jmmv%NetBSD.org@localhost>
date:      Sat Feb 15 04:19:46 2014 +0000

description:
Fix the bundling of the version number in built files.

Yes, attempting yet another fix at this so that the version number that
gets recorded in the pkgconfig files and inside atf-version really matches
the latest imported version.  Should resolve issues where the built files
get stuck with an older version number during update builds.

This time, I'm trying the same approach I applied in the FreeBSD source
tree, which has been working fine so far across various release imports.

diffstat:

 external/bsd/atf/Makefile.inc                 |  19 +++++++++++--------
 external/bsd/atf/lib/libatf-c++/Makefile      |   6 +++---
 external/bsd/atf/lib/libatf-c/Makefile        |   6 +++---
 external/bsd/atf/usr.bin/atf-sh/Makefile      |   6 +++---
 external/bsd/atf/usr.bin/atf-version/Makefile |   4 ++--
 5 files changed, 22 insertions(+), 19 deletions(-)

diffs (109 lines):

diff -r ca41f50188a4 -r 07cdcbb74298 external/bsd/atf/Makefile.inc
--- a/external/bsd/atf/Makefile.inc     Sat Feb 15 04:15:20 2014 +0000
+++ b/external/bsd/atf/Makefile.inc     Sat Feb 15 04:19:46 2014 +0000
@@ -1,17 +1,20 @@
-# $NetBSD: Makefile.inc,v 1.4 2014/02/15 02:02:39 jmmv Exp $
+# $NetBSD: Makefile.inc,v 1.5 2014/02/15 04:19:46 jmmv Exp $
 
 .include <bsd.own.mk>
 
 TOPDIR=                ${NETBSDSRCDIR}/external/bsd/atf
 SRCDIR=                ${TOPDIR}/dist
 
-ATF_VERSION!=  grep 'define VERSION' ${TOPDIR}/bconfig.h | cut -d '"' -f 2
-cookie-version: cookie-version-2
-       @cmp -s cookie-version cookie-version-2 \
-           || cp cookie-version-2 cookie-version
-cookie-version-2: .PHONY
-       @echo "${ATF_VERSION}" >cookie-version-2
-CLEANFILES+=   cookie-version cookie-version-2
+# Depend on the atf-version.txt target to generate a file that contains
+# the version number of the currently imported ATF release and that only
+# changes on new imports.
+atf-version.txt: atf-version-real.txt
+       @cmp -s atf-version.txt atf-version-real.txt \
+           || cp atf-version-real.txt atf-version.txt
+atf-version-real.txt: .PHONY
+       @grep 'define VERSION' ${TOPDIR}/bconfig.h \
+           | cut -d '"' -f 2 >atf-version-real.txt
+CLEANFILES+= atf-version.txt atf-version-real.txt
 
 CPPFLAGS+=     -DHAVE_CONFIG_H
 
diff -r ca41f50188a4 -r 07cdcbb74298 external/bsd/atf/lib/libatf-c++/Makefile
--- a/external/bsd/atf/lib/libatf-c++/Makefile  Sat Feb 15 04:15:20 2014 +0000
+++ b/external/bsd/atf/lib/libatf-c++/Makefile  Sat Feb 15 04:19:46 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.22 2014/02/12 04:08:31 jmmv Exp $
+# $NetBSD: Makefile,v 1.23 2014/02/15 04:19:46 jmmv Exp $
 
 NOLINT=                # defined
 
@@ -47,8 +47,8 @@
 FILESDIR=      /usr/lib/pkgconfig
 
 realall: atf-c++.pc
-atf-c++.pc: Makefile atf-c++.pc.in cookie-version
-       ${TOOL_SED} -e 's,__ATF_VERSION__,${ATF_VERSION},g' \
+atf-c++.pc: Makefile atf-c++.pc.in atf-version.txt
+       ${TOOL_SED} -e 's,__ATF_VERSION__,$$(cat atf-version.txt),g' \
            -e 's,__CXX__,g++,g' \
            -e 's,__INCLUDEDIR__,/usr/include,g' \
            -e 's,__LIBDIR__,/usr/lib,g' \
diff -r ca41f50188a4 -r 07cdcbb74298 external/bsd/atf/lib/libatf-c/Makefile
--- a/external/bsd/atf/lib/libatf-c/Makefile    Sat Feb 15 04:15:20 2014 +0000
+++ b/external/bsd/atf/lib/libatf-c/Makefile    Sat Feb 15 04:19:46 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2014/02/12 04:08:31 jmmv Exp $
+# $NetBSD: Makefile,v 1.20 2014/02/15 04:19:46 jmmv Exp $
 
 NOLINT=                # defined
 
@@ -58,8 +58,8 @@
 FILESDIR=      /usr/lib/pkgconfig
 
 realall: atf-c.pc
-atf-c.pc: Makefile atf-c.pc.in cookie-version
-       ${TOOL_SED} -e 's,__ATF_VERSION__,${ATF_VERSION},g' \
+atf-c.pc: Makefile atf-c.pc.in atf-version.txt
+       ${TOOL_SED} -e 's,__ATF_VERSION__,$$(cat atf-version.txt),g' \
            -e 's,__CC__,gcc,g' \
            -e 's,__INCLUDEDIR__,/usr/include,g' \
            -e 's,__LIBDIR__,/usr/lib,g' \
diff -r ca41f50188a4 -r 07cdcbb74298 external/bsd/atf/usr.bin/atf-sh/Makefile
--- a/external/bsd/atf/usr.bin/atf-sh/Makefile  Sat Feb 15 04:15:20 2014 +0000
+++ b/external/bsd/atf/usr.bin/atf-sh/Makefile  Sat Feb 15 04:19:46 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2014/02/12 04:08:32 jmmv Exp $
+# $NetBSD: Makefile,v 1.11 2014/02/15 04:19:46 jmmv Exp $
 
 .include <bsd.init.mk>
 
@@ -25,8 +25,8 @@
 FILESDIR_atf-sh.pc=    /usr/lib/pkgconfig
 
 realall: atf-sh.pc
-atf-sh.pc: Makefile atf-sh.pc.in cookie-version
-       ${TOOL_SED} -e 's,__ATF_VERSION__,${ATF_VERSION},g' \
+atf-sh.pc: Makefile atf-sh.pc.in atf-version.txt
+       ${TOOL_SED} -e 's,__ATF_VERSION__,$$(cat atf-version.txt),g' \
            -e 's,__EXEC_PREFIX__,/usr,g' \
            <${SRCDIR}/atf-sh/atf-sh.pc.in >atf-sh.pc
 CLEANFILES+=   atf-sh.pc
diff -r ca41f50188a4 -r 07cdcbb74298 external/bsd/atf/usr.bin/atf-version/Makefile
--- a/external/bsd/atf/usr.bin/atf-version/Makefile     Sat Feb 15 04:15:20 2014 +0000
+++ b/external/bsd/atf/usr.bin/atf-version/Makefile     Sat Feb 15 04:19:46 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2014/02/12 04:08:32 jmmv Exp $
+# $NetBSD: Makefile,v 1.12 2014/02/15 04:19:46 jmmv Exp $
 
 USE_ATF_LIBTOOLS=      yes
 
@@ -16,6 +16,6 @@
 WARNS?=                2
 
 CPPFLAGS+=     -DATF_VERSION=\"$(ATF_VERSION)\"
-atf-version.o: cookie-version
+atf-version.o: atf-version.txt
 
 .include <bsd.prog.mk>



Home | Main Index | Thread Index | Old Index