<commit_before>#!/usr/bin/env sbcl

(require :asdf)

(defconstant *freebsd-type* "FreeBSD")

;-- MAIN

(format t "Hello World!~%")
<commit_msg>Install a few basic packages on FreeBSD<commit_after>#!/usr/bin/env sbcl

(require :asdf)

(defconstant *freebsd-type* "FreeBSD")

(defun freebsd-update ()
  (format t "Checking for FreeBSD patches~%")
  (uiop:run-program (list "/usr/sbin/freebsd-update" "Fetch") :ignore-error-status t)
  (uiop:run-program (list "/usr/sbin/freebsd-update" "install") :ignore-error-status t))

(defun portsnap-fetch-update ()
  (format t "Portsnap refresh of ports~%")
  (uiop:run-program (list "/usr/sbin/portsnap" "--interactive" "fetch" "update") :output nil))

(defun cmd-package-install (a-package)
  (cond ((string= (software-type) *freebsd-type*)
         (format t "FreeBSD pkg installing ~s~%" a-package)
         (uiop:run-program `("/usr/sbin/pkg" "install" "-yqU" ,a-package)))
        (t (error "Platform ~s (~s) on ~s is not supported~%" (software-type) (software-version) (machine-type)))))

(defun cmd-package (a-command a-package)
  (cond ((string= a-command "install") (cmd-package-install a-package))))

;-- MAIN

(format t "Hello World!~%")
(freebsd-update)
(dolist (p '("curl" "git" "bzip2" "zip" "unzip" "bash" "gnutls"))
  (cmd-package "install" p))

(portsnap-fetch-update)
(format t "Installing nginx~%")
(uiop:chdir "/usr/ports/www/nginx-devel")
(uiop:run-program (list "/usr/bin/make" "-DWITH=\"HTTPV2\"" "install" "clean" "BATCH=yes"))

{'fraction_non_alphanumeric': 0.2005365526492287, 'fraction_numerical': 0.0013413816230717639, 'mean_word_length': 4.567164179104478, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7443939', 'n_tokens_mistral': 594, 'n_tokens_neox': 568, 'n_words': 135}