aboutsummaryrefslogtreecommitdiff
path: root/compute-status-counts.awk
diff options
context:
space:
mode:
authorW. Kosior <koszko@koszko.org>2025-09-19 12:47:44 +0200
committerW. Kosior <koszko@koszko.org>2025-09-19 13:09:45 +0200
commit7000b1f2bb2fca5b7707c9b1a9f58f43100212d3 (patch)
treecc5531b93b8e76c39e3c58d52574f68e86c3f05e /compute-status-counts.awk
downloadAGH-msc-thesis-magister.tar.gz
AGH-msc-thesis-magister.zip
Initial commit.HEADmagister
Diffstat (limited to 'compute-status-counts.awk')
-rw-r--r--compute-status-counts.awk84
1 files changed, 84 insertions, 0 deletions
diff --git a/compute-status-counts.awk b/compute-status-counts.awk
new file mode 100644
index 0000000..a7da4c0
--- /dev/null
+++ b/compute-status-counts.awk
@@ -0,0 +1,84 @@
+## SPDX-License-Identifier: CC0-1.0
+##
+## Copyright (C) 2025 Woj. Kosior <koszko@koszko.org>
+
+// {
+ if (first_skipped) {
+ what = "???.";
+ }
+ first_skipped = 1;
+}
+
+## Ones to skip.
+
+/ST-experiment-limitation/ {
+ what = 0;
+}
+
+/ST-not-a-real-package/ {
+ what = 0;
+}
+
+## Ones to include for plotting.
+
+/ST-failure,FR-failed-to-checkout,/ {
+ what = "1,Failed to clone";
+}
+
+/ST-failure,FR-failed-to-checkout-revision-not-found/ {
+ what = "2,Git revision not found";
+}
+
+/ST-failure,FR-failed-to-resolve/ {
+ what = "3,Failed to resolve dependencies";
+}
+
+/ST-failure,FR-invalid-lockfile-supplied/ {
+ what = "4,Invalid upstream lockfile";
+}
+
+/ST-failure,FR-no-(package.json|build-script)/ {
+ what = "5,Conventions not followed";
+}
+
+/ST-failure,FR-expects-network/ {
+ what = "6,Expects network access";
+}
+
+/ST-failure,FR-needs-other-build-sys/ {
+ what = "7,Requires Yarn or pnpm";
+}
+
+/ST-failure,FR-has-deps-external-to-npm/ {
+ what = "8,Has dependencies outside npm";
+}
+
+/ST-failure,FR-misc-build-failure/ {
+ what = "9,Miscellaneous build failure";
+}
+
+/ST-built-once/ {
+ what = "10,Built only with upstream lockfile";
+}
+
+/ST-built-with-lockfiles-removed/ {
+ what = "11,Built with re-generated lockfile";
+}
+
+// {
+ if (what) {
+ counts[what]++;
+ }
+
+ if (what == "???.") {
+ print "##### " $0 > "/dev/stderr";
+ }
+}
+
+END {
+ print "ID,CATEGORY,COUNT";
+
+ for (key in counts) {
+ print key "," counts[key];
+ }
+}