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

Export RemoteRepo package list #967

Merged
merged 1 commit into from
Nov 2, 2021

Conversation

lebauce
Copy link
Contributor

@lebauce lebauce commented Jul 23, 2021

Description of the Change

Export the package list of a remote repository

Checklist

  • unit-test added (if change is algorithm)
  • functional test added/updated (if change is functional)
  • man page updated (if applicable)
  • bash completion updated (if applicable)
  • documentation updated
  • author name in AUTHORS

@lebauce
Copy link
Contributor Author

lebauce commented Oct 5, 2021

@lbolla Could you please take a quick look at this PR ? This simple export would be really useful for https://github.com/DataDog/nikos that makes use of aptly for downloading kernel to compile eBPF programs. Thanks a lot !

@r4co0n
Copy link

r4co0n commented Oct 25, 2021

@lebauce, could you please update the commit description with what you are solving specifically? I am interested in use-cases for this. Ideally, this would close a bug describing your problem.

EDIT: This is probably bold, but please consider How to Write a Git Commit Message.

@lebauce
Copy link
Contributor Author

lebauce commented Oct 26, 2021

@r4co0n Thanks for taking a look at it.

My goal is to have the full download URL of a package. My library works this way:

I have a deb.RemoteRepo. On this repo, I call

I now have a PackageList. When iterating on this package list, the Packages in it only have the field Filename and Checksums set. Both PoolPath and downloadPath are empty.

So when I call repo.PackageURL, I have an incorrect URL. Something like http://us.archive.ubuntu.com/ubuntu/linux-headers-5.4.0-42_5.4.0-42.46_all.deb instead of http://us.archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-headers-5.4.0-42_5.4.0-42.46_all.deb (missing the pool part).

I tried different approaches but none worked : after FinalizeDownload, I can't restore downloadPath (I can use Package.PoolDirectory and RemoteRepo.PackageURL but the component is lost).

Exporting the package list allows using Packages with the downloadPath field set

@lbolla lbolla merged commit ab2f542 into aptly-dev:master Nov 2, 2021
@lbolla
Copy link
Contributor

lbolla commented Nov 2, 2021

Thanks!

@lebauce
Copy link
Contributor Author

lebauce commented Nov 4, 2021

Thank you @lbolla and @r4co0n !

@lebauce lebauce deleted the export-remote-package-list branch November 4, 2021 14:33
@lebauce lebauce mentioned this pull request Nov 4, 2021
5 tasks
@randombenj randombenj added this to the 1.5.0 milestone Jun 23, 2022
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

Successfully merging this pull request may close these issues.

4 participants