Fix support for apt-transport-mirror URLs #8

Closed
boklm wants to merge 2 commits from boklm/mmdebstrap:fix_apt-transport-mirror into main
First-time contributor

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 2021-06-21 14:02:41 +00:00
This is fixing the error:
  cannot rmdir /var/lib/apt/lists/auxfiles: Directory not empty at ./mmdebstrap/mmdebstrap line 3084.
which happens when using apt-transport-mirror.
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?
Owner

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

Hi, I wanted to ping you about my question above. Thanks!

> Your auxfiles patch is still necessary though. What files does apt put into auxfiles? Does that only happen with mirror URIs? Hi, I wanted to ping you about my question above. Thanks!
Owner

Closing as this is no longer relevant.

Closing as this is no longer relevant.
josch closed this pull request 2021-10-28 19:07:55 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: josch/mmdebstrap#8
No description provided.