Skip to content

Commit

Permalink
Version highlight only for major/minor version
Browse files Browse the repository at this point in the history
  • Loading branch information
long-walk committed Feb 4, 2024
1 parent bef48a8 commit 9025a64
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions include/libdnf5-cli/output/transaction_table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -548,15 +548,6 @@ bool print_transaction_table(Transaction & transaction) {
}
}

// highlight incoming packages with epoch/version change
if (tspkg.get_package().get_epoch() != replaced.get_epoch() ||
tspkg.get_package().get_version() != replaced.get_version()) {
scols_cell_set_color(scols_line_get_cell(ln, COL_EVR), "lightblue");
if (termwidth < single_line_min) {
scols_cell_set_color(scols_line_get_cell(ln_pre, COL_EVR), "lightblue");
}
}

// print SIZE, filter changes on small package, bigger pakages need 10% of size change
double long difference =
abs((double long)100 - ((double long)100 / (double long)pkg.get_install_size() *
Expand Down Expand Up @@ -587,6 +578,18 @@ bool print_transaction_table(Transaction & transaction) {
}
}

// highlight incoming packages with epoch, major/minor version change
std::string tmpver = tspkg.get_package().get_version();
std::string tmprepver = replaced.get_version();
std::string version = tmpver.substr(0, tmpver.find_first_of(".-", tmpver.find('.') + 1));
std::string rep_version = tmprepver.substr(0, tmprepver.find_first_of(".-", tmprepver.find('.') + 1));
if (tspkg.get_package().get_epoch() != replaced.get_epoch() || version != rep_version) {
scols_cell_set_color(scols_line_get_cell(ln, COL_EVR), "lightblue");
if (termwidth < single_line_min) {
scols_cell_set_color(scols_line_get_cell(ln_pre, COL_EVR), "lightblue");
}
}

// print Version
if (pkg.get_name() == replaced.get_name()) {
if (termwidth < single_line_min) {
Expand Down

0 comments on commit 9025a64

Please sign in to comment.