Skip to content

Add constant for /etc/pacman.conf - #4375

Merged
Torxed merged 1 commit into
archlinux:masterfrom
codefiles:const-pacman-conf
Apr 5, 2026
Merged

Add constant for /etc/pacman.conf#4375
Torxed merged 1 commit into
archlinux: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
Comment thread archinstall/lib/general/general_menu.py Outdated
@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

Torxed commented Apr 4, 2026

Copy link
Copy Markdown
Member

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
@Torxed
Torxed merged commit 56bec01 into archlinux:master Apr 5, 2026
9 checks passed
@codefiles
codefiles deleted the const-pacman-conf branch April 6, 2026 00:37
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