aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-07-19 15:03:54 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-07-19 15:06:24 +0200
commit82079781a8b64120acfa714337bb3b87bcd960a5 (patch)
tree9065b5bc4b8efb62814c68df3925641c3f193e98
parent235bc1efe15518d48cfe81ae3e7983ad1d2cd9f2 (diff)
cec-follower: fix logging the SHA
Commit 3f35a7bcf82b ("cec-follower: Add version command") broke the v4l-utils debian build, and broke logging the SHA. Fix this. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Fixes: 3f35a7bcf82b ("cec-follower: Add version command")
-rw-r--r--utils/cec-follower/.gitignore1
-rw-r--r--utils/cec-follower/Makefile.am15
-rw-r--r--utils/cec-follower/cec-follower.cpp23
3 files changed, 4 insertions, 35 deletions
diff --git a/utils/cec-follower/.gitignore b/utils/cec-follower/.gitignore
index eecce74d..29546d1f 100644
--- a/utils/cec-follower/.gitignore
+++ b/utils/cec-follower/.gitignore
@@ -1,3 +1,2 @@
cec-follower
cec-follower.1
-version.h
diff --git a/utils/cec-follower/Makefile.am b/utils/cec-follower/Makefile.am
index 96e0f890..1108708b 100644
--- a/utils/cec-follower/Makefile.am
+++ b/utils/cec-follower/Makefile.am
@@ -2,20 +2,7 @@ bin_PROGRAMS = cec-follower
man_MANS = cec-follower.1
cec_follower_SOURCES = cec-follower.cpp cec-follower.h cec-processing.cpp cec-tuner.cpp
-cec_follower_CPPFLAGS = -I$(top_srcdir)/utils/libcecutil $(GIT_COMMIT_CNT)
+cec_follower_CPPFLAGS = -I$(top_srcdir)/utils/libcecutil $(GIT_SHA) $(GIT_COMMIT_CNT)
cec_follower_LDADD = -lrt ../libcecutil/libcecutil.la
-cec-follower.cpp: version.h
-
-version.h:
- @if [ -d $(top_srcdir)/.git ]; then \
- echo -n "#define SHA " >$@ ; \
- git -C $(top_srcdir) rev-parse HEAD >>$@ ; \
- else \
- touch $@ ; \
- fi
-
-clean-local:
- -rm -vf version.h
-
EXTRA_DIST = cec-follower.1
diff --git a/utils/cec-follower/cec-follower.cpp b/utils/cec-follower/cec-follower.cpp
index b3f9d615..b31b51d3 100644
--- a/utils/cec-follower/cec-follower.cpp
+++ b/utils/cec-follower/cec-follower.cpp
@@ -22,9 +22,6 @@
#include "cec-follower.h"
#include "compiler.h"
-#ifndef ANDROID
-#include "version.h"
-#endif
/* Short option list
@@ -76,21 +73,8 @@ static struct option long_options[] = {
{ 0, 0, 0, 0 }
};
-static void print_sha()
-{
-#ifdef SHA
#define STR(x) #x
#define STRING(x) STR(x)
- printf("cec-follower SHA : %s\n", STRING(SHA));
-#else
- printf("cec-follower SHA : not available\n");
-#endif
-}
-
-static void print_version()
-{
- printf("cec-follower %s%s\n", PACKAGE_VERSION, STRING(GIT_COMMIT_CNT));
-}
static void usage()
{
@@ -447,7 +431,8 @@ int main(int argc, char **argv)
show_state = true;
break;
case OptVersion:
- print_version();
+ printf("cec-follower %s%s\n", PACKAGE_VERSION, STRING(GIT_COMMIT_CNT));
+ printf("cec-follower SHA: %s\n", STRING(GIT_SHA));
std::exit(EXIT_SUCCESS);
case ':':
fprintf(stderr, "Option '%s' requires a value\n",
@@ -497,7 +482,7 @@ int main(int argc, char **argv)
node.state.service_by_dig_id = options[OptServiceByDigID];
state_init(node);
- print_sha();
+ printf("cec-follower SHA : %s\n", STRING(GIT_SHA));
doioctl(&node, CEC_ADAP_G_PHYS_ADDR, &node.phys_addr);
@@ -506,8 +491,6 @@ int main(int argc, char **argv)
node.adap_la_mask = laddrs.log_addr_mask;
node.cec_version = laddrs.cec_version;
- printf("\n");
-
struct cec_connector_info conn_info = {};
doioctl(&node, CEC_ADAP_G_CONNECTOR_INFO, &conn_info);

Privacy Policy