-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from pascal-zarrad/feature/arch-support
Add support for Arch based distros
- Loading branch information
Showing
5 changed files
with
112 additions
and
43 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# Copyright 2022 Pascal Zarrad | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
#================================================================== | ||
# Script Name : psh-package-management | ||
# Description : Sript that contains functions to work with | ||
# packages on arch based systems. | ||
# Args : - | ||
# Author : Pascal Zarrad | ||
# Email : [email protected] | ||
#================================================================== | ||
|
||
# Check which dependencies are installed and which not | ||
# | ||
# @param $@ All dependencies that should be checked | ||
function packages_installed() { | ||
local dependencies=("$@") | ||
local not_installed=() | ||
for dependency in "${dependencies[@]}" | ||
do | ||
if ! pacman -Qi "$dependency" > /dev/null; then | ||
not_installed=("${not_installed[@]}" "${dependency}") | ||
fi | ||
done | ||
echo "${not_installed[@]}" | ||
} | ||
|
||
# Install dependencies. Use sudo if available. | ||
# | ||
# @param $1 Defines whether to prefix the commands with sudo or not | ||
# @param $2 Defines if the unattended mode is being used | ||
# @param $3 The pace separated packages that need to be installed | ||
function install_apt_packages() { | ||
local use_sudo="${1}" | ||
local start_arg_run_unattended="${2}" | ||
local package_install_command="${3}" | ||
IFS=' ' read -r -a package_install_arguments <<< "$package_install_command" | ||
print_message "The installer has to install the following packages through pacman (using sudo if available): " | ||
print_message "During package installation, an pacman update is done automatically!" | ||
print_message "${COLOR_CYAN}${package_install_command}${COLOR_RESET}" | ||
yes_no_abort_dialog "Do you want to continue? (y/n): " "${start_arg_run_unattended}" | ||
if [ "$use_sudo" -eq 1 ] | ||
then | ||
sudo pacman --noconfirm -Syu "${package_install_arguments[@]}" | ||
else | ||
pacman --noconfirm -Syu "${package_install_arguments[@]}" | ||
fi | ||
install_result="$?" | ||
if [ "$install_result" -ne 0 ]; then | ||
print_error "An error occured during installation of dependencies." | ||
print_error "Please take a look at the problem and revolve the problem manually!" | ||
exit 1 | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,18 +17,12 @@ | |
# | ||
|
||
#================================================================== | ||
# Script Name : wsl-gpg | ||
# Script Name : gpg-tty | ||
# Description : Plugin that puts a export into the .zshrc to use | ||
# the terminal for the gpg password prompt on wsl. | ||
# the terminal for the gpg password prompt. | ||
# Args : - | ||
# Author : Pascal Zarrad | ||
# Email : [email protected] | ||
#================================================================== | ||
|
||
# This fix is only for WSL where gpg is unable to find a spot to prompt for | ||
# the password, so we add a environment variable to fix that. | ||
if grep -q "Microsoft" "/proc/version" || grep -q ".*microsoft-standard*." "/proc/version" | ||
then | ||
write_zshrc "export GPG_TTY=\$(tty)" | ||
echo "Applied wsl-gpg fix to support gpg on wsl!" | ||
fi | ||
write_zshrc "export GPG_TTY=\$(tty)" |