Skip to content

Commit 8d8b34b

Browse files
committed
Lets use claude to help us keep packages up to date
1 parent a4f3057 commit 8d8b34b

4 files changed

Lines changed: 201 additions & 12 deletions

File tree

.github/workflows/check-package-versions.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313
permissions:
1414
contents: write
1515
pull-requests: write
16+
issues: write
17+
id-token: write
1618

1719
jobs:
1820
collect-updates:
@@ -409,6 +411,7 @@ jobs:
409411
410412
- name: Create Pull Request
411413
if: steps.existing-pr.outputs.exists != 'true'
414+
id: create-pr
412415
uses: peter-evans/create-pull-request@v8
413416
with:
414417
token: ${{ secrets.GITHUB_TOKEN }}
@@ -420,3 +423,44 @@ jobs:
420423
labels: |
421424
dependencies
422425
package-update
426+
author: "Claude <claude@anthropic.com>"
427+
committer: "Claude <claude@anthropic.com>"
428+
429+
- name: Analyze and update specs with Claude
430+
if: steps.existing-pr.outputs.exists != 'true' && steps.create-pr.outputs.pull-request-number
431+
uses: anthropics/claude-code-action@v1
432+
with:
433+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
434+
prompt: |
435+
I need you to analyze and update RPM spec files for package version upgrades.
436+
437+
The following packages were updated (version bumps already applied to spec files):
438+
${{ toJson(matrix.group.packages) }}
439+
440+
For each package, please:
441+
442+
1. Fetch the upstream build configuration files to check for dependency changes:
443+
- CMakeLists.txt or meson.build for C/C++ projects (Hyprland ecosystem)
444+
- Cargo.toml for Rust projects (eza, starship, wifitui)
445+
- go.mod for Go projects (lazygit)
446+
- setup.py or pyproject.toml for Python projects (uwsm)
447+
448+
2. Compare the dependencies in the upstream build files against the current spec file's BuildRequires and Requires sections.
449+
450+
3. Check if any shared library soname versions have changed (e.g., libfoo.so.3 -> libfoo.so.4) by looking at:
451+
- CMake's set_target_properties for SOVERSION
452+
- The %files section of the spec for current soname expectations
453+
454+
4. Update the spec file if needed:
455+
- Add/remove/update BuildRequires for new build dependencies
456+
- Add/remove/update Requires for new runtime dependencies
457+
- Update soname versions in %files section if the library major version changed
458+
- Update any hardcoded paths or version references
459+
460+
5. If you make changes, update the changelog entry to mention what changed beyond just the version bump.
461+
462+
The spec files are located at: packages/<package-name>/<package-name>.spec
463+
464+
Focus on correctness - it's better to flag something for manual review than to make an incorrect change.
465+
If you're uncertain about a change, add a comment in the PR explaining what might need manual verification.
466+
claude_args: "--max-turns 10"

.github/workflows/claude-test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,14 @@ jobs:
2525
uses: actions/checkout@v6
2626

2727
- name: Test Claude Code Action
28+
id: claude
2829
uses: anthropics/claude-code-action@v1
2930
with:
3031
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
3132
prompt: ${{ inputs.prompt }}
3233
claude_args: "--max-turns 3"
33-
timeout_minutes: 5
34+
35+
- name: Test complete
36+
run: |
37+
echo "Claude test completed successfully"
38+
echo "Claude response received"

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,25 +140,27 @@ systemctl reboot
140140

141141
### Resetting Configuration
142142

143-
Hypercube ships default configurations in `/usr/share/hypercube/config/`. If you've modified your `~/.config/` files and want to reset to defaults:
143+
Hypercube ships default configurations in `/usr/share/hypercube/config/`. Use the built-in commands to safely reset configs (your existing configs are backed up automatically):
144144

145145
```bash
146+
# List available configs
147+
ujust config-list
148+
146149
# Reset a specific app's config (e.g., hyprland)
147-
rm -rf ~/.config/hypr
148-
cp -r /usr/share/hypercube/config/hypr ~/.config/
150+
ujust config-reset hypr
149151

150-
# Or reset all Hypercube configs
151-
rm -rf ~/.config/{hypr,fish,starship.toml,ghostty,nvim}
152-
cp -r /usr/share/hypercube/config/* ~/.config/
153-
```
152+
# Reset all Hypercube configs
153+
ujust config-reset
154154

155-
To see what the default configuration looks like without overwriting your files:
155+
# See differences between your config and defaults
156+
ujust config-diff hypr
156157

157-
```bash
158-
ls /usr/share/hypercube/config/
159-
diff -r ~/.config/hypr /usr/share/hypercube/config/hypr
158+
# See all differences
159+
ujust config-diff
160160
```
161161

162+
Backups are saved to `~/.config/hypercube-backup-<timestamp>/`.
163+
162164
## What's Included
163165

164166
### Packages

system_files/shared/usr/share/ublue-os/just/60-hypercube.just

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,144 @@
11
# vim: set ft=make :
22
# Hypercube general commands
33

4+
# Reset Hypercube configs to defaults (backs up existing configs first)
5+
config-reset APP="all":
6+
#!/usr/bin/bash
7+
set -euo pipefail
8+
9+
SOURCE_DIR="/usr/share/hypercube/config"
10+
BACKUP_DIR="$HOME/.config/hypercube-backup-$(date +%Y%m%d-%H%M%S)"
11+
12+
# Map app names to config directories/files
13+
declare -A CONFIG_MAP
14+
CONFIG_MAP[hypr]="hypr"
15+
CONFIG_MAP[fish]="fish"
16+
CONFIG_MAP[ghostty]="ghostty"
17+
CONFIG_MAP[nvim]="nvim"
18+
CONFIG_MAP[starship]="starship/starship.toml"
19+
CONFIG_MAP[quickshell]="quickshell"
20+
21+
reset_config() {
22+
local app="$1"
23+
local config_path="${CONFIG_MAP[$app]}"
24+
25+
if [[ -z "$config_path" ]]; then
26+
echo "Unknown app: $app"
27+
echo "Available: ${!CONFIG_MAP[*]}"
28+
return 1
29+
fi
30+
31+
local src="$SOURCE_DIR/$config_path"
32+
local dest="$HOME/.config/$config_path"
33+
34+
if [[ ! -e "$src" ]]; then
35+
echo "Source config not found: $src"
36+
return 1
37+
fi
38+
39+
# Backup existing config if it exists
40+
if [[ -e "$dest" ]]; then
41+
mkdir -p "$BACKUP_DIR"
42+
echo "Backing up $dest -> $BACKUP_DIR/$config_path"
43+
cp -r "$dest" "$BACKUP_DIR/$config_path"
44+
fi
45+
46+
# Copy new config
47+
echo "Resetting $app config..."
48+
mkdir -p "$(dirname "$dest")"
49+
rm -rf "$dest"
50+
cp -r "$src" "$dest"
51+
echo " Done!"
52+
}
53+
54+
if [[ "{{ APP }}" == "all" ]]; then
55+
echo "Resetting all Hypercube configs..."
56+
echo "Backups will be saved to: $BACKUP_DIR"
57+
echo ""
58+
for app in "${!CONFIG_MAP[@]}"; do
59+
reset_config "$app"
60+
done
61+
echo ""
62+
echo "All configs reset! Backups saved to: $BACKUP_DIR"
63+
else
64+
reset_config "{{ APP }}"
65+
if [[ -d "$BACKUP_DIR" ]]; then
66+
echo ""
67+
echo "Backup saved to: $BACKUP_DIR"
68+
fi
69+
fi
70+
71+
# Show differences between current and default configs
72+
config-diff APP="all":
73+
#!/usr/bin/bash
74+
set -euo pipefail
75+
76+
SOURCE_DIR="/usr/share/hypercube/config"
77+
78+
declare -A CONFIG_MAP
79+
CONFIG_MAP[hypr]="hypr"
80+
CONFIG_MAP[fish]="fish"
81+
CONFIG_MAP[ghostty]="ghostty"
82+
CONFIG_MAP[nvim]="nvim"
83+
CONFIG_MAP[starship]="starship/starship.toml"
84+
CONFIG_MAP[quickshell]="quickshell"
85+
86+
diff_config() {
87+
local app="$1"
88+
local config_path="${CONFIG_MAP[$app]}"
89+
90+
if [[ -z "$config_path" ]]; then
91+
echo "Unknown app: $app"
92+
echo "Available: ${!CONFIG_MAP[*]}"
93+
return 1
94+
fi
95+
96+
local src="$SOURCE_DIR/$config_path"
97+
local dest="$HOME/.config/$config_path"
98+
99+
echo "=== $app ==="
100+
if [[ ! -e "$dest" ]]; then
101+
echo " (not installed - would copy from defaults)"
102+
elif [[ ! -e "$src" ]]; then
103+
echo " (no default config found)"
104+
else
105+
if diff -rq "$src" "$dest" > /dev/null 2>&1; then
106+
echo " (no differences)"
107+
else
108+
diff -r --color=auto "$src" "$dest" 2>/dev/null || true
109+
fi
110+
fi
111+
echo ""
112+
}
113+
114+
if [[ "{{ APP }}" == "all" ]]; then
115+
echo "Comparing configs: ~/.config vs /usr/share/hypercube/config"
116+
echo ""
117+
for app in "${!CONFIG_MAP[@]}"; do
118+
diff_config "$app"
119+
done
120+
else
121+
diff_config "{{ APP }}"
122+
fi
123+
124+
# List available default configs
125+
config-list:
126+
#!/usr/bin/bash
127+
echo "Available Hypercube configs:"
128+
echo ""
129+
echo " hypr - Hyprland window manager"
130+
echo " fish - Fish shell"
131+
echo " ghostty - Ghostty terminal"
132+
echo " nvim - Neovim editor"
133+
echo " starship - Starship prompt"
134+
echo " quickshell - Quickshell bar/launcher"
135+
echo ""
136+
echo "Usage:"
137+
echo " ujust config-reset # Reset all configs"
138+
echo " ujust config-reset hypr # Reset specific config"
139+
echo " ujust config-diff # Show all differences"
140+
echo " ujust config-diff hypr # Show specific differences"
141+
4142
# Show Hypercube developer environment status
5143
dx-status:
6144
#!/usr/bin/bash

0 commit comments

Comments
 (0)