diff options
| author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2025-02-18 15:14:57 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-18 15:14:57 -0500 |
| commit | 2ffd817603ecc713988fe2796c9562a857a92ef4 (patch) | |
| tree | 9a5e26fe0b3bc2e17019567eb45c3bfe254a6798 /src/cli/stasis_indexer/helpers.c | |
| parent | ff2ce71b7f860d9af4bccb8041ecf1f6c66eb535 (diff) | |
| parent | 2670a59ccbad947df72815d057d3b047cccb69df (diff) | |
| download | stasis-2ffd817603ecc713988fe2796c9562a857a92ef4.tar.gz | |
Merge pull request #98 from jhunkeler/indexer-minor-fixups
Indexer minor fixups
Diffstat (limited to 'src/cli/stasis_indexer/helpers.c')
| -rw-r--r-- | src/cli/stasis_indexer/helpers.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/cli/stasis_indexer/helpers.c b/src/cli/stasis_indexer/helpers.c index e337787..76d50f9 100644 --- a/src/cli/stasis_indexer/helpers.c +++ b/src/cli/stasis_indexer/helpers.c @@ -192,11 +192,26 @@ int sort_by_latest_rc(const void *a, const void *b) { const struct Delivery *bb = b; if (aa->meta.rc > bb->meta.rc) { return -1; + } else if (aa->meta.rc < bb->meta.rc) { + return 1; } - if (aa->meta.rc < bb->meta.rc) { + + if (strcmp(aa->system.platform[DELIVERY_PLATFORM_RELEASE], bb->system.platform[DELIVERY_PLATFORM_RELEASE]) > 0) { return 1; + } else if (strcmp(aa->system.platform[DELIVERY_PLATFORM_RELEASE], bb->system.platform[DELIVERY_PLATFORM_RELEASE]) < 0) { + return -1; + } + + char *err = NULL; + unsigned pyc_a = strtoul(aa->meta.python_compact, &err, 10); + unsigned pyc_b = strtoul(bb->meta.python_compact, &err, 10); + if (pyc_a > pyc_b) { + return -1; + } else if (pyc_b < pyc_a) { + return 1; + } else { + return 0; } - return 0; } struct Delivery *get_latest_deliveries(struct Delivery ctx[], size_t nelem) { |
