diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2020-10-21 15:59:28 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2020-10-21 15:59:28 +0200 |
commit | fbf328f0b02eabe973a9c837bdbb507d803f9835 (patch) | |
tree | 16afc8eaacc40be6625dd6dc1b10599448dd465e /utils/v4l2-compliance | |
parent | 01bf31643024cfbfb0f47c8860b431305b9bf256 (diff) |
cec utils and v4l2-compliance: improve version info
Various versioning changes:
- GIT_SHA is now a SHA with length 12, the full SHA was a bit ridiculous.
- the CEC/V4L2 compliance-related utilities now also report the last git
commit date in UTC to make it easier to verify that the git repo is
recent enough.
- show the versioning as well for the cec-ctl power cycle tests.
- don't show the git info if it wasn't build from a git repo.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'utils/v4l2-compliance')
-rw-r--r-- | utils/v4l2-compliance/Makefile.am | 2 | ||||
-rw-r--r-- | utils/v4l2-compliance/v4l2-compliance.cpp | 15 |
2 files changed, 7 insertions, 10 deletions
diff --git a/utils/v4l2-compliance/Makefile.am b/utils/v4l2-compliance/Makefile.am index 2f887735..e4dab9a7 100644 --- a/utils/v4l2-compliance/Makefile.am +++ b/utils/v4l2-compliance/Makefile.am @@ -14,7 +14,7 @@ v4l2_compliance_SOURCES = v4l2-compliance.cpp v4l2-compliance.h \ v4l2-test-controls.cpp v4l2-test-io-config.cpp v4l2-test-formats.cpp v4l2-test-buffers.cpp \ v4l2-test-codecs.cpp v4l2-test-subdevs.cpp v4l2-test-media.cpp v4l2-test-colors.cpp \ media-info.cpp v4l2-info.cpp -v4l2_compliance_CPPFLAGS = -I$(top_srcdir)/utils/common $(GIT_SHA) $(GIT_COMMIT_CNT) +v4l2_compliance_CPPFLAGS = -I$(top_srcdir)/utils/common $(GIT_SHA) $(GIT_COMMIT_CNT) $(GIT_COMMIT_DATE) if WITH_V4L2_COMPLIANCE_LIBV4L v4l2_compliance_LDADD = ../../lib/libv4l2/libv4l2.la ../../lib/libv4lconvert/libv4lconvert.la -lrt -lpthread diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp index 4ff0a303..1fc9fd0c 100644 --- a/utils/v4l2-compliance/v4l2-compliance.cpp +++ b/utils/v4l2-compliance/v4l2-compliance.cpp @@ -150,14 +150,11 @@ static struct option long_options[] = { static void print_sha() { - printf("v4l2-compliance SHA: %s", STRING(GIT_SHA)); - printf(", %zd bits, %zd-bit time_t\n", sizeof(void *) * 8, sizeof(time_t) * 8); - printf("\n"); -} - -static void print_version() -{ - printf("v4l2-compliance %s%s\n", PACKAGE_VERSION, STRING(GIT_COMMIT_CNT)); + printf("v4l2-compliance %s%s, ", PACKAGE_VERSION, STRING(GIT_COMMIT_CNT)); + printf("%zd bits, %zd-bit time_t\n", sizeof(void *) * 8, sizeof(time_t) * 8); + if (strlen(STRING(GIT_SHA))) + printf("v4l2-compliance SHA: %s %s\n", + STRING(GIT_SHA), STRING(GIT_COMMIT_DATE)); } static void usage() @@ -1659,7 +1656,6 @@ int main(int argc, char **argv) no_progress = true; break; case OptVersion: - print_version(); print_sha(); std::exit(EXIT_SUCCESS); case ':': @@ -1685,6 +1681,7 @@ int main(int argc, char **argv) } print_sha(); + printf("\n"); bool direct = !options[OptUseWrapper]; int fd; |