From 4363f54a5db2ce79e149c2f663d03888de7c049a Mon Sep 17 00:00:00 2001 From: chrfranke <chrfranke@4ea69e1a-61f1-4043-bf83-b5c94c648137> Date: Fri, 22 Apr 2022 19:14:42 +0000 Subject: [PATCH] smartctl.cpp: Add 'smartctl.pre_release' boolean to JSON output. git-svn-id: https://svn.code.sf.net/p/smartmontools/code/trunk@5354 4ea69e1a-61f1-4043-bf83-b5c94c648137 --- smartmontools/ChangeLog | 2 ++ smartmontools/smartctl.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/smartmontools/ChangeLog b/smartmontools/ChangeLog index 19ca2fca8..10b4346f6 100644 --- a/smartmontools/ChangeLog +++ b/smartmontools/ChangeLog @@ -2,6 +2,8 @@ $Id$ 2022-04-22 Christian Franke <franke@computer.org> + smartctl.cpp: Add 'smartctl.pre_release' boolean to JSON output. + drivedb.h: - Phison Driven SSDs: PNY ELITE (#1573) - USB: PNY (0x154b:0xf009) (#1573) diff --git a/smartmontools/smartctl.cpp b/smartmontools/smartctl.cpp index 8e07d12c6..a390e02c9 100644 --- a/smartmontools/smartctl.cpp +++ b/smartmontools/smartctl.cpp @@ -4,7 +4,7 @@ * Home page of code is: https://www.smartmontools.org * * Copyright (C) 2002-11 Bruce Allen - * Copyright (C) 2008-21 Christian Franke + * Copyright (C) 2008-22 Christian Franke * Copyright (C) 2000 Michael Cornwell <cornwell@acm.org> * * SPDX-License-Identifier: GPL-2.0-or-later @@ -89,6 +89,11 @@ static void js_initialize(int argc, char **argv, bool verbose) if (ver[2] > 0) jref["version"][2] = ver[2]; +#ifdef SMARTMONTOOLS_RELEASE_DATE + jref["pre_release"] = false; +#else + jref["pre_release"] = true; +#endif #ifdef SMARTMONTOOLS_SVN_REV jref["svn_revision"] = SMARTMONTOOLS_SVN_REV; #endif -- GitLab