From 2b745bdb76eb2f41828f39b82d75e16d6263ac5c Mon Sep 17 00:00:00 2001 From: Ricardo F Date: Mon, 15 Aug 2022 16:14:06 +0200 Subject: [PATCH 1/7] Update rpm release version --- misc/rpm/rpm-readme.txt | 6 +++--- misc/rpm/tuptime.spec | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/misc/rpm/rpm-readme.txt b/misc/rpm/rpm-readme.txt index 4db6609..2d28834 100644 --- a/misc/rpm/rpm-readme.txt +++ b/misc/rpm/rpm-readme.txt @@ -41,9 +41,9 @@ Z.- For testing with "dev" branch. Install "git" on step "1" and replace step "2 dnf -y install git cd ~ - git clone -b dev --depth=1 https://github.com/rfrail3/tuptime.git tuptime-5.1.0 + git clone -b dev --depth=1 https://github.com/rfrail3/tuptime.git tuptime-5.2.0 rpmdev-setuptree cd ~/rpmbuild/SPECS/ - cp ../../tuptime-5.1.0/misc/rpm/tuptime.spec . - tar -czvf ../SOURCES/5.1.0.tar.gz ../../tuptime-5.1.0 + cp ../../tuptime-5.2.0/misc/rpm/tuptime.spec . + tar -czvf ../SOURCES/5.2.0.tar.gz ../../tuptime-5.2.0 rpmbuild -ba --target=noarch tuptime.spec diff --git a/misc/rpm/tuptime.spec b/misc/rpm/tuptime.spec index d14986c..7228880 100644 --- a/misc/rpm/tuptime.spec +++ b/misc/rpm/tuptime.spec @@ -1,5 +1,5 @@ Name: tuptime -Version: 5.1.0 +Version: 5.2.0 Release: 1%{?dist} Summary: Report historical system real time @@ -102,6 +102,9 @@ su -s /bin/sh _tuptime -c "(umask 0022 && /usr/bin/tuptime -x)" %changelog +* Mon Aug 15 2022 Ricardo Fraile 5.2.0-1 +- New release + * Sun Jan 16 2022 Ricardo Fraile 5.1.0-1 - Bump new release From 7ec6492072c35c823dcf77d12a27a6963cf6acb8 Mon Sep 17 00:00:00 2001 From: Ricardo F Date: Tue, 16 Aug 2022 19:53:55 +0200 Subject: [PATCH 2/7] Revert removing cron and doc files on postinst --- debian/postinst | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/debian/postinst b/debian/postinst index 14c258a..f15ab99 100644 --- a/debian/postinst +++ b/debian/postinst @@ -47,20 +47,6 @@ case "$1" in fi fi - # Remove obsolete cron configuration - if [ -f /etc/cron.d/tuptime ]; then - echo -n "Removing obsolete cron configuration... " - rm -f /etc/cron.d/tuptime - echo "done" - fi - - # Remove obsolete example files - if [ -d /usr/share/doc/tuptime/examples/ ]; then - echo -n "Removing obsolete example files... " - rm -rf /usr/share/doc/tuptime/examples/ - echo "done" - fi - su -s /bin/sh _tuptime -c "tuptime -x" ;; From 85082864149841b657aefe3f9512f712607c21e6 Mon Sep 17 00:00:00 2001 From: Ricardo F Date: Tue, 16 Aug 2022 20:16:03 +0200 Subject: [PATCH 3/7] Database trace callbacks with .debug --- misc/scripts/tuptime_dbcheck.py | 2 +- misc/scripts/tuptime_join.py | 8 ++++---- misc/scripts/tuptime_modify.py | 2 +- src/tuptime | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/misc/scripts/tuptime_dbcheck.py b/misc/scripts/tuptime_dbcheck.py index 5e2e757..7b12149 100644 --- a/misc/scripts/tuptime_dbcheck.py +++ b/misc/scripts/tuptime_dbcheck.py @@ -214,7 +214,7 @@ def main(): db_conn = sqlite3.connect(arg.db_file) db_conn.row_factory = sqlite3.Row - db_conn.set_trace_callback(logging.info) + db_conn.set_trace_callback(logging.debug) conn = db_conn.cursor() # Check if DB have the old format diff --git a/misc/scripts/tuptime_join.py b/misc/scripts/tuptime_join.py index 1bb743e..8a8aec9 100644 --- a/misc/scripts/tuptime_join.py +++ b/misc/scripts/tuptime_join.py @@ -84,13 +84,13 @@ def order_files(arg): # Open file0 DB db_conn0 = sqlite3.connect(arg.files[0]) db_conn0.row_factory = sqlite3.Row - db_conn0.set_trace_callback(logging.info) + db_conn0.set_trace_callback(logging.debug) conn0 = db_conn0.cursor() # Open file1 DB db_conn1 = sqlite3.connect(arg.files[1]) db_conn1.row_factory = sqlite3.Row - db_conn1.set_trace_callback(logging.info) + db_conn1.set_trace_callback(logging.debug) conn1 = db_conn1.cursor() # Check if DBs have the old format @@ -129,13 +129,13 @@ def main(): # Open file0 DB db_conn0 = sqlite3.connect(fl0['path']) db_conn0.row_factory = sqlite3.Row - db_conn0.set_trace_callback(logging.info) + db_conn0.set_trace_callback(logging.debug) conn0 = db_conn0.cursor() # Open file1 DB db_conn1 = sqlite3.connect(fl1['path']) db_conn1.row_factory = sqlite3.Row - db_conn1.set_trace_callback(logging.info) + db_conn1.set_trace_callback(logging.debug) conn1 = db_conn1.cursor() # Get all rows from source file0 and print raw rows diff --git a/misc/scripts/tuptime_modify.py b/misc/scripts/tuptime_modify.py index 5db897d..75fdcea 100644 --- a/misc/scripts/tuptime_modify.py +++ b/misc/scripts/tuptime_modify.py @@ -230,7 +230,7 @@ def main(): db_conn = sqlite3.connect(arg.db_file) db_conn.row_factory = sqlite3.Row - db_conn.set_trace_callback(logging.info) + db_conn.set_trace_callback(logging.debug) conn = db_conn.cursor() # Check if DB have the old format diff --git a/src/tuptime b/src/tuptime index bfbae58..8c0f3f3 100644 --- a/src/tuptime +++ b/src/tuptime @@ -453,7 +453,7 @@ def gain_db(sis, arg): else: logging.info('Making DB file = %s', arg.db_file) db_conn = sqlite3.connect(arg.db_file) - db_conn.set_trace_callback(logging.info) + db_conn.set_trace_callback(logging.debug) conn = db_conn.cursor() conn.execute('BEGIN deferred') conn.execute('create table tuptime' @@ -474,7 +474,7 @@ def gain_db(sis, arg): logging.info('Getting DB connection') db_conn = sqlite3.connect(arg.db_file) db_conn.row_factory = sqlite3.Row - db_conn.set_trace_callback(logging.info) + db_conn.set_trace_callback(logging.debug) conn = db_conn.cursor() conn.execute('BEGIN deferred') except Exception as exp_conn: From 0f7a5decff61c6af5e0d359c70efe25a98ca796e Mon Sep 17 00:00:00 2001 From: Ricardo F Date: Tue, 16 Aug 2022 20:22:06 +0200 Subject: [PATCH 4/7] Return "-e" argument for decimals --- src/man/tuptime.1 | 2 +- src/tuptime | 2 +- tuptime-manual.txt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/man/tuptime.1 b/src/man/tuptime.1 index 2b6359f..3242fa1 100644 --- a/src/man/tuptime.1 +++ b/src/man/tuptime.1 @@ -61,7 +61,7 @@ T} \-d | \-\-date DATETIME_FMT@T{ Datetime/timestamp format output T} -\-\-dec DECIMALS@T{ +\-e | \-\-dec DECIMALS@T{ Number of decimals in percentages T} \-E | \-\-exclude STARTUP@T{ diff --git a/src/tuptime b/src/tuptime index 8c0f3f3..79bf3be 100644 --- a/src/tuptime +++ b/src/tuptime @@ -73,7 +73,7 @@ def get_arguments(): help='datetime/timestamp format output' ) parser.add_argument( - '--dec', + '-e', '--dec', dest='dec', default=2, metavar='DECIMALS', diff --git a/tuptime-manual.txt b/tuptime-manual.txt index 43699bf..754b0ab 100644 --- a/tuptime-manual.txt +++ b/tuptime-manual.txt @@ -174,7 +174,7 @@ These are the command line options, no configuration file is used: -c, --csv csv output -d DATETIME_FMT, --date DATETIME_FMT datetime/timestamp format output - --dec DECIMALS + -e DECIMALS, --dec DECIMALS number of decimals in percentages -E, --exclude STARTUP startup numbers to exclude @@ -279,7 +279,7 @@ These are the command line options, no configuration file is used: tuptime -d '%H:%M:%S %d-%b-%Y' # Spanish style ---dec DECIMALS +-e DECIMALS, --dec DECIMALS Change the decimal length in percentages. The number is rounded to this value. Examples: From c67a0c8cc071e077812f268eed3f73ccaf195697 Mon Sep 17 00:00:00 2001 From: Ricardo F Date: Tue, 16 Aug 2022 20:53:24 +0200 Subject: [PATCH 5/7] Skip cron.d file in favour of systemd timer only for Debian --- debian/tuptime.cron.d | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 debian/tuptime.cron.d diff --git a/debian/tuptime.cron.d b/debian/tuptime.cron.d new file mode 100644 index 0000000..c1770d3 --- /dev/null +++ b/debian/tuptime.cron.d @@ -0,0 +1,10 @@ +# /etc/cron.d/tuptime: crontab entry for tuptime update. + +# NOTE: Decrease the execution time for increase accuracity. + + +# Skip in favour of systemd timer +[ ! -d /run/systemd/system ] || exit 0 + +*/5 * * * * _tuptime if [ -x /usr/bin/tuptime ]; then /usr/bin/tuptime -x > /dev/null; fi + From d4bf7edd0e5b53049fefc5d1e56ac5e5b045fcd6 Mon Sep 17 00:00:00 2001 From: Ricardo F Date: Wed, 17 Aug 2022 21:15:07 +0200 Subject: [PATCH 6/7] Fix cron.d execution on Debian --- debian/tuptime.cron.d | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/debian/tuptime.cron.d b/debian/tuptime.cron.d index c1770d3..49ff653 100644 --- a/debian/tuptime.cron.d +++ b/debian/tuptime.cron.d @@ -2,9 +2,7 @@ # NOTE: Decrease the execution time for increase accuracity. - # Skip in favour of systemd timer -[ ! -d /run/systemd/system ] || exit 0 -*/5 * * * * _tuptime if [ -x /usr/bin/tuptime ]; then /usr/bin/tuptime -x > /dev/null; fi +*/5 * * * * _tuptime if [ ! -d /run/systemd/system ] && [ -x /usr/bin/tuptime ]; then /usr/bin/tuptime -x > /dev/null; fi From e6c002062d8c97e04b5a6a4983c9bf99a4709524 Mon Sep 17 00:00:00 2001 From: Ricardo F Date: Fri, 19 Aug 2022 17:34:43 +0200 Subject: [PATCH 7/7] Update to 5.2.1 --- CHANGELOG | 9 +++++++++ debian/changelog | 9 +++++++++ misc/rpm/rpm-readme.txt | 6 +++--- misc/rpm/tuptime.spec | 5 ++++- src/man/tuptime.1 | 4 ++-- src/tuptime | 2 +- tuptime-manual.txt | 4 ++-- 7 files changed, 30 insertions(+), 9 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 895124a..2b21bd7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,12 @@ +tuptime (5.2.1) unstable; urgency=low + + * Set cron file with systemd execute exclusion on .deb package + * Return -e option as an argument for --dec decimals + * Update .deb package + * Update .rpm package + + -- Ricardo Fraile Fri, 19 Aug 2022 16:21:00 +0100 + tuptime (5.2.0) unstable; urgency=low * Rename timer units to tuptime-sync.timer and tuptime-sync.service diff --git a/debian/changelog b/debian/changelog index fc1a246..a5ec234 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +tuptime (5.2.1) unstable; urgency=low + + * Set cron file with systemd execute exclusion on .deb package + * Return -e option as an argument for --dec decimals + * Update .deb package + * Update .rpm package + + -- Ricardo Fraile Fri, 19 Aug 2022 16:21:00 +0100 + tuptime (5.2.0) unstable; urgency=low * Rename timer units to tuptime-sync.timer and tuptime-sync.service diff --git a/misc/rpm/rpm-readme.txt b/misc/rpm/rpm-readme.txt index 2d28834..081f972 100644 --- a/misc/rpm/rpm-readme.txt +++ b/misc/rpm/rpm-readme.txt @@ -41,9 +41,9 @@ Z.- For testing with "dev" branch. Install "git" on step "1" and replace step "2 dnf -y install git cd ~ - git clone -b dev --depth=1 https://github.com/rfrail3/tuptime.git tuptime-5.2.0 + git clone -b dev --depth=1 https://github.com/rfrail3/tuptime.git tuptime-5.2.1 rpmdev-setuptree cd ~/rpmbuild/SPECS/ - cp ../../tuptime-5.2.0/misc/rpm/tuptime.spec . - tar -czvf ../SOURCES/5.2.0.tar.gz ../../tuptime-5.2.0 + cp ../../tuptime-5.2.1/misc/rpm/tuptime.spec . + tar -czvf ../SOURCES/5.2.1.tar.gz ../../tuptime-5.2.1 rpmbuild -ba --target=noarch tuptime.spec diff --git a/misc/rpm/tuptime.spec b/misc/rpm/tuptime.spec index 7228880..13ba994 100644 --- a/misc/rpm/tuptime.spec +++ b/misc/rpm/tuptime.spec @@ -1,5 +1,5 @@ Name: tuptime -Version: 5.2.0 +Version: 5.2.1 Release: 1%{?dist} Summary: Report historical system real time @@ -102,6 +102,9 @@ su -s /bin/sh _tuptime -c "(umask 0022 && /usr/bin/tuptime -x)" %changelog +* Fri Aug 19 2022 Ricardo Fraile 5.2.1-1 +- New release + * Mon Aug 15 2022 Ricardo Fraile 5.2.0-1 - New release diff --git a/src/man/tuptime.1 b/src/man/tuptime.1 index 3242fa1..0a5fa2b 100644 --- a/src/man/tuptime.1 +++ b/src/man/tuptime.1 @@ -1,10 +1,10 @@ -.TH TUPTIME 1 "Aug 2022" "5.2.0" "Linux Manual" +.TH TUPTIME 1 "Aug 2022" "5.2.1" "Linux Manual" .SH NAME tuptime \- Report historical and statistical real time of the system, keeping it between restarts. Total uptime. .SH SYNOPSIS -tuptime [\-h] [\-A STARTUP] [\-b] [\-c] [\-d DATETIME_FMT] [\-\-dec DECIMALS] [\-E STARTUP] [\-f FILE] [\-g] [\-i] [\-k] [\-l] [\-n] [\-o TYPE] [\-p] [\-r] [\-s] [\-S STARTUP] [\-t] [\-\-tat TIMESTAMP] [\-\-tsince TIMESTAMP] [\-\-tuntil TIMESTAMP] [\-U STARTUP] [\-v] [\-V] [\-x] +tuptime [\-h] [\-A STARTUP] [\-b] [\-c] [\-d DATETIME_FMT] [\-e DECIMALS] [\-E STARTUP] [\-f FILE] [\-g] [\-i] [\-k] [\-l] [\-n] [\-o TYPE] [\-p] [\-r] [\-s] [\-S STARTUP] [\-t] [\-\-tat TIMESTAMP] [\-\-tsince TIMESTAMP] [\-\-tuntil TIMESTAMP] [\-U STARTUP] [\-v] [\-V] [\-x] .SH DESCRIPTION .RS diff --git a/src/tuptime b/src/tuptime index 79bf3be..f0d8889 100644 --- a/src/tuptime +++ b/src/tuptime @@ -24,7 +24,7 @@ from datetime import datetime DB_FILE = '/var/lib/tuptime/tuptime.db' DATETIME_FMT = '%X %x' -__version__ = '5.2.0' +__version__ = '5.2.1' # Terminate when SIGPIPE signal is received signal.signal(signal.SIGPIPE, signal.SIG_DFL) diff --git a/tuptime-manual.txt b/tuptime-manual.txt index 754b0ab..7b70e15 100644 --- a/tuptime-manual.txt +++ b/tuptime-manual.txt @@ -1,9 +1,9 @@ ---------------------- Tuptime Manual ---------------------- - version 5.2.0 + version 5.2.1 Ricardo F. - 02/Aug/2022 + 19/Aug/2022