Fix support for apt-transport-mirror URLs #8

Open
boklm wants to merge 2 commits from boklm/mmdebstrap:fix_apt-transport-mirror into main
boklm commented 1 day ago

This branch fix two issues when using apt-transport-mirror URLs:

  • apt-transport-https and ca-certificates not installed in the chroot, because the URL does not start with https://
  • the directory /var/lib/apt/lists/auxfiles is not empty, so rmdir fails. In the patch I replaced it remove_tree. Maybe we could ignore the error from rmdir instead.
This branch fix two issues when using [apt-transport-mirror](https://manpages.debian.org/buster/apt/apt-transport-mirror.1.en.html) URLs: * apt-transport-https and ca-certificates not installed in the chroot, because the URL does not start with `https://` * the directory `/var/lib/apt/lists/auxfiles` is not empty, so rmdir fails. In the patch I replaced it `remove_tree`. Maybe we could ignore the error from `rmdir` instead.
boklm added 2 commits 1 day ago
028d4914a0
Remove files inside the auxfiles directory
josch commented 1 day ago
Owner

Hi,

yes, that regex was indeed missing the mirror prefix but there is an even better way to fix this problem which currently only exists on my local machine: instead of using apt inside the chroot, we can use apt from the outside to install packages on the inside. This has several advantages:

  • we can build chroots without apt (for example from buildinfo files)
  • we do not need to install additional packages like apt-transport-* or ca-certificates inside the chroot
  • we do not not need additional key material inside the chroot
  • we can make use of file:// and copy://

So essentially, the part of the code your first commit touches was completely removed.

Your auxfiles patch is still necessary though. What files does apt put into auxfiles? Does that only happen with mirror URIs?

Hi, yes, that regex was indeed missing the `mirror` prefix but there is an even better way to fix this problem which currently only exists on my local machine: instead of using apt inside the chroot, we can use apt from the outside to install packages on the inside. This has several advantages: - we can build chroots without apt (for example from buildinfo files) - we do not need to install additional packages like apt-transport-* or ca-certificates inside the chroot - we do not not need additional key material inside the chroot - we can make use of file:// and copy:// So essentially, the part of the code your first commit touches was completely removed. Your auxfiles patch is still necessary though. What files does apt put into auxfiles? Does that only happen with mirror URIs?
This pull request can be merged automatically.
You are not authorized to merge this pull request.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.