[feat/arch] update pacman packages diff cmd

Signed-off-by: SouthFox <master@southfox.me>
This commit is contained in:
SouthFox 2024-12-05 11:51:22 +08:00
parent 683054b290
commit cf1f2e06f5

View file

@ -133,13 +133,15 @@ files, and further processed during activation.")))
(display "Nothing to install...!"))) (display "Nothing to install...!")))
(define (arch-get-pacman-package-list) (define (arch-get-pacman-package-list)
(let* ((data (open-input-pipe "pacman -Qqe")) (let* ((explicitly-packages (string-split (read-string (open-input-pipe "pacman -Qqe")) #\newline))
(result (string-split (read-string data) #\newline))) (all-packages (string-split (read-string (open-input-pipe "pacman -Qq")) #\newline)))
(display "Hint: Run \n") (display "Hint: Run \n")
(display (string-append "pacman -R " (string-join (list-difference result arch-user-packages) " ") "\n")) (display (string-append
(display "sync packages.") "pacman -R "
(string-join (list-difference explicitly-packages arch-user-packages) " ") "\n"))
(display "command to sync packages.\n")
(list-difference arch-user-packages result))) (list-difference arch-user-packages all-packages)))
(arch-package-update) (arch-package-update)
(arch-install-packages (arch-get-pacman-package-list)) (arch-install-packages (arch-get-pacman-package-list))