mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-11 03:11:50 +00:00
Switch to google/uuid module
Current used github.com/pborman/uuid hasn't seen any updates in years. Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
|||||||
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/lease"
|
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/lease"
|
||||||
"github.com/aptly-dev/aptly/aptly"
|
"github.com/aptly-dev/aptly/aptly"
|
||||||
"github.com/aptly-dev/aptly/utils"
|
"github.com/aptly-dev/aptly/utils"
|
||||||
"github.com/pborman/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ func (storage *PublishedStorage) Filelist(prefix string) ([]string, error) {
|
|||||||
// Internal copy or move implementation
|
// Internal copy or move implementation
|
||||||
func (storage *PublishedStorage) internalCopyOrMoveBlob(src, dst string, metadata map[string]*string, move bool) error {
|
func (storage *PublishedStorage) internalCopyOrMoveBlob(src, dst string, metadata map[string]*string, move bool) error {
|
||||||
const leaseDuration = 30
|
const leaseDuration = 30
|
||||||
leaseID := uuid.NewRandom().String()
|
leaseID := uuid.NewString()
|
||||||
|
|
||||||
serviceClient := storage.az.client.ServiceClient()
|
serviceClient := storage.az.client.ServiceClient()
|
||||||
containerClient := serviceClient.NewContainerClient(storage.az.container)
|
containerClient := serviceClient.NewContainerClient(storage.az.container)
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package etcddb
|
package etcddb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/aptly-dev/aptly/database"
|
|
||||||
"github.com/pborman/uuid"
|
|
||||||
clientv3 "go.etcd.io/etcd/client/v3"
|
|
||||||
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/aptly-dev/aptly/database"
|
||||||
|
"github.com/google/uuid"
|
||||||
|
clientv3 "go.etcd.io/etcd/client/v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
type EtcDStorage struct {
|
type EtcDStorage struct {
|
||||||
@@ -16,7 +16,7 @@ type EtcDStorage struct {
|
|||||||
|
|
||||||
// CreateTemporary creates new DB of the same type in temp dir
|
// CreateTemporary creates new DB of the same type in temp dir
|
||||||
func (s *EtcDStorage) CreateTemporary() (database.Storage, error) {
|
func (s *EtcDStorage) CreateTemporary() (database.Storage, error) {
|
||||||
tmp := uuid.NewRandom().String()
|
tmp := uuid.NewString()
|
||||||
return &EtcDStorage{
|
return &EtcDStorage{
|
||||||
url: s.url,
|
url: s.url,
|
||||||
db: s.db,
|
db: s.db,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/aptly-dev/aptly/database"
|
"github.com/aptly-dev/aptly/database"
|
||||||
"github.com/pborman/uuid"
|
"github.com/google/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ContentsIndex calculates mapping from files to packages, with sorting and aggregation
|
// ContentsIndex calculates mapping from files to packages, with sorting and aggregation
|
||||||
@@ -20,7 +20,7 @@ type ContentsIndex struct {
|
|||||||
func NewContentsIndex(db database.Storage) *ContentsIndex {
|
func NewContentsIndex(db database.Storage) *ContentsIndex {
|
||||||
return &ContentsIndex{
|
return &ContentsIndex{
|
||||||
db: db,
|
db: db,
|
||||||
prefix: []byte(uuid.New()),
|
prefix: []byte(uuid.NewString()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/aptly-dev/aptly/database"
|
"github.com/aptly-dev/aptly/database"
|
||||||
"github.com/pborman/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/ugorji/go/codec"
|
"github.com/ugorji/go/codec"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ type LocalRepo struct {
|
|||||||
// NewLocalRepo creates new instance of Debian local repository
|
// NewLocalRepo creates new instance of Debian local repository
|
||||||
func NewLocalRepo(name string, comment string) *LocalRepo {
|
func NewLocalRepo(name string, comment string) *LocalRepo {
|
||||||
return &LocalRepo{
|
return &LocalRepo{
|
||||||
UUID: uuid.New(),
|
UUID: uuid.NewString(),
|
||||||
Name: name,
|
Name: name,
|
||||||
Comment: comment,
|
Comment: comment,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pborman/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/ugorji/go/codec"
|
"github.com/ugorji/go/codec"
|
||||||
|
|
||||||
"github.com/aptly-dev/aptly/aptly"
|
"github.com/aptly-dev/aptly/aptly"
|
||||||
@@ -354,7 +354,7 @@ func walkUpTree(source interface{}, collectionFactory *CollectionFactory) (rootD
|
|||||||
func NewPublishedRepo(storage, prefix, distribution string, architectures []string,
|
func NewPublishedRepo(storage, prefix, distribution string, architectures []string,
|
||||||
components []string, sources []interface{}, collectionFactory *CollectionFactory, multiDist bool) (*PublishedRepo, error) {
|
components []string, sources []interface{}, collectionFactory *CollectionFactory, multiDist bool) (*PublishedRepo, error) {
|
||||||
result := &PublishedRepo{
|
result := &PublishedRepo{
|
||||||
UUID: uuid.New(),
|
UUID: uuid.NewString(),
|
||||||
Storage: storage,
|
Storage: storage,
|
||||||
Architectures: architectures,
|
Architectures: architectures,
|
||||||
Sources: make(map[string]string),
|
Sources: make(map[string]string),
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import (
|
|||||||
"github.com/aptly-dev/aptly/http"
|
"github.com/aptly-dev/aptly/http"
|
||||||
"github.com/aptly-dev/aptly/pgp"
|
"github.com/aptly-dev/aptly/pgp"
|
||||||
"github.com/aptly-dev/aptly/utils"
|
"github.com/aptly-dev/aptly/utils"
|
||||||
"github.com/pborman/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/ugorji/go/codec"
|
"github.com/ugorji/go/codec"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ type RemoteRepo struct {
|
|||||||
func NewRemoteRepo(name string, archiveRoot string, distribution string, components []string,
|
func NewRemoteRepo(name string, archiveRoot string, distribution string, components []string,
|
||||||
architectures []string, downloadSources bool, downloadUdebs bool, downloadInstaller bool) (*RemoteRepo, error) {
|
architectures []string, downloadSources bool, downloadUdebs bool, downloadInstaller bool) (*RemoteRepo, error) {
|
||||||
result := &RemoteRepo{
|
result := &RemoteRepo{
|
||||||
UUID: uuid.New(),
|
UUID: uuid.NewString(),
|
||||||
Name: name,
|
Name: name,
|
||||||
ArchiveRoot: archiveRoot,
|
ArchiveRoot: archiveRoot,
|
||||||
Distribution: distribution,
|
Distribution: distribution,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
"github.com/aptly-dev/aptly/database"
|
"github.com/aptly-dev/aptly/database"
|
||||||
"github.com/aptly-dev/aptly/utils"
|
"github.com/aptly-dev/aptly/utils"
|
||||||
"github.com/pborman/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/ugorji/go/codec"
|
"github.com/ugorji/go/codec"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ func NewSnapshotFromRepository(name string, repo *RemoteRepo) (*Snapshot, error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &Snapshot{
|
return &Snapshot{
|
||||||
UUID: uuid.New(),
|
UUID: uuid.NewString(),
|
||||||
Name: name,
|
Name: name,
|
||||||
CreatedAt: time.Now(),
|
CreatedAt: time.Now(),
|
||||||
SourceKind: SourceRemoteRepo,
|
SourceKind: SourceRemoteRepo,
|
||||||
@@ -66,7 +66,7 @@ func NewSnapshotFromRepository(name string, repo *RemoteRepo) (*Snapshot, error)
|
|||||||
// NewSnapshotFromLocalRepo creates snapshot from current state of local repository
|
// NewSnapshotFromLocalRepo creates snapshot from current state of local repository
|
||||||
func NewSnapshotFromLocalRepo(name string, repo *LocalRepo) (*Snapshot, error) {
|
func NewSnapshotFromLocalRepo(name string, repo *LocalRepo) (*Snapshot, error) {
|
||||||
snap := &Snapshot{
|
snap := &Snapshot{
|
||||||
UUID: uuid.New(),
|
UUID: uuid.NewString(),
|
||||||
Name: name,
|
Name: name,
|
||||||
CreatedAt: time.Now(),
|
CreatedAt: time.Now(),
|
||||||
SourceKind: SourceLocalRepo,
|
SourceKind: SourceLocalRepo,
|
||||||
@@ -95,7 +95,7 @@ func NewSnapshotFromRefList(name string, sources []*Snapshot, list *PackageRefLi
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &Snapshot{
|
return &Snapshot{
|
||||||
UUID: uuid.New(),
|
UUID: uuid.NewString(),
|
||||||
Name: name,
|
Name: name,
|
||||||
CreatedAt: time.Now(),
|
CreatedAt: time.Now(),
|
||||||
SourceKind: "snapshot",
|
SourceKind: "snapshot",
|
||||||
|
|||||||
1
debian/control
vendored
1
debian/control
vendored
@@ -45,7 +45,6 @@ Build-Depends: bash-completion,
|
|||||||
golang-github-munnerz-goautoneg-dev,
|
golang-github-munnerz-goautoneg-dev,
|
||||||
golang-github-mxk-go-flowrate-dev,
|
golang-github-mxk-go-flowrate-dev,
|
||||||
golang-github-ncw-swift-dev,
|
golang-github-ncw-swift-dev,
|
||||||
golang-github-pborman-uuid-dev,
|
|
||||||
golang-github-pelletier-go-toml,
|
golang-github-pelletier-go-toml,
|
||||||
golang-github-pkg-errors-dev,
|
golang-github-pkg-errors-dev,
|
||||||
golang-github-prometheus-client-golang-dev,
|
golang-github-prometheus-client-golang-dev,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/pborman/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/saracen/walker"
|
"github.com/saracen/walker"
|
||||||
|
|
||||||
"github.com/aptly-dev/aptly/aptly"
|
"github.com/aptly-dev/aptly/aptly"
|
||||||
@@ -417,7 +417,7 @@ func (pool *PackagePool) FullPath(path string) string {
|
|||||||
|
|
||||||
// GenerateTempPath generates temporary path for download (which is fast to import into package pool later on)
|
// GenerateTempPath generates temporary path for download (which is fast to import into package pool later on)
|
||||||
func (pool *PackagePool) GenerateTempPath(filename string) (string, error) {
|
func (pool *PackagePool) GenerateTempPath(filename string) (string, error) {
|
||||||
random := uuid.NewRandom().String()
|
random := uuid.NewString()
|
||||||
|
|
||||||
return filepath.Join(pool.rootPath, random[0:2], random[2:4], random[4:]+filename), nil
|
return filepath.Join(pool.rootPath, random[0:2], random[2:4], random[4:]+filename), nil
|
||||||
}
|
}
|
||||||
|
|||||||
3
go.mod
3
go.mod
@@ -21,7 +21,6 @@ require (
|
|||||||
github.com/mkrautz/goar v0.0.0-20150919110319-282caa8bd9da
|
github.com/mkrautz/goar v0.0.0-20150919110319-282caa8bd9da
|
||||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f
|
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f
|
||||||
github.com/ncw/swift v1.0.53
|
github.com/ncw/swift v1.0.53
|
||||||
github.com/pborman/uuid v1.2.0
|
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/pkg/errors v0.9.1
|
||||||
github.com/prometheus/client_golang v1.20.0
|
github.com/prometheus/client_golang v1.20.0
|
||||||
github.com/rs/zerolog v1.29.1
|
github.com/rs/zerolog v1.29.1
|
||||||
@@ -78,7 +77,6 @@ require (
|
|||||||
github.com/gogo/protobuf v1.3.2 // indirect
|
github.com/gogo/protobuf v1.3.2 // indirect
|
||||||
github.com/golang/protobuf v1.5.4 // indirect
|
github.com/golang/protobuf v1.5.4 // indirect
|
||||||
github.com/golang/snappy v0.0.4 // indirect
|
github.com/golang/snappy v0.0.4 // indirect
|
||||||
github.com/google/uuid v1.6.0 // indirect
|
|
||||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||||
github.com/josharian/intern v1.0.0 // indirect
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
@@ -124,6 +122,7 @@ require (
|
|||||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.46
|
github.com/aws/aws-sdk-go-v2/credentials v1.17.46
|
||||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.67.1
|
github.com/aws/aws-sdk-go-v2/service/s3 v1.67.1
|
||||||
github.com/aws/smithy-go v1.22.1
|
github.com/aws/smithy-go v1.22.1
|
||||||
|
github.com/google/uuid v1.6.0
|
||||||
github.com/swaggo/files v1.0.1
|
github.com/swaggo/files v1.0.1
|
||||||
github.com/swaggo/gin-swagger v1.6.0
|
github.com/swaggo/gin-swagger v1.6.0
|
||||||
github.com/swaggo/swag v1.16.3
|
github.com/swaggo/swag v1.16.3
|
||||||
|
|||||||
3
go.sum
3
go.sum
@@ -148,7 +148,6 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
|||||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
|
||||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/h2non/filetype v1.1.3 h1:FKkx9QbD7HR/zjK1Ia5XiBsq9zdLi5Kf3zGyFTAFkGg=
|
github.com/h2non/filetype v1.1.3 h1:FKkx9QbD7HR/zjK1Ia5XiBsq9zdLi5Kf3zGyFTAFkGg=
|
||||||
@@ -231,8 +230,6 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y
|
|||||||
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
|
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
|
||||||
github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw=
|
github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw=
|
||||||
github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
|
github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
|
||||||
github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g=
|
|
||||||
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
|
|
||||||
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
|
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
|
||||||
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
|
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
|
||||||
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
|
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
|
||||||
|
|||||||
Reference in New Issue
Block a user