4

Mock is a utility used by Fedora to build packages in chroots. For debugging, it would be nice to access files inside those chroots with all the amenities Emacs has to offer.

Calling mock -r fedora-26-i386 --shell yields a shell inside the fedora-26-i386 chroot:

[tim@passepartout ~]$ mock -r fedora-26-i386 --shell
INFO: mock.py version 1.4.8 starting (python version = 3.6.4)...
Start: init plugins
INFO: selinux disabled
Finish: init plugins
Start: run
Start: chroot init
INFO: calling preinit hooks
INFO: enabled root cache
INFO: enabled dnf cache
Start: cleaning dnf metadata
Finish: cleaning dnf metadata
INFO: enabled HW Info plugin
Finish: chroot init
Start: shell
<mock-chroot> sh-4.4#

How would a TRAMP method look like for that so that (for example, I assume treating fedora-26-i386 as a host name is fitting) /mock:fedora-26-i386:/etc/passwd would access /etc/passwd in the shell brought up by mock -r fedora-26-i386 --shell?

1

For its own tests, Tramp needs also a mock method. This is not Fedora's mock, but you might study how Tramp declares it in tramp-tests.el.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.