https://github.com/Obarun/pacopts
A new little one on the family :).
This very simple scripts tell you if installed packages do not come from obarun repository. It can be useful when a new package is added on obarun database or when you install a new package and you do not pay attention to a dependence.
So from time to time launch it.
I do not make package for it at the moment, just copy and paste the following code below and make it executable
A new little one on the family :).
This very simple scripts tell you if installed packages do not come from obarun repository. It can be useful when a new package is added on obarun database or when you install a new package and you do not pay attention to a dependence.
So from time to time launch it.
I do not make package for it at the moment, just copy and paste the following code below and make it executable
# !/usr/bin/bash
# This script is under license BEER-WARE
# "THE BEER-WARE LICENSE" (Revision 42):
# <eric@ obarun.org> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return. Eric Vidal
shopt -s extglob
# set -e
# . /opt/pacopts/pacopts.conf
# . /opt/pacopts/pacopts_functions
# # Shell color
unset bold reset red bred green bgreen yellow byellow blue bblue
bold=$(tput bold)
reset=$(tput sgr0)
red=$(tput setaf 1)
bred=${bold}$(tput setaf 1)
green=$(tput setaf 2)
bgreen=${bold}$(tput setaf 2)
yellow=$(tput setaf 3)
byellow=${bold}$(tput setaf 3)
blue=$(tput setaf 4)
bblue=${bold}$(tput setaf 4)
readonly bold reset red bred green bgreen yellow byellow blue bblue4
# # Information display by the script
echo_bold(){
local msg=$1; shift
printf "${bold}${msg}${reset}\n" "${@ }" >&1
}
echo_info(){
local msg=$1; shift
printf "${byellow}==>>${msg} ${reset}\n" "${@ }" >&1
}
echo_info_menu(){
local msg=$1; shift
printf "${byellow}${msg} ${reset}\n" "${@ }" >&1
}
echo_retry(){
local msg=$1; shift
printf "${bblue}==>>${msg} ${reset}\n" "${@ }" >&1
}
echo_valid(){
local msg=$1; shift
printf "${bgreen} ->${msg} ${reset}\n" "${@ }" >&1
}
echo_notvalid(){
local msg=$1; shift
printf "${byellow} ->${msg} ${reset}\n" "${@ }" >&1
}
echo_display(){
local msg=$1; shift
printf "${bold}==>>${msg} ${reset}\n" "${@ }" >&1
}
echo_error(){
local msg=$1; shift
printf "${bred} ->${msg} ${reset}\n" "${@ }" >&2
}
answer(){
echo_retry " Please answer y or n :"
}
find_origin(){
local rc ori not check
while read -d "," check;do
printf "\r${bold} -> Check %s package${reset} " "$check"
while read ori; do
# parse ori
ori=${ori# #*/}
ori=${ori%%' '*}
ori=${ori%-nosystemd}
case $ori in
"$check") # echo_valid " $check come from obarun"
unset rc
break;;
"not") # echo_notvalid " $check doesn't come from obarun repository"
unset rc
false+=("$check")
break;;
*)rc=1
continue;;
esac
done < <(yaourt -Qs "$check" | fgrep "obarun" || echo "not")
if [[ $rc == 1 ]]; then
# echo_notvalid " $check doesn't come from obarun repository"
unset rc
false+=("$check")
fi
done <<< "${both[@ ]}"
printf "\n${bold}==>> Finished ${reset}\n"
}
check_package(){
local name item no
local -a both false
local -a installed obarun_db
mapfile -t installed < <(pacman -Qsq)
mapfile -t obarun_db < <(pacman -Slq obarun)
# FILTER : Compare list of installed package and obarun database,
# if exist on twice put it on both table
while read name;do
for item in "${obarun_db[@ ]%-nosystemd}"; do
if [[ "$name" == "$item" ]]; then
both+=("$item,")
fi
done
done < <(pacman -Qsq | sed 's:-nosystemd::')
echo_display " Verifying packages repository"
# check origin of package
find_origin
if ! [ -z "${false[@ ]}" ]; then
printf "${byellow}==>> These/those packages do not come from obarun repository :${reset}\n"
for no in "${false[@ ]}"; do
echo_bold " -> $no"
done
fi
# Remove those following line if you want to install packages directly
# don't forget to use sudo :)
# for i in "${false[@ ]}"; do
# pacman -S obarun/$i
# done
}
# (( EUID == 0 )) || die " You must be run this script with root privileges"
check_package
enjoy :)