@dmnks commented on this pull request.


> +    int downgrade = 0;
+    rpmver av = rpmverParse(rpmteEVR(a));
+    rpmver bv = rpmverParse(rpmteEVR(b));
+
+    if (av && bv && rpmverCmp(av, bv) < 0)
+       downgrade = 1;
+
+    rpmverFree(av);
+    rpmverFree(bv);
+    return downgrade;
+}
+
+static char *getOp(rpmts ts, rpmte te)
+{
+    char *ret = NULL;
+    char *note = NULL;

This `note` variable looks like a remnant of some older WIP version as it's not 
used anywhere 😄 

> +     } else {
+           op = "erase";
+       }
+       break;
+    case TR_RPMDB:
+       /* not an operation */
+       break;
+    case TR_RESTORED:
+       op = "restore";
+       break;
+    default:
+       op = "<unknown>";
+       break;
+    }
+
+    if (op && ret == NULL) {

Another leftover, I guess: `ret` is always `NULL` here.

>  {
+    rpmte dep = NULL;
+
+    if (rpmteDependsOn(te) == NULL) {

Isn't this outer check redundant? It seems like a `TR_ADDED` element never has 
the `depends` member set...

> +The package level output during transactions is as follows:
+
+_OPERATION_ _NEVRA_ [*(from:* _RELNEVRA_*)*]
+
+_OPERATION_ is one of:
+- *cleanup*: cleanup of the previous version in *upgrade* or *downgrade*
+- *downgrade*: downgrade an installed package to an older version
+- *erase*: erase package from the system
+- *install*: install a new package on the system
+- *replace*: replace a previously installed package with another one
+- *restore*: restore permissions and similar on an installed package
+- *upgrade*: upgrade an installed package to a newer version
+
+_NEVRA_ is the package identifier. Operations *downgrade*, *replace* and
+*upgrade* consist of two parts: install of one package and removal of
+another. In these cases, the second package identifier _RELNEVRA_ is

I'd mention "related" here, somewhere, to make `RELNEVRA` meaningful. 
Alternatively, a different placeholder could be used, but `RELNEVRA` is short 
and simple (the other alternatives that come to mind would be a bit awkward, 
like `FROMNEVRA` or `ORIGNEVRA`, and underscores would be annoying) 😄 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/4215#pullrequestreview-4357595618
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/4215/review/[email protected]>
_______________________________________________
Rpm-maint mailing list
[email protected]
https://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to