Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/pacman.py
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2024-05-10 15:56:28 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2024-05-10 15:56:28 +0200
commit683da22298abbd90f51d4dd38a7ec4b0dfb04555 (patch)
treeec2ac04967f9277df038edc362201937b331abe5 /archinstall/lib/pacman.py
parentaf7ab9833c9f9944874f0162ae0975175ddc628d (diff)
parent3381cd55673e5105697d354cf4a1be9a7bcef062 (diff)
merged with upstreamHEADmaster
Diffstat (limited to 'archinstall/lib/pacman.py')
-rw-r--r--archinstall/lib/pacman.py28
1 files changed, 0 insertions, 28 deletions
diff --git a/archinstall/lib/pacman.py b/archinstall/lib/pacman.py
deleted file mode 100644
index 9c427aff..00000000
--- a/archinstall/lib/pacman.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import logging
-import pathlib
-import time
-
-from .general import SysCommand
-from .output import log
-
-
-def run_pacman(args :str, default_cmd :str = 'pacman') -> SysCommand:
- """
- A centralized function to call `pacman` from.
- It also protects us from colliding with other running pacman sessions (if used locally).
- The grace period is set to 10 minutes before exiting hard if another pacman instance is running.
- """
- pacman_db_lock = pathlib.Path('/var/lib/pacman/db.lck')
-
- if pacman_db_lock.exists():
- log(_('Pacman is already running, waiting maximum 10 minutes for it to terminate.'), level=logging.WARNING, fg="red")
-
- started = time.time()
- while pacman_db_lock.exists():
- time.sleep(0.25)
-
- if time.time() - started > (60 * 10):
- log(_('Pre-existing pacman lock never exited. Please clean up any existing pacman sessions before using archinstall.'), level=logging.WARNING, fg="red")
- exit(1)
-
- return SysCommand(f'{default_cmd} {args}')