multipath-tools build: accept KBUILD_BUILD_TIMESTAMP from env
PATCH 1/1 multipath-tools build: accept KBUILD_BUILD_TIMESTAMP from env
From: Chris Lamb <[email protected]>
It would appear KBUILD_BUILD_TIMESTAMP is meant to be used the same way as in the linux kernel build. For linux, builders are supposed to set KBUILD_BUILD_TIMESTAMP in the environment if they want a stable timestamp.
The libddmmp makefile however tries to directly call git to get a timestamp, which fails in a typical Debian build environment, which is not a full git source tree.
Have libdmmp/Makefile use KBUILD_BUILD_TIMESTAMP from the environment if available, otherwise use git as before.
--- libdmmp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
libdmmp/Makefile +1 -1
@@ -75,7 +75,7 @@ docs/man/dmmp_strerror.3: $(HEADERS) $(Q)TEMPFILE=$(shell mktemp); \ cat $^ | perl docs/doc-preclean.pl >$$TEMPFILE; \ LC_ALL=C \ - KBUILD_BUILD_TIMESTAMP=`git log -n1 --pretty=%cd --date=iso -- $^` \ + KBUILD_BUILD_TIMESTAMP=`echo $$KBUILD_BUILD_TIMESTAMP | grep . || git log -n1 --pretty=%cd --date=iso -- $^` \ perl docs/kernel-doc -man $$TEMPFILE | \ perl docs/split-man.pl docs/man; \ $(RM) -f $$TEMPFILE
Signature · 6 lines
2.39.2 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
Quoted 36 lines · Chris Hofstaedtler
From: Chris Lamb <[email protected]>
It would appear
KBUILD_BUILD_TIMESTAMPis meant to be used the same way as in
the linux kernel build. For linux, builders are supposed to setKBUILD_BUILD_TIMESTAMPin the environment if they want a stable timestamp.The libddmmp makefile however tries to directly call git to get a timestamp,
which fails in a typical Debian build environment, which is not a full git
source tree.Have libdmmp/Makefile use
KBUILD_BUILD_TIMESTAMPfrom the environment if
available, otherwise use git as before.Signed-off-by Chris Hofstaedtler <[email protected]>---
libdmmp/Makefile | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)libdmmp/Makefile +1
-2@@ -75,7 +75,7 @@ docs/man/dmmp_strerror.3: $(HEADERS) $(Q)TEMPFILE=$(shell mktemp); \ cat $^ | perl docs/doc-preclean.pl >$$TEMPFILE; \ LC_ALL=C \ - KBUILD_BUILD_TIMESTAMP=`git log -n1 --pretty=%cd --date=iso - - $^` \ + KBUILD_BUILD_TIMESTAMP=`echo $$KBUILD_BUILD_TIMESTAMP | grep . || git log -n1 --pretty=%cd --date=iso -- $^` \ perl docs/kernel-doc -man $$TEMPFILE | \
Quoted 2 lines
perl
docs/split-man.pldocs/man; \
$(RM) -f $$TEMPFILE
Thanks.
Can we do this instead? It looks slightly more readable to me.
libdmmp/Makefile +3 -1
@@ -74,8 +74,10 @@ doc: docs/man/dmmp_strerror.3 docs/man/dmmp_strerror.3: $(HEADERS) $(Q)TEMPFILE=$(shell mktemp); \ cat $^ | perl docs/doc-preclean.pl >$$TEMPFILE; \ + [ "$KBUILD_BUILD_TIMESTAMP" ] || \ + KBUILD_BUILD_TIMESTAMP=`git log -n1 --pretty=%cd --date=iso -- $^`; \ + export KBUILD_BUILD_TIMESTAMP; \ LC_ALL=C \ - KBUILD_BUILD_TIMESTAMP=`git log -n1 --pretty=%cd --date=iso -- $^` \ perl docs/kernel-doc -man $$TEMPFILE | \ perl docs/split-man.pl docs/man; \ $(RM) -f $$TEMPFILE
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Quoted 1 line · Martin Wilck
Can we do this instead? It looks slightly more readable to me.
LGTM.
Regards,
Signature · 9 lines
,''`.
: :' : Chris Lamb
`. `'` [email protected] 🍥 chris-lamb.co.uk
`-
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel