Merge remote-tracking branch 'official/improve/debianization' into upstream/16.0

This commit is contained in:
Sébastien Delafond
2024-11-17 14:43:32 +01:00
17 changed files with 139 additions and 17 deletions
+3
View File
@@ -317,6 +317,9 @@ func (l *PackageList) VerifyDependencies(options int, architectures []string, so
progress.InitBar(int64(l.Len())*int64(len(architectures)), false, aptly.BarGeneralVerifyDependencies)
}
if len(architectures) == 0 {
return nil, fmt.Errorf("no architectures defined, cannot verify dependencies")
}
for _, arch := range architectures {
cache := make(map[string]bool, 2048)
+7 -2
View File
@@ -105,7 +105,6 @@ func NewRemoteRepo(name string, archiveRoot string, distribution string, compone
if !strings.HasPrefix(result.Distribution, ".") {
result.Distribution = "./" + result.Distribution
}
result.Architectures = nil
if len(result.Components) > 0 {
return nil, fmt.Errorf("components aren't supported for flat repos")
}
@@ -351,7 +350,7 @@ ok:
return err
}
if !repo.IsFlat() {
if len(stanza["Architectures"]) > 0 {
architectures := strings.Split(stanza["Architectures"], " ")
sort.Strings(architectures)
// "source" architecture is never present, despite Release file claims
@@ -365,7 +364,13 @@ ok:
return err
}
}
}
if len(repo.Architectures) == 0 {
return fmt.Errorf("no architectures found, please specify")
}
if !repo.IsFlat() {
components := strings.Split(stanza["Components"], " ")
if strings.Contains(repo.Distribution, "/") {
distributionLast := path.Base(repo.Distribution) + "/"
-1
View File
@@ -115,7 +115,6 @@ func (s *RemoteRepoSuite) TestInvalidURL(c *C) {
func (s *RemoteRepoSuite) TestFlatCreation(c *C) {
c.Check(s.flat.IsFlat(), Equals, true)
c.Check(s.flat.Distribution, Equals, "./")
c.Check(s.flat.Architectures, IsNil)
c.Check(s.flat.Components, IsNil)
flat2, _ := NewRemoteRepo("flat2", "http://pkg.jenkins-ci.org/debian-stable", "binary/", []string{}, []string{}, false, false, false)
+1 -1
View File
@@ -9,7 +9,7 @@ Group=aptly-api
Environment=TERM=dumb
WorkingDirectory=~
EnvironmentFile=/etc/default/aptly-api
ExecStart=/usr/bin/aptly api serve -config=/etc/aptly.conf -listen=${LISTEN_ADDRESS}
ExecStart=/usr/bin/aptly api serve -config=/etc/aptly.conf -no-lock -listen=${LISTEN_ADDRESS}
[Install]
WantedBy=multi-user.target
+34 -8
View File
@@ -87,9 +87,41 @@ XS-Go-Import-Path: github.com/aptly-dev/aptly
Package: aptly
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}, bzip2, xz-utils, adduser, gpg (>= 2.2.12)
Suggests: graphviz
Conflicts: gnupg1, gpgv1
Built-Using: ${misc:Static-Built-Using}, ${misc:Built-Using}
Description: Debian repository management tool
aptly is a Swiss army knife for Debian repository management.
Description: Swiss army knife for Debian repository management - main package
It offers several features making it easy to manage Debian package
repositories:
.
- make mirrors of remote Debian/Ubuntu repositories, limiting by
components/architectures
- take snapshots of mirrors at any point in time, fixing state of
repository at some moment of time
- publish snapshot as Debian repository, ready to be consumed by apt
- controlled update of one or more packages in snapshot from upstream
mirror, tracking dependencies
- merge two or more snapshots into one
.
This is the main package, it contains the aptly command-line utility.
Package: aptly-api
Architecture: all
Depends: ${misc:Depends}, aptly, adduser
Description: Swiss army knife for Debian repository management - API
It offers several features making it easy to manage Debian package
repositories:
.
- make mirrors of remote Debian/Ubuntu repositories, limiting by
components/architectures
- take snapshots of mirrors at any point in time, fixing state of
repository at some moment of time
- publish snapshot as Debian repository, ready to be consumed by apt
- controlled update of one or more packages in snapshot from upstream
mirror, tracking dependencies
- merge two or more snapshots into one
.
This package contains the aptly-api service.
Package: aptly-dbg
Architecture: any
@@ -97,9 +129,3 @@ Depends: ${misc:Depends}
Built-Using: ${misc:Static-Built-Using}, ${misc:Built-Using}
Description: Debian repository management tool (debug files)
Debug symbols for aptly
Package: aptly-api
Architecture: all
Depends: ${misc:Depends}, aptly
Description: Debian repository management tool (REST API server)
systemd service and configuration for aptly
+9 -1
View File
@@ -20,7 +20,15 @@ override_dh_auto_clean:
rm -rf obj-$(DEB_TARGET_GNU_TYPE)/
dh_auto_clean
override_dh_auto_test: # disabled
override_dh_auto_build:
echo $(DEB_VERSION) > VERSION
go build -o build/aptly
# when dependencies fully debianized:
# echo $(DEB_VERSION) > obj-$(DEB_TARGET_GNU_TYPE)/src/github.com/aptly-dev/aptly/VERSION
# dh_auto_build
override_dh_auto_test:
override_dh_auto_install:
dh_auto_install -- --no-source
+4
View File
@@ -0,0 +1,4 @@
# This file is an addition to the autodep8 tests.
Test-Command: HOME=/tmp aptly repo create autopkgtest
Restrictions: allow-stderr
+5
View File
@@ -0,0 +1,5 @@
---
Bug-Database: https://github.com/aptly-dev/aptly/issues
Bug-Submit: https://github.com/aptly-dev/aptly/issues/new
Repository: https://github.com/aptly-dev/aptly.git
Repository-Browse: https://github.com/aptly-dev/aptly
+5
View File
@@ -0,0 +1,5 @@
version=4
opts=\
repacksuffix=+ds1,\
dversionmangle=s/\+ds\d*$// \
https://github.com/aptly-dev/aptly/tags .*/v(\d[\d\.]*)\.tar\.gz debian uupdate
@@ -2,7 +2,7 @@ Name: mirror14
Archive Root URL: http://repo.aptly.info/system-tests/cloud.r-project.org/bin/linux/debian/
Distribution: ./bullseye-cran40/
Components:
Architectures:
Architectures: all, amd64, i386
Download Sources: no
Download .udebs: no
Last update: never
@@ -2,7 +2,7 @@ Name: mirror21
Archive Root URL: http://repo.aptly.info/system-tests/pkg.jenkins.io/debian-stable/
Distribution: ./binary/
Components:
Architectures:
Architectures: all
Download Sources: no
Download .udebs: no
Last update: never
@@ -2,7 +2,7 @@ Name: mirror33
Archive Root URL: http://repo.aptly.info/system-tests/nvidia.github.io/libnvidia-container/stable/ubuntu16.04/amd64/
Distribution: ./
Components:
Architectures:
Architectures: amd64
Download Sources: no
Download .udebs: no
Last update: never
@@ -0,0 +1,6 @@
Downloading: http://repo.aptly.info/system-tests/developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/Release
Error (retrying): HTTP code 404 while fetching http://repo.aptly.info/system-tests/developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/Release
Retrying 0 http://repo.aptly.info/system-tests/developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/Release...
Download Error: http://repo.aptly.info/system-tests/developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/Release
Downloading: http://repo.aptly.info/system-tests/developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/InRelease
ERROR: unable to fetch mirror: no architectures found, please specify
@@ -0,0 +1,6 @@
Downloading & parsing package files...
Applying filter...
Packages filtered: 4743 -> 81.
Building download queue...
Download queue: 81 items (3.00 GiB)
@@ -0,0 +1,17 @@
Name: mirror35
Archive Root URL: http://repo.aptly.info/system-tests/developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/
Distribution: ./
Components:
Architectures: amd64
Download Sources: no
Download .udebs: no
Filter: cuda-12-6 (= 12.6.2-1)
Filter With Deps: yes
Last update: never
Information from release file:
Acquire-By-Hash: no
Architecture: x86_64
Date: Mon, 04 Nov 2024 16:02:23 +0000
Label: NVIDIA CUDA
Origin: NVIDIA
+4 -1
View File
@@ -126,7 +126,10 @@
"ArchiveRoot": "http://repo.aptly.info/system-tests/download.opensuse.org/repositories/Apache:/MirrorBrain/Debian_9.0/",
"Distribution": "./",
"Components": null,
"Architectures": null,
"Architectures": [
"amd64",
"i386"
],
"Meta": {
"Architectures": "i386 amd64",
"Archive": "Debian_9.0",
+35
View File
@@ -454,3 +454,38 @@ class CreateMirror33Test(BaseTest):
def check(self):
self.check_output()
self.check_cmd_output("aptly mirror show mirror33", "mirror_show")
class CreateMirror34Test(BaseTest):
"""
create mirror error: flat repo with filter but no architectures in InRelease file
"""
configOverride = {"max-tries": 1}
runCmd = "aptly mirror create -ignore-signatures -filter \"cuda-12-6 (= 12.6.2-1)\" -filter-with-deps mirror34 http://repo.aptly.info/system-tests/developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ ./"
class CreateMirror35Test(BaseTest):
"""
create mirror: flat repo with filter but no architectures in InRelease file
"""
configOverride = {"max-tries": 1}
fixtureCmds = [
"aptly mirror create -architectures amd64 -ignore-signatures -filter \"cuda-12-6 (= 12.6.2-1)\" -filter-with-deps mirror35 "
"http://repo.aptly.info/system-tests/developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ ./",
]
runCmd = "aptly mirror update -ignore-signatures mirror35"
# the downloading of the actual packages will return 404 since they don't exist. ignore the errors, the test verifies proper count of filtered packages
def outputMatchPrepare(self, s):
s = re.sub(r'Downloading: .*\n', '', s, flags=re.MULTILINE)
s = re.sub(r'Download Error: .*\n', '', s, flags=re.MULTILINE)
s = re.sub(r'Retrying .*\n', '', s, flags=re.MULTILINE)
s = re.sub(r'Error \(retrying\): .*\n', '', s, flags=re.MULTILINE)
s = re.sub(r'HTTP code 404 while fetching .*\n', '', s, flags=re.MULTILINE)
s = re.sub(r'ERROR: unable to update: .*\n', '', s, flags=re.MULTILINE)
return s
def check(self):
self.check_output()
self.check_cmd_output("aptly mirror show mirror35", "mirror_show")