Skip to content

Add constant for /etc/pacman.conf#4375

Open
codefiles wants to merge 1 commit intoarchlinux:masterfrom
codefiles:const-pacman-conf
Open

Add constant for /etc/pacman.conf#4375
codefiles wants to merge 1 commit intoarchlinux:masterfrom
codefiles:const-pacman-conf

Conversation

@codefiles
Copy link
Copy Markdown
Contributor

Add the constant PACMAN_CONF for /etc/pacman.conf.

Introduce LPath, a subclass of pathlib.Path, to assist in swapping out the root with a target.

For example:

>>> from pathlib import Path
>>> from archinstall.lib.pathnames import PACMAN_CONF
>>> PACMAN_CONF
LPath('/etc/pacman.conf')
>>> PACMAN_CONF.relative_to_root()
LPath('etc/pacman.conf')
>>> target = Path('/mnt')
>>> pacman_conf = target / PACMAN_CONF.relative_to_root()
>>> pacman_conf
PosixPath('/mnt/etc/pacman.conf')

pathlib.Path has supported subclassing since Python 3.12.

https://docs.python.org/3/whatsnew/3.12.html

If this is merged then the plan will be to move more path constants like this to pathnames.py. I would also add more functionality to LPath to support other types of Linux path operations.

@codefiles codefiles requested a review from Torxed as a code owner April 4, 2026 16:31
@codefiles
Copy link
Copy Markdown
Contributor Author

Thanks Torxed, that was quick. Are you not merging because of the failing ruff checks or something else?

@Torxed
Copy link
Copy Markdown
Member

Torxed commented Apr 4, 2026

Thanks Torxed, that was quick. Are you not merging because of the failing ruff checks or something else?

Mostly since you had an open question for @correctmost, letting them see and respond, also figured @svartkanin probably wanted to take a peek :)

@codefiles
Copy link
Copy Markdown
Contributor Author

Good call. Thank you.

@codefiles codefiles force-pushed the const-pacman-conf branch from da2264b to 21a2a77 Compare April 5, 2026 01:30
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.

3 participants