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

Allow snapshotting empty mirrors #1422

Merged
merged 3 commits into from
Jan 13, 2025
Merged
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
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion deb/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down
3 changes: 3 additions & 0 deletions system/t05_snapshot/CreateSnapshot10Test_gold
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

Snapshot oh-snap successfully created.
You can run 'aptly publish snapshot oh-snap' to publish snapshot as Debian repository.
11 changes: 11 additions & 0 deletions system/t05_snapshot/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Loading