2023-11-12 18:45:37 +01:00
|
|
|
#!/usr/bin/env racket
|
|
|
|
#lang racket
|
|
|
|
|
|
|
|
(current-print void)
|
|
|
|
|
|
|
|
(define noint (make-parameter #f))
|
|
|
|
(command-line #:program "sysupdate"
|
|
|
|
#:usage-help "Update the system"
|
|
|
|
#:once-each [("-n" "--noint") "Don't require user interaction" (noint #t)])
|
|
|
|
|
2023-11-14 13:29:27 +01:00
|
|
|
(define failures '())
|
|
|
|
|
2023-11-12 18:45:37 +01:00
|
|
|
(define (cmd exe . args)
|
2023-11-14 13:29:27 +01:00
|
|
|
(match* ((find-executable-path exe) (cons exe args))
|
|
|
|
[(#f argv) (printf "skipping command ~a, command not found\n" argv)]
|
|
|
|
[(exepath argv)
|
|
|
|
(printf ">>> ~a\n" argv)
|
|
|
|
(unless (apply system* exepath args)
|
|
|
|
(set! failures (cons argv failures)))]))
|
2023-11-12 18:45:37 +01:00
|
|
|
|
2023-11-29 22:27:01 +01:00
|
|
|
(cmd "zupper" "update")
|
|
|
|
(cmd "rustup" "update")
|
2023-11-12 18:45:37 +01:00
|
|
|
(apply cmd (if (noint)
|
|
|
|
'("paru" "-Syu" "--noconfirm")
|
|
|
|
'("paru" "-Syu")))
|
2024-03-24 16:08:19 +01:00
|
|
|
(cmd "alecor" "mkcache")
|
2023-11-12 18:45:37 +01:00
|
|
|
(cmd "tldr" "--update")
|
2023-11-14 13:29:27 +01:00
|
|
|
|
|
|
|
(unless (empty? failures)
|
|
|
|
(raise-user-error "The following commands failed:" failures))
|