Fix support for apt-transport-mirror URLs #8

Closed
boklm wants to merge 2 commits from boklm/mmdebstrap:fix_apt-transport-mirror into main
boklm commented 3 years 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 3 years ago
028d4914a0
Remove files inside the auxfiles directory
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.
josch commented 3 years 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?
josch commented 3 years ago
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!
josch commented 3 years ago
Owner

Closing as this is no longer relevant.

Closing as this is no longer relevant.
josch closed this pull request 3 years ago
Please reopen this pull request to perform a merge.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b boklm-fix_apt-transport-mirror main
git pull fix_apt-transport-mirror

Step 2:

Merge the changes and update on Gitea.
git checkout main
git merge --no-ff boklm-fix_apt-transport-mirror
git push origin main
Sign in to join this conversation.
No reviewers
No Label
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
Loading…
There is no content yet.