Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
df532f7
feat: support bin packages parsing
upils May 27, 2026
f3a58a6
fix: correct style fix
upils May 27, 2026
daf5a71
fix: lint
upils May 27, 2026
633b0e1
ci: rerun
upils May 28, 2026
6fd3d1c
fix: fully qualified slice names
upils May 29, 2026
b68da53
style: rename to avoid confusion
upils Jun 1, 2026
8494876
fix: start renaming to realname
upils Jun 2, 2026
510d4cd
fix: more renaming/refactoring
upils Jun 2, 2026
2eb88e0
fix: more renaming
upils Jun 2, 2026
74ee585
fix: improve name displayed
upils Jun 2, 2026
3cab6a3
fix: refine naming
upils Jun 2, 2026
d86b9f9
fix: add missing check on format
upils Jun 2, 2026
1cda0ff
fix: remove pkgDefaultPrefix
upils Jun 2, 2026
267c6a3
fix: consistent use of pkg.RealName
upils Jun 2, 2026
619e0ec
fix: more name tweaking
upils Jun 2, 2026
952e929
fix: correct involontary lint fixes
upils Jun 2, 2026
fb4d6e5
fix: revert accidental linting fixes
upils Jun 15, 2026
ffc5aaf
style: harmonize names
upils Jun 15, 2026
d214000
feat: revert approach
upils Jun 16, 2026
8e8aef0
refactor: more cleaning
upils Jun 16, 2026
e7357d3
fix: review
upils Jun 16, 2026
27e2709
fix: ensure store is defined when parsing
upils Jun 17, 2026
6d19749
fix: properly fill returned pkgs when searching
upils Jun 17, 2026
824c002
style: lint
upils Jun 17, 2026
7358c94
fix: filter store pkgs out of the selection for now
upils Jun 17, 2026
be67dbd
fix: check store kind is known
upils Jun 17, 2026
22050d4
fix: use bin value for kind in tests
upils Jun 17, 2026
2e69156
style: add missing period
upils Jun 17, 2026
ed9e923
fix: review
upils Jun 19, 2026
65771cb
tests: integrate v3 tests to common table
upils Jun 19, 2026
d929e92
fix: check store kind when slices used
upils Jun 19, 2026
867fcff
docs: clarify reason for temp arch filling
upils Jun 19, 2026
33fc4ca
fix: apply review comments
upils Jun 22, 2026
c2be41a
fx: clearly fail if store packages are found for now
upils Jun 22, 2026
a816047
fix: remove wrong field
upils Jun 22, 2026
9d86eba
style: lint error
upils Jun 24, 2026
2c7d66f
ci: rerun
upils Jun 30, 2026
643a52f
feat: draft accessing bin store
upils Jun 19, 2026
46a353a
fix: adjust naming
upils Jun 19, 2026
dac1ec7
style: linting errors
upils Jun 19, 2026
97bfd5b
feat: refining
upils Jun 22, 2026
88d0cc3
fix: open all stores
upils Jun 22, 2026
bbea434
fix: reapply
upils Jun 22, 2026
0f2a6a2
feat: wire to Run
upils Jun 22, 2026
2ee8aa9
fix: review
upils Jun 22, 2026
fdce477
fix: improve naming and add more tests
upils Jun 23, 2026
c728291
fix: properly build track value with store version
upils Jun 23, 2026
fd0534e
feat: refine download host validation
upils Jun 23, 2026
885c5d3
feat: use revisions/resolve endpoint
upils Jun 23, 2026
ea50c19
fix: raise consistency
upils Jun 23, 2026
0da89bb
fix: use RealName in extract error
upils Jun 23, 2026
4fe25b1
fix: clean model and add guardrail
upils Jun 23, 2026
2bb1b3e
refactor: clean useless method
upils Jun 23, 2026
e299985
fix: review
upils Jun 26, 2026
a035161
fix: review
upils Jun 29, 2026
3cdb869
fix: review
upils Jun 29, 2026
79c437e
fix: review
upils Jun 29, 2026
684f809
test: fix inconsistencies
upils Jun 30, 2026
4a4472c
test: refine
upils Jun 30, 2026
98a0ec9
refactor: move tarball extract to dedicated pkg
upils Jun 30, 2026
9512354
feat: extract bins
upils Jun 30, 2026
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 cmd/chisel/cmd_cut.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"errors"
"fmt"
"slices"
"time"
Expand All @@ -11,6 +12,7 @@ import (
"github.com/canonical/chisel/internal/cache"
"github.com/canonical/chisel/internal/setup"
"github.com/canonical/chisel/internal/slicer"
"github.com/canonical/chisel/internal/store"
)

var shortCutHelp = "Cut a tree with selected slices"
Expand Down Expand Up @@ -121,9 +123,29 @@ func (cmd *cmdCut) Execute(args []string) error {
}
}

stores := make(map[string]store.Store)
for storeName, storeInfo := range release.Stores {
openStore, err := store.Open(&store.Options{
Arch: cmd.Arch,
CacheDir: cache.DefaultDir("chisel"),
Kind: storeInfo.Kind,
Version: storeInfo.Version,
})
if err != nil {
var unknownStoreKindError *store.UnknownStoreKindError
if errors.As(err, &unknownStoreKindError) {
logf("Store %q ignored: %v", storeName, err)
continue
}
return err
}
stores[storeName] = openStore
}

err = slicer.Run(&slicer.RunOptions{
Selection: selection,
Archives: archives,
Stores: stores,
TargetDir: cmd.RootDir,
})
return err
Expand Down
9 changes: 6 additions & 3 deletions cmd/chisel/cmd_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,12 @@ func selectPackageSlices(release *setup.Release, queries []string) (packages []*
} else {
releasePkg := release.Packages[pkgName]
pkg = &setup.Package{
Name: releasePkg.Name,
Archive: releasePkg.Archive,
Slices: make(map[string]*setup.Slice),
Name: releasePkg.Name,
RealName: releasePkg.RealName,
Archive: releasePkg.Archive,
Store: releasePkg.Store,
DefaultTrack: releasePkg.DefaultTrack,
Slices: make(map[string]*setup.Slice),
}
for _, sliceName := range pkgSlices[pkgName] {
pkg.Slices[sliceName] = releasePkg.Slices[sliceName]
Expand Down
4 changes: 4 additions & 0 deletions cmd/chisel/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import (
"github.com/canonical/chisel/internal/deb"
"github.com/canonical/chisel/internal/setup"
"github.com/canonical/chisel/internal/slicer"
"github.com/canonical/chisel/internal/store"
"github.com/canonical/chisel/internal/tarball"
//"github.com/canonical/chisel/internal/logger"
)

Expand Down Expand Up @@ -327,6 +329,8 @@ func run() error {
deb.SetLogger(log.Default())
setup.SetLogger(log.Default())
slicer.SetLogger(log.Default())
store.SetLogger(log.Default())
tarball.SetLogger(log.Default())
SetLogger(log.Default())

parser := Parser()
Expand Down
8 changes: 5 additions & 3 deletions internal/archive/archive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ import (
"strings"

"github.com/canonical/chisel/internal/archive"
"github.com/canonical/chisel/internal/archive/testarchive"
"github.com/canonical/chisel/internal/deb"
"github.com/canonical/chisel/internal/archive/testarchive"
"github.com/canonical/chisel/internal/tarball"
"github.com/canonical/chisel/internal/testutil"
)

Expand Down Expand Up @@ -856,10 +857,11 @@ func (s *S) testOpenArchiveArch(c *C, test realArchiveTest, arch string) {
c.Assert(info.Name, DeepEquals, test.pkg)
c.Assert(info.Arch, DeepEquals, arch)

err = deb.Extract(pkg, &deb.ExtractOptions{
err = tarball.Extract(pkg, &tarball.ExtractOptions{
Package: test.pkg,
TargetDir: extractDir,
Extract: map[string][]deb.ExtractInfo{
OpenData: deb.DataReader,
Extract: map[string][]tarball.ExtractInfo{
fmt.Sprintf("/usr/share/doc/%s/copyright", test.pkg): {
{Path: "/copyright"},
},
Expand Down
Loading
Loading