Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move back to upstream aptly #234

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
21 changes: 9 additions & 12 deletions apt/apt.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
"path/filepath"
"strings"

"github.com/DataDog/aptly/aptly"
"github.com/DataDog/aptly/database"
"github.com/DataDog/aptly/database/goleveldb"
"github.com/DataDog/aptly/deb"
"github.com/DataDog/aptly/http"
"github.com/DataDog/aptly/pgp"
"github.com/aptly-dev/aptly/aptly"
"github.com/aptly-dev/aptly/database"
"github.com/aptly-dev/aptly/database/goleveldb"
"github.com/aptly-dev/aptly/deb"
"github.com/aptly-dev/aptly/http"
"github.com/aptly-dev/aptly/pgp"
"github.com/xor-gate/ar"

"github.com/DataDog/nikos/extract"
Expand Down Expand Up @@ -64,8 +64,6 @@ func (b *Backend) downloadPackage(downloader aptly.Downloader, verifier pgp.Veri
var packageURL *url.URL
var packageDeps *deb.PackageDependencies

stanza := make(deb.Stanza, 32)

err := b.repoCollection.ForEach(func(repo *deb.RemoteRepo) error {
if packageURL != nil {
return nil
Expand All @@ -74,14 +72,13 @@ func (b *Backend) downloadPackage(downloader aptly.Downloader, verifier pgp.Veri
b.logger.Debugf("Fetching repository: name=%s, distribution=%s, components=%v, arch=%v", repo.Name, repo.Distribution, repo.Components, repo.Architectures)
repo.SkipComponentCheck = true

stanza.Clear()
if err := repo.FetchBuffered(stanza, downloader, verifier); err != nil {
if err := repo.Fetch(downloader, verifier, false); err != nil {
b.logger.Debugf("Error fetching repo: %s", err)
return err
}

b.logger.Debug("Downloading package indexes")
if err := repo.DownloadPackageIndexes(nil, downloader, nil, factory, false); err != nil {
if err := repo.DownloadPackageIndexes(nil, downloader, nil, factory, false, false); err != nil {
b.logger.Debugf("Failed to download package indexes: %s", err)
return err
}
Expand Down Expand Up @@ -159,7 +156,7 @@ func (b *Backend) createGpgVerifier() (*pgp.GoVerifier, error) {
}
}

if err := gpgVerifier.InitKeyring(); err != nil {
if err := gpgVerifier.InitKeyring(false); err != nil {
return nil, err
}
return gpgVerifier, nil
Expand Down
24 changes: 11 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/DataDog/nikos

go 1.21
go 1.23.4

require (
github.com/DataDog/aptly v1.5.3
github.com/DataDog/gopsutil v1.2.2
github.com/ProtonMail/go-crypto v1.1.3
github.com/acobaugh/osrelease v0.1.0
github.com/aptly-dev/aptly v1.6.0
github.com/hashicorp/go-multierror v1.1.1
github.com/klauspost/compress v1.17.11
github.com/sassoftware/go-rpmutils v0.4.0
Expand All @@ -27,9 +27,8 @@ require (
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/awalterschulze/gographviz v2.0.3+incompatible // indirect
github.com/cavaliergopher/grab/v3 v3.0.1 // indirect
github.com/cheggaaa/pb v1.0.29 // indirect
github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect
github.com/cloudflare/circl v1.3.8 // indirect
github.com/cloudflare/circl v1.4.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/ebitengine/purego v0.8.1 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
Expand All @@ -38,34 +37,33 @@ require (
github.com/h2non/filetype v1.1.3 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jlaffaye/ftp v0.1.0 // indirect
github.com/jlaffaye/ftp v0.2.0 // indirect
github.com/kjk/lzma v0.0.0-20161016003348-3fd93898850d // indirect
github.com/klauspost/pgzip v1.2.5 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mkrautz/goar v0.0.0-20150919110319-282caa8bd9da // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/pborman/uuid v1.2.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/rs/zerolog v1.28.0 // indirect
github.com/rs/zerolog v1.30.0 // indirect
github.com/saracen/walker v0.1.2 // indirect
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect
github.com/smira/go-ftp-protocol v0.0.0-20140829150050-066b75c2b70d // indirect
github.com/smira/go-xz v0.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d // indirect
github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/ugorji/go/codec v1.2.7 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/ulikunitz/xz v0.5.12 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/time v0.6.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading
Loading