xbps-checkvers: simplify print logic

This commit is contained in:
Duncaen 2019-06-13 13:28:48 +02:00 committed by Duncan Overbruck
parent abdd1047eb
commit 597c0119dd

View File

@ -615,26 +615,20 @@ rcv_check_version(rcv_t *rcv)
xbps_dictionary_get_cstring_nocopy(rcv->pkgd, "pkgver", &repover); xbps_dictionary_get_cstring_nocopy(rcv->pkgd, "pkgver", &repover);
if (!repover && rcv->manual) { if (!repover && rcv->manual)
printf("%.*s ? %s\n", ;
(int)pkgname.v.len, pkgname.v.s, srcver+pkgname.v.len+1); else if (rcv->show_all)
} else if (repover && !rcv->show_all) { ;
if (xbps_cmpver(repover+pkgname.v.len+1, else if (repover && (xbps_cmpver(repover+pkgname.v.len+1,
srcver+pkgname.v.len+1) < 0 || srcver+pkgname.v.len+1) < 0 ||
check_reverts(repover+pkgname.v.len+1, reverts)) { check_reverts(repover+pkgname.v.len+1, reverts)))
printf("%.*s %s %s\n", ;
(int)pkgname.v.len, pkgname.v.s, else
repover+pkgname.v.len+1, return 0;
srcver+pkgname.v.len+1);
}
} else if (rcv->show_all) {
const char *p = NULL;
if (repover == NULL)
p = "?";
printf("%.*s %s %s\n", (int)pkgname.v.len, pkgname.v.s, repover = repover ? repover+pkgname.v.len+1 : "?";
p ? p : repover+pkgname.v.len+1, srcver+pkgname.v.len+1); printf("%.*s %s %s\n", (int)pkgname.v.len, pkgname.v.s, repover,
} srcver+pkgname.v.len+1);
return 0; return 0;
} }