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

Support for flat repositories missing ? #123

Open
milkshake308 opened this issue Jan 3, 2025 · 1 comment
Open

Support for flat repositories missing ? #123

milkshake308 opened this issue Jan 3, 2025 · 1 comment

Comments

@milkshake308
Copy link

milkshake308 commented Jan 3, 2025

Hello, I've noticed an issue regarding how pyaptly builds the subcommand for flat repository mirror creation.
I am using the following declaration to make a mirror for the nvidia-container-toolkit.

[mirror.nvidia-container-toolkit]
archive = "https://nvidia.github.io/libnvidia-container/stable/deb/amd64/"
components = [""]
distribution = "/"
architectures = ["amd64"]
sources = false
udeb = false

As this a flat repository, I had no other choice but to put an empty value to the components= section, else pyaptly would to create the mirror command because the field is expected anyway

The issue is that produced mirror creation command include an extra empty "components" argument which makes the aptly CLI fail with the following error :

ERROR: Command call
  cmd:         aptly mirror create -with-sources=false -architectures=amd64 nvidia-container-toolkit https://nvidia.github.io/libnvidia-container/stable/deb/amd64/ /  -> 1
  stderr:     'ERROR: unable to create mirror: components aren't supported for flat repos'

It's invisble in the output produced by --info but we clearly see the extra argument in the traceback :

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/pyaptly/util.py", line 120, in run_command
    raise CalledProcessError(
subprocess.CalledProcessError: Command '('aptly', 'mirror', 'create', '-with-sources=false', '-architectures=amd64', 'nvidia-container-toolkit', 'https://nvidia.github.io/libnvidia-container/stable/deb/amd64/', '/', '')' returned non-zero exit status 1.

I also was able to reproduce the issue with aptly CLI directly :

## With extra empty arg
$ aptly mirror create -with-sources=false -architectures=amd64 nvidia-container-toolkit https://nvidia.github.io/libnvidia-container/stable/d
eb/amd64/ / ''
ERROR: unable to create mirror: components aren't supported for flat repos
## Without extra arg
$ aptly mirror create -with-sources=false -architectures=amd64 nvidia-container-toolkit https://nvidia.github.io/libnvidia-container/stable/deb/amd64/ /
Downloading https://nvidia.github.io/libnvidia-container/stable/deb/amd64//InRelease...
Success downloading https://nvidia.github.io/libnvidia-container/stable/deb/amd64//InRelease

Were flat repositories supposed to be supported in the first place?
Apologies for the lengthy message and any language mistakes-- Thank you for your work on pyaptly and for considering this request

@Melkor333
Copy link
Contributor

Heya

You are right, flat repositories don't work right now. I think the opensuse repo is also flat, as posted in #119.
The "quick fix" is to run the aptly mirror create ... command manually and then use pyaptly for managing the content itself.
AFAIU it's just the create command which fails.

We're always be open for PRs!

I'm also currently on-and-off working on pyaptly to get the "new version" stable (the main branch, currently considered "alpha", though in productive use) and remove a lot of old code which isn't required anymore. But it has almost zero relevance, so I don't have much time to spend on it.
So if it's just allowing an empty components argument, I might implement it along the way somewhere in the next months. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants