diff options
author | W. Kosior <koszko@koszko.org> | 2025-09-19 12:47:44 +0200 |
---|---|---|
committer | W. Kosior <koszko@koszko.org> | 2025-09-19 13:09:45 +0200 |
commit | 7000b1f2bb2fca5b7707c9b1a9f58f43100212d3 (patch) | |
tree | cc5531b93b8e76c39e3c58d52574f68e86c3f05e /compute-unflattened-multiver-counts.sh | |
download | AGH-msc-thesis-magister.tar.gz AGH-msc-thesis-magister.zip |
Diffstat (limited to 'compute-unflattened-multiver-counts.sh')
-rwxr-xr-x | compute-unflattened-multiver-counts.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/compute-unflattened-multiver-counts.sh b/compute-unflattened-multiver-counts.sh new file mode 100755 index 0000000..03b253a --- /dev/null +++ b/compute-unflattened-multiver-counts.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +## SPDX-License-Identifier: CC0-1.0 +## +## Copyright (C) 2025 Woj. Kosior <koszko@koszko.org> + +set -e + +TREE_SIZES_PATH="$1" + +if [ "$2" = "--omit-packages-with-breaking-changes" ]; then + BAD_ROW_REG=',1$' +else + BAD_ROW_REG=',$' # never matched +fi + +printf 'MULTIVER-COUNT,' +printf 'ALL-PACKAGES,IN-DEBIAN-PACKAGES,' +printf 'ALL-PACKAGES-NO-BC,IN-DEBIAN-PACKAGES-NO-BC\n' + +./helper.sh --get-csv-columns "$TREE_SIZES_PATH" \ + IN-DEBIAN TREE-FLAT-MULTIVER BREAKING-CHANGES | + grep -vE "$BAD_ROW_REG" | awk -F , ' + /^[0-9]/ { + counts[$2]++; + if ($1 > 0) { + debian_counts[$2]++; + } + } + END { + for (key in counts) { + printf "%d,%d,%d\n", key, counts[key], debian_counts[key]; + } + } + ' |