Tap homebrew/cask-drivers

This commit is contained in:
Rezart Qelibari
2022-05-04 19:10:41 +02:00
parent 957cae89fd
commit c86feb53c5

View File

@@ -140,7 +140,7 @@ function createInstallPrefix() {
function downloadHomebrew() { function downloadHomebrew() {
cd "${homebrew_prefix}/Homebrew" > /dev/null || return 10 cd "${homebrew_prefix}/Homebrew" > /dev/null || return 10
[ -d ".git" ] && return 11 [ -d ".git" ] && return
runAsHomebrewUser git init -q runAsHomebrewUser git init -q
runAsHomebrewUser git config remote.origin.url "${git_homebrew_remote}" runAsHomebrewUser git config remote.origin.url "${git_homebrew_remote}"
runAsHomebrewUser git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*' runAsHomebrewUser git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
@@ -191,6 +191,7 @@ function createLaunchDaemonsPlist() {
local username=${homebrew_username} local username=${homebrew_username}
local launcherName="de.astzweig.macos.launchdaemons.$1" local launcherName="de.astzweig.macos.launchdaemons.$1"
local launcherPath="/Library/LaunchDaemons/${launcherName}.plist" local launcherPath="/Library/LaunchDaemons/${launcherName}.plist"
[[ -f $launcherPath ]] && return
local brewCommand="$2" local brewCommand="$2"
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"> <!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
@@ -230,6 +231,10 @@ function tapHomebrewCaskFonts() {
brew tap homebrew/cask-fonts ${git_homebrew_font_remote} >&! /dev/null brew tap homebrew/cask-fonts ${git_homebrew_font_remote} >&! /dev/null
} }
function tapHomebrewCaskDrivers() {
brew tap homebrew/cask-drivers ${git_homebrew_driver_remote} >&! /dev/null
}
function configure_system() { function configure_system() {
lop -y h1 -- -i 'Install System Homebrew' lop -y h1 -- -i 'Install System Homebrew'
createHomebrewUserIfNeccessary || return 10 createHomebrewUserIfNeccessary || return 10
@@ -245,6 +250,7 @@ function configure_system() {
pushd -q / pushd -q /
indicateActivity 'Tapping homebrew/cask' tapHomebrewCask || return 20 indicateActivity 'Tapping homebrew/cask' tapHomebrewCask || return 20
indicateActivity 'Tapping homebrew/cask-fonts' tapHomebrewCaskFonts || return 21 indicateActivity 'Tapping homebrew/cask-fonts' tapHomebrewCaskFonts || return 21
indicateActivity 'Tapping homebrew/cask-drivers' tapHomebrewCaskDrivers || return 22
popd -q popd -q
} }
@@ -296,6 +302,10 @@ function getDefaultGitHomebrewCaskFontsURL() {
print -- ${HOMEBREW_BREW_CASK_FONTS_GIT_REMOTE:-https://github.com/Homebrew/homebrew-cask-fonts.git} print -- ${HOMEBREW_BREW_CASK_FONTS_GIT_REMOTE:-https://github.com/Homebrew/homebrew-cask-fonts.git}
} }
function getDefaultGitHomebrewCaskDriversURL() {
print -- ${HOMEBREW_BREW_CASK_DRIVERS_GIT_REMOTE:-https://github.com/Homebrew/homebrew-cask-drivers.git}
}
function getQuestions() { function getQuestions() {
questions=( questions=(
'i: homebrew-username=What shall the Homebrew user'\''s username be? # default:'"$(getDefaultHomebrewUsername)" 'i: homebrew-username=What shall the Homebrew user'\''s username be? # default:'"$(getDefaultHomebrewUsername)"
@@ -306,6 +316,7 @@ function getQuestions() {
'i: git-homebrew-core-remote=Which Git repository shall be used to install Homebrew core from? # default:'"$(getDefaultGitHomebrewCoreURL)" 'i: git-homebrew-core-remote=Which Git repository shall be used to install Homebrew core from? # default:'"$(getDefaultGitHomebrewCoreURL)"
'i: git-homebrew-cask-remote=Which Git repository shall be used to install Homebrew cask from? # default:'"$(getDefaultGitHomebrewCaskURL)" 'i: git-homebrew-cask-remote=Which Git repository shall be used to install Homebrew cask from? # default:'"$(getDefaultGitHomebrewCaskURL)"
'i: git-homebrew-font-remote=Which Git repository shall be used to install Homebrew cask-fonts from? # default:'"$(getDefaultGitHomebrewCaskFontsURL)" 'i: git-homebrew-font-remote=Which Git repository shall be used to install Homebrew cask-fonts from? # default:'"$(getDefaultGitHomebrewCaskFontsURL)"
'i: git-homebrew-driver-remote=Which Git repository shall be used to install Homebrew cask-drivers from? # default:'"$(getDefaultGitHomebrewCaskDriversURL)"
) )
} }
@@ -313,27 +324,28 @@ function getUsage() {
read -r -d '' text <<- USAGE read -r -d '' text <<- USAGE
Usage: Usage:
$cmdName show-questions [<modkey> <modans>]... $cmdName show-questions [<modkey> <modans>]...
$cmdName [-v] [-d FILE] --homebrew-prefix PREFIX --homebrew-username NAME --homebrew-cache PATH --homebrew-log PATH --git-homebrew-remote URL --git-homebrew-core-remote URL --git-homebrew-cask-remote URL --git-homebrew-font-remote URL $cmdName [-v] [-d FILE] --homebrew-prefix PREFIX --homebrew-username NAME --homebrew-cache PATH --homebrew-log PATH --git-homebrew-remote URL --git-homebrew-core-remote URL --git-homebrew-cask-remote URL --git-homebrew-font-remote URL --git-homebrew-driver-remote URL
Create a designated Homebrew user who may not login to the system but is the Create a designated Homebrew user who may not login to the system but is the
only one able to install homebrew software systemwide. Install Homebrew at only one able to install homebrew software systemwide. Install Homebrew at
given PREFIX and make the new Homebrew user the owner of that. given PREFIX and make the new Homebrew user the owner of that.
Options: Options:
--homebrew-prefix PREFIX Path to folder that shall be the prefix of --homebrew-prefix PREFIX Path to folder that shall be the prefix of
the system wide Homebrew installation [default: $(getDefaultHomebrewPrefix)]. the system wide Homebrew installation [default: $(getDefaultHomebrewPrefix)].
--git-homebrew-remote URL Git URL to the Homebrew repository [default: $(getDefaultGitHomebrewURL)]. --git-homebrew-remote URL Git URL to the Homebrew repository [default: $(getDefaultGitHomebrewURL)].
--git-homebrew-core-remote URL Git URL to the Homebrew core repository [default: $(getDefaultGitHomebrewCoreURL)]. --git-homebrew-core-remote URL Git URL to the Homebrew core repository [default: $(getDefaultGitHomebrewCoreURL)].
--git-homebrew-cask-remote URL Git URL to the Homebrew cask repository [default: $(getDefaultGitHomebrewCaskURL)]. --git-homebrew-cask-remote URL Git URL to the Homebrew cask repository [default: $(getDefaultGitHomebrewCaskURL)].
--git-homebrew-font-remote URL Git URL to the Homebrew cask-fonts repository [default: $(getDefaultGitHomebrewCaskFontsURL)]. --git-homebrew-font-remote URL Git URL to the Homebrew cask-fonts repository [default: $(getDefaultGitHomebrewCaskFontsURL)].
--homebrew-cache PATH Path to folder that shall be used as the --git-homebrew-driver-remote URL Git URL to the Homebrew cask-drivers repository [default: $(getDefaultGitHomebrewCaskDriversURL)].
cache for Homebrew [default: $(getDefaultHomebrewCachePath)]. --homebrew-cache PATH Path to folder that shall be used as the
--homebrew-log PATH Path to folder that shall be used as the log cache for Homebrew [default: $(getDefaultHomebrewCachePath)].
directory for Homebrew [default: $(getDefaultHomebrewLogPath)]. --homebrew-log PATH Path to folder that shall be used as the log
--homebrew-username NAME Username of the designated Homebrew user. directory for Homebrew [default: $(getDefaultHomebrewLogPath)].
[default: $(getDefaultHomebrewUsername)]. --homebrew-username NAME Username of the designated Homebrew user.
-d FILE, --logfile FILE Print log message to logfile instead of stdout. [default: $(getDefaultHomebrewUsername)].
-v, --verbose Be more verbose. -d FILE, --logfile FILE Print log message to logfile instead of stdout.
-v, --verbose Be more verbose.
---- ----
$cmdName 0.1.0 $cmdName 0.1.0
Copyright (C) 2022 Rezart Qelibari, Astzweig GmbH & Co. KG Copyright (C) 2022 Rezart Qelibari, Astzweig GmbH & Co. KG