Optimized package syncronisation

This commit is contained in:
Kevin Veen-Birkenbach 2020-05-02 14:02:15 +02:00
parent 48a9ed6440
commit 6096238e93
4 changed files with 47 additions and 15 deletions

View File

@ -0,0 +1,28 @@
# programing language interpreters
jdk11-openjdk
python
php
# description language interpreters
texlive-most
# compression tools"
p7zip
# administration tools
git
base-devel
yay
make
gcc
cmake
# network analyze tools
traceroute
wireshark-qt
wireshark-cli
# security tools
ecryptfs-utils
encfs
keepassxc

View File

@ -0,0 +1,4 @@
# This packages will be used in all setup scripts
nano
tree
htop

View File

@ -5,10 +5,11 @@
#
# shellcheck disable=SC2034 #Deactivate checking of unused variables
REPOSITORY_PATH=$(readlink -f "$(dirname "$(readlink -f "${0}")")/../")
REPOSITORY_PATH=$(readlink -f "$(dirname "$(readlink -f "${0}")")/../../") # Propably this can be optimized
PACKAGE_PATH="$REPOSITORY_PATH/configuration/packages/"
ENCRYPTED_PATH="$REPOSITORY_PATH/.encrypted";
DECRYPTED_PATH="$REPOSITORY_PATH/decrypted";
SCRIPT_PATH="$REPOSITORY_PATH/scripts";
SCRIPT_PATH="$REPOSITORY_PATH/scripts/";
DATA_PATH="$DECRYPTED_PATH/data";
BACKUP_PATH="$DECRYPTED_PATH/backup";
TEMPLATE_PATH="$REPOSITORY_PATH/templates";
@ -69,6 +70,14 @@ error(){
exit 1;
}
# @todo May this should be moved to another place
get_packages(){
for package_collection in "$@"
do
sed -e "/^#/d" -e "s/#.*//" "$PACKAGE_PATH""$package_collection.txt" || error "Loading package wasn't possible."
done
}
HEADER(){
echo
echo "${COLOR_YELLOW}The"

View File

@ -10,8 +10,11 @@ SYSTEM_MEMORY_KB="$(grep MemTotal /proc/meminfo | awk '{print $2}')"
info "Start setup of customized core software..."
info "Copying templates to home folder..."
cp -rfv "$TEMPLATE_PATH/." "$HOME" || error "Copy templates failed."
info "Synchronising packages..."
info "Update packages..."
sudo pacman -Syyu || error "Package syncronisation failed."
info "Synchronizing packages..."
get_packages "general" "client" | sudo pacman -S --needed - || error "Syncronisation failed."
exit 1
FSTAB_SWAP_ENTRY="/swapfile none swap defaults 0 0"
SWAP_FILE="/swapfile"
FSTAB_FILE="/etc/fstab"
@ -25,18 +28,6 @@ else
sudo swapon "$SWAP_FILE"
sudo sh -c "echo \"$FSTAB_SWAP_ENTRY\">>\"$FSTAB_FILE\""
fi
info "Synchronizing programing language interpreters..."
sudo pacman --needed -S jdk11-openjdk python php
info "Synchronizing other interpreters..."
sudo pacman --needed -S texlive-most
info "Synchronizing compression tools..."
sudo pacman --needed -S p7zip
info "Synchronizing administration tools..."
sudo pacman --needed -S htop tree git base-devel yay make gcc cmake
info "Synchronizing network analyze tools..."
sudo pacman --needed -S traceroute wireshark-qt wireshark-cli
info "Synchronizing security tools..."
sudo pacman --needed -S ecryptfs-utils encfs keepassxc
info "Setup SSH key..."
ssh_key_path="$HOME/.ssh/id_rsa"
if [ ! -f "$ssh_key_path" ]; then