Merge pull request from aptly-dev/fix/empty-mirror-snapshot

Allow snapshotting empty mirrors
pull/1425/head
André Roth 2025-01-13 12:36:01 +01:00 committed by GitHub
commit 666b5c9700
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 18 additions and 4 deletions

View File

@ -44,9 +44,9 @@ Debian / Ubuntu
Aptly is provided in the following debian packages:
* aptly (main binary)
* aptly-api (systemd service for REST API)
* aptly-dbgsym (debugging symbols)
* **aptly**: Includes the main Aptly binary, man pages, and shell completions
* **aptly-api**: A systemd service for the REST API, using the global /etc/aptly.conf
* **aptly-dbg**: Debug symbols for troubleshooting
The packages can be installed on official `Debian <https://packages.debian.org/search?keywords=aptly>`_ and `Ubuntu <https://packages.ubuntu.com/search?keywords=aptly>`_ distributions.

View File

@ -45,7 +45,7 @@ type Snapshot struct {
// NewSnapshotFromRepository creates snapshot from current state of repository
func NewSnapshotFromRepository(name string, repo *RemoteRepo) (*Snapshot, error) {
if repo.packageRefs == nil || repo.packageRefs.Len() == 0 {
if repo.packageRefs == nil {
return nil, errors.New("mirror not updated")
}

View File

@ -0,0 +1,3 @@
Snapshot oh-snap successfully created.
You can run 'aptly publish snapshot oh-snap' to publish snapshot as Debian repository.

View File

@ -106,3 +106,14 @@ class CreateSnapshot9Test(BaseTest):
"aptly repo create local-repo",
]
runCmd = "aptly snapshot create snap9 from repo local-repo"
class CreateSnapshot10Test(BaseTest):
"""
create snapshot: from empty mirror
"""
fixtureCmds = [
"aptly mirror create -ignore-signatures non-free http://repo.aptly.info/system-tests/security.debian.org/debian-security bookworm-security updates/non-free",
"aptly mirror update -ignore-signatures non-free"
]
runCmd = "aptly snapshot create oh-snap from mirror non-free"