# deguivlad/r2 architecture

> Architecture diagram of the GitHub repository deguivlad/r2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/deguivlad/r2
- Repository: https://github.com/deguivlad/r2

## Overview

This repository provides two standalone ROS 2 workspace utilities: one selects and builds packages, and the other removes matching packages and related artifacts. The graph separates their documented stages and external tools. No source excerpts were available, so relationships are limited to behavior explicitly described in the README.

Main entry points: [`r2rm`](https://github.com/deguivlad/r2/blob/main/r2rm) (Removal utility), [`r2pkgb`](https://github.com/deguivlad/r2/blob/main/r2pkgb) (Build utility)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_build["Package building"]
  node_build_script["Build utility"]
  node_package_discovery["Package discovery"]
  node_package_selection["Package selection"]
  node_colcon["Colcon"]
  node_workspace_environment["Workspace environment"]
end

subgraph group_remove["Package removal"]
  node_remove_script["Removal utility"]
  node_removal_discovery["Package discovery"]
  node_pattern_matching["Pattern matching"]
  node_workspace_packages[("Workspace packages")]
  node_workspace_artifacts[("Build install logs")]
  node_apt_packages[("APT packages")]
end

node_user(("Shell user"))

node_user -->|"runs"| node_build_script
node_build_script -->|"searches"| node_package_discovery
node_package_discovery -->|"resolves names"| node_package_selection
node_package_selection -->|"builds selected"| node_colcon
node_build_script -->|"sources after build"| node_workspace_environment
node_user -->|"runs"| node_remove_script
node_remove_script -->|"finds packages"| node_removal_discovery
node_removal_discovery -->|"matches names"| node_pattern_matching
node_remove_script -->|"removes matches"| node_workspace_packages
node_remove_script -->|"cleans related"| node_workspace_artifacts
node_remove_script -.->|"optionally removes"| node_apt_packages
node_remove_script -.->|"optionally rebuilds"| node_colcon

click node_build_script "https://github.com/deguivlad/r2/blob/main/r2pkgb"
click node_package_discovery "https://github.com/deguivlad/r2/blob/main/r2pkgb"
click node_package_selection "https://github.com/deguivlad/r2/blob/main/r2pkgb"
click node_remove_script "https://github.com/deguivlad/r2/blob/main/r2rm"
click node_removal_discovery "https://github.com/deguivlad/r2/blob/main/r2rm"
click node_pattern_matching "https://github.com/deguivlad/r2/blob/main/r2rm"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_build_script,node_package_discovery,node_package_selection,node_colcon,node_workspace_environment,node_user toneBlue
class node_remove_script,node_removal_discovery,node_pattern_matching,node_workspace_packages,node_workspace_artifacts,node_apt_packages toneAmber
```

## Components

### Package building

- [Build utility](https://github.com/deguivlad/r2/blob/main/r2pkgb): `r2pkgb`
- [Package discovery](https://github.com/deguivlad/r2/blob/main/r2pkgb): `r2pkgb`
- [Package selection](https://github.com/deguivlad/r2/blob/main/r2pkgb): `r2pkgb`
- **Colcon**
- **Workspace environment**

### Package removal

- [Removal utility](https://github.com/deguivlad/r2/blob/main/r2rm): `r2rm`
- [Package discovery](https://github.com/deguivlad/r2/blob/main/r2rm): `r2rm`
- [Pattern matching](https://github.com/deguivlad/r2/blob/main/r2rm): `r2rm`
- **Workspace packages**
- **Build install logs**
- **APT packages**

### Other components

- **Shell user**

## Connections

- Shell user → Build utility: runs (evidence: `README.md`)
- Build utility → Package discovery: searches (evidence: `README.md`)
- Package discovery → Package selection: resolves names (evidence: `README.md`)
- Package selection → Colcon: builds selected (evidence: `README.md`)
- Build utility → Workspace environment: sources after build (evidence: `README.md`)
- Shell user → Removal utility: runs (evidence: `README.md`)
- Removal utility → Package discovery: finds packages (evidence: `README.md`)
- Package discovery → Pattern matching: matches names (evidence: `README.md`)
- Removal utility → Workspace packages: removes matches (evidence: `README.md`)
- Removal utility → Build install logs: cleans related (evidence: `README.md`)
- Removal utility → APT packages: optionally removes (evidence: `README.md`)
- Removal utility → Colcon: optionally rebuilds (evidence: `README.md`)
