Skip to content

Commit

Permalink
us.cpp: skip notices with version.revision less than our running version
Browse files Browse the repository at this point in the history
  • Loading branch information
ehb54 committed Jan 11, 2024
1 parent aeed753 commit 750cc53
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions programs/us/us.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -974,11 +974,24 @@ qDebug() << " n_dif" << n_dif << "time_d" << time_d << "pn_time" << pn_time;

bool empty_msg = true;

double sys_version = US_Version.toDouble();
int sys_revision = QString( REVISION ).toInt();

for ( int ii = 0; ii < nnotice; ii++ )
{
// Skip messages for warn/crit same revision or any earlier than current
if ( ( irevs[ ii ] == s_rev && types[ ii ] != "info" ) ||
irevs[ ii ] < s_rev ) continue;
double msg_version = QString( "%1" ).arg( revs[ii] ).replace( QRegularExpression( "\\.\\d+$" ), "" ).toDouble();
double msg_revision = QString( "%1" ).arg( revs[ii] ).replace( QRegularExpression( "^[^\\.]*\\.\\d+\\." ), "" ).toDouble();

// // Skip messages for warn/crit same revision or any earlier than current
// if ( ( irevs[ ii ] == s_rev && types[ ii ] != "info" ) ||
// irevs[ ii ] < s_rev ) continue;

// Skip messages where message version.revision is less than our version.revision
if ( sys_version > msg_version ||
( sys_version == msg_version &&
sys_revision > msg_revision ) ) {
continue;
}

// Add current message to full text
msg_note += typeMap[ types[ ii ] ] + " for release "
Expand Down

0 comments on commit 750cc53

Please sign in to comment.