Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@ All notable changes to GRPM will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.9.3] - 2026-01-20

### Install Helper Path Resolution & Unpack Phase Fix

Hotfix for packages with non-standard archive names and relative paths in install helpers.

### Fixed
- **Install helpers path resolution** — All install helpers (dobin, dosbin, doins, etc.) now correctly resolve relative paths against `$S` (source directory)
- **Unpack phase uses $A variable** — `phaseUnpack()` now uses the `$A` variable from Manifest instead of hardcoded `${PN}-${PV}.tar.*` pattern
- **tree package fix** — `app-text/tree` now builds successfully (archive is `unix-tree-2.2.1.tar.bz2`, not `tree-2.2.1.tar.*`)

### Changed
- **Centralized path resolution** — Added `resolveSourcePath()` helper method following DRY principle
- **Updated helpers**: `Dobin`, `Dosbin`, `Newbin`, `Newsbin`, `Doexe`, `Doins`, `Newins`, `Dolib`, `DolibSo`, `DolibA`, `Doheader`, `Doinitd`

### Technical Details
The fix addresses two issues:
1. **Archive naming**: Some packages use non-standard archive names (e.g., `unix-tree-*.tar.bz2` instead of `tree-*.tar.*`)
2. **Relative paths**: Install helpers like `dobin tree` expected files relative to `$S`, but Go's `os.Stat()` looked in current directory

---

## [0.9.2] - 2026-01-19

### Emerge Installed Package Filtering
Expand Down
25 changes: 21 additions & 4 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# GRPM Roadmap

> **Pre-Release Testing (v0.9.1)**
> **Pre-Release Testing (v0.9.3)**
>
> Rapid development complete (v0.1.0 → v0.5.0).
> Infrastructure release complete (v0.6.0).
> Build quality and security fixes (v0.7.x).
> Configuration management (v0.8.0-v0.8.4).
> Enterprise tool handling (v0.9.0).
> **Enterprise CLI & Mirror Fallback (v0.9.1).**
> Enterprise tool handling (v0.9.0-v0.9.1).
> Emerge filtering fix (v0.9.2).
> **Install helper path resolution hotfix (v0.9.3).**
> **98.2% tree coverage verified on real Gentoo WSL2!**

---
Expand Down Expand Up @@ -69,7 +70,23 @@ Key insight: **Eclasses don't need Go implementations.** They are loaded dynamic

## Release History

### v0.9.1 — Enterprise CLI & Mirror Fallback (Current)
### v0.9.3 — Install Helper Path Resolution Hotfix (Current)

**Hotfix for packages with non-standard archive names and relative paths:**

- **Install helpers path resolution** — All install helpers now resolve relative paths against `$S`
- **Unpack phase uses $A** — Archive list from Manifest instead of hardcoded pattern
- **tree package fix** — `app-text/tree` now builds successfully
- **DRY refactoring** — Centralized `resolveSourcePath()` helper method

### v0.9.2 — Emerge Filtering Fix

**Fixes emerge ignoring installed packages:**

- **Emerge respects VarDB** — `grpm emerge -p mc` shows 1 package instead of 93
- **New flags**: `--deep`, `--with-bdeps`, `--emptytree`, `--vardb`

### v0.9.1 — Enterprise CLI & Mirror Fallback

**Major CLI improvements and distfile fetching enhancements:**

Expand Down
2 changes: 1 addition & 1 deletion docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This guide covers installation of GRPM on Gentoo Linux and compatible distributi

```bash
# Set version and architecture
VERSION="0.1.0"
VERSION="0.9.3"
ARCH="amd64" # Options: amd64, arm64, arm_7, arm_6, 386

# Download binary
Expand Down
16 changes: 14 additions & 2 deletions docs/PMS_COMPLIANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

> **GRPM Implementation Status per [Package Manager Specification](https://projects.gentoo.org/pms/)**
>
> **Version:** v0.9.1
> **Last Updated:** 2026-01-19
> **Version:** v0.9.3
> **Last Updated:** 2026-01-20
> **License:** This document follows PMS under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)

---
Expand Down Expand Up @@ -605,6 +605,18 @@ EAPI 7+ cross-compilation variables (SYSROOT, ESYSROOT, BROOT) are defined but n
- [x] "Did you mean?" command suggestions
- [x] Type-safe CommandName constants

### v0.9.2 (Complete)

- [x] Emerge respects installed packages (VarDB filtering)
- [x] `--deep`, `--with-bdeps`, `--emptytree`, `--vardb` flags for emerge

### v0.9.3 (Complete)

- [x] Install helpers path resolution — All helpers resolve relative paths against `$S`
- [x] Unpack phase uses `$A` variable — Archive list from Manifest instead of hardcoded pattern
- [x] tree package fix — Packages with non-standard archive names now build correctly
- [x] DRY refactoring — Centralized `resolveSourcePath()` helper method

### v0.9.x (Planned)

- [ ] `package.provided` support
Expand Down
22 changes: 10 additions & 12 deletions internal/cli/atom_parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ import (
"github.com/grpmsoft/grpm/internal/repo"
)

// TestParsePackageAtom tests the parsePackageAtom function which extracts
// TestParsePackageAtom tests the pkg.ParseAtom function which extracts
// category/package from various PMS-compliant atom formats.
//
// This is critical for Issue #45: The function was returning versioned atoms
// (sys-devel/gcc-13.4.1_p20250807) instead of category/package (sys-devel/gcc),
// causing Manifest path construction to fail.
func TestParsePackageAtom(t *testing.T) {
app := &App{}

tests := []struct {
name string
atom string
Expand Down Expand Up @@ -134,22 +132,23 @@ func TestParsePackageAtom(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := app.parsePackageAtom(tt.atom)
parsed, err := pkg.ParseAtom(tt.atom)

if tt.wantErr {
if err == nil {
t.Errorf("parsePackageAtom(%q) expected error containing %q, got nil", tt.atom, tt.errMatch)
t.Errorf("ParseAtom(%q) expected error containing %q, got nil", tt.atom, tt.errMatch)
}
return
}

if err != nil {
t.Errorf("parsePackageAtom(%q) unexpected error: %v", tt.atom, err)
t.Errorf("ParseAtom(%q) unexpected error: %v", tt.atom, err)
return
}

got := parsed.CP()
if got != tt.wantCP {
t.Errorf("parsePackageAtom(%q) = %q, want %q", tt.atom, got, tt.wantCP)
t.Errorf("ParseAtom(%q).CP() = %q, want %q", tt.atom, got, tt.wantCP)
}
})
}
Expand Down Expand Up @@ -291,8 +290,6 @@ KEYWORDS="amd64"
// 1. Wrong Manifest path: /var/db/repos/gentoo/sys-devel/gcc-13.4.1_p20250807/Manifest
// 2. Wrong SRC_URI parsing
func TestAtomParsingRegression_Issue45(t *testing.T) {
app := &App{}

// These are the exact atoms from Issue #45
problematicAtoms := []struct {
atom string
Expand All @@ -305,13 +302,14 @@ func TestAtomParsingRegression_Issue45(t *testing.T) {

for _, tc := range problematicAtoms {
t.Run(tc.atom, func(t *testing.T) {
cp, err := app.parsePackageAtom(tc.atom)
parsed, err := pkg.ParseAtom(tc.atom)
if err != nil {
t.Fatalf("parsePackageAtom(%q) failed: %v", tc.atom, err)
t.Fatalf("ParseAtom(%q) failed: %v", tc.atom, err)
}

cp := parsed.CP()
if cp != tc.expectedCP {
t.Errorf("parsePackageAtom(%q) = %q, want %q\n"+
t.Errorf("ParseAtom(%q).CP() = %q, want %q\n"+
"This would cause Manifest path: .../%s/Manifest (WRONG)\n"+
"Instead of: .../%s/Manifest (CORRECT)",
tc.atom, cp, tc.expectedCP, cp, tc.expectedCP)
Expand Down
Loading
Loading