Add hamlib_version command to rigctl/rigctld and format version date as ISO8601

pull/1336/head
Mike Black W9MDB 2023-07-11 11:13:04 -05:00
rodzic 79657a4b4d
commit 94cce72428
2 zmienionych plików z 7 dodań i 4 usunięć

Wyświetl plik

@ -36,7 +36,7 @@ EXTRA_DIST = Android.mk hamlibdatetime.h.in
hamlibdatetime.h: FORCE
@if test -x $(top_srcdir)/.git ; then \
echo "/* This date time is from the last non-merge commit to Hamlib. */" > $(builddir)/$(@F).tmp ;\
echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%b %d %H:%M:%SZ %Y SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges -n 1 | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\
echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%Y-%m-%dT%H:%M:%SZ SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges -n 1 | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\
diff -qN $(builddir)/$(@F).tmp $(builddir)/$(@F) ; test $$? -eq 0 || { echo "Generating SCS header \"$(builddir)/$(@F)\"" ; mv -f $(builddir)/$(@F).tmp $(builddir)/$(@F) ; } ;\
rm -f $(builddir)/$(@F).tmp ;\
else \

Wyświetl plik

@ -265,6 +265,7 @@ declare_proto_rig(set_lock_mode);
declare_proto_rig(get_lock_mode);
declare_proto_rig(send_raw);
declare_proto_rig(client_version);
declare_proto_rig(hamlib_version);
declare_proto_rig(test);
@ -382,6 +383,7 @@ static struct test_table test_list[] =
{ 0xa5, "client_version", ACTION(client_version), ARG_NOVFO | ARG_IN1, "Version", "Client version" },
{ 0xa6, "get_vfo_list", ACTION(get_vfo_list), ARG_NOVFO },
{ 0xa7, "test", ACTION(test), ARG_NOVFO | ARG_IN, "routine" },
{ 0xa8, "hamlib_version", ACTION(hamlib_version), ARG_NOVFO },
{ 0x00, "", NULL },
};
@ -1844,10 +1846,11 @@ readline_repeat:
}
void version()
declare_proto_rig(hamlib_version)
{
printf("rigctl(d), %s\n\n", hamlib_version2);
printf("%s\n", hamlib_copyright);
fprintf(fout, "rigctl(d), %s\n\n", hamlib_version2);
fprintf(fout, "%s\n", hamlib_copyright);
return RIG_OK;
}
declare_proto_rig(client_version)