added exclude packages script

This commit is contained in:
2023-08-10 14:37:56 +02:00
parent f8952ca848
commit 0bf823d72e
4 changed files with 49 additions and 4 deletions
+1 -1
View File
@@ -1 +1 @@
picom.conf##class.arch_laptop
picom.conf##class.arch_desktop
+40
View File
@@ -0,0 +1,40 @@
# read list of packages to exclude from update
exclude_list_file=~/.setup/packages/exclude_from_updating.list
exclude_list=$(cat $exclude_list_file)
pacman_config_file=/etc/pacman.conf
# get current IngorePkg line from pacman.conf
# line may have # at the beginning
old_ignore_line=$(grep -P "^#?IgnorePkg" $pacman_config_file)
echo old_ignore_line: $old_ignore_line
# split line at = and take second part
old_packages_line=$(echo $old_ignore_line | cut -d= -f2)
echo old_packages_line: $old_packages_line
# extract list of packages from line, separated by spaces
old_ignore_packages=$(echo $old_packages_line| tr -s ' ' '\n')
echo old_packages: $old_packages
# add packages to ignore line, if not already there
new_ignore_packages=$old_ignore_packages
for package in $exclude_list; do
if [[ ! $old_ignore_packages =~ $package ]]; then
new_ignore_packages="$new_ignore_packages $package"
fi
done
# join packages with spaces
new_ignore_packages_line=$(echo $new_ignore_packages | tr '\n' ' ')
echo new_ignore_packages_line: $new_ignore_packages_line
# add IgnorePkg= to beginning of line
new_ignore_line="IgnorePkg = $new_ignore_packages_line"
echo new_ignore_line: $new_ignore_line
# replace old IgnorePkg line with new one
echo "updating pacman.conf"
sudo sed -i "s/$old_ignore_line/$new_ignore_line/" $pacman_config_file
echo "done"
@@ -0,0 +1,2 @@
cuda
cudnn
+6 -3
View File
@@ -32,9 +32,6 @@ if [ -d $HOME/.local/bin ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
# add the custom functions from the .custom_functions file
custom_func_dir=$HOME/.scripts
for f in $custom_func_dir/*; do source $f; done
# key bindings
# create a zkbd compatible hash;
@@ -151,3 +148,9 @@ bindkey '5C' forward-word
bindkey '^[[3~' delete-char
powerline-config tmux setup
alias vim=nvim
# add the custom functions from the .custom_functions file
custom_func_dir=$HOME/.scripts
for f in $custom_func_dir/*; do source $f; done