Skip to content
Snippets Groups Projects
Commit f587f798 authored by Bensong Liu's avatar Bensong Liu
Browse files

working

parent e0978414
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,33 @@ my_path=`where_am_i`
source "$my_path/config.sh"
####################### prepare ##########################
function do_install () {
# do_install $package_name
# NO input, outputs to stderr.
PATH="$my_path:$PATH" yaourt -S --noconfirm "$1" 1>&2
return $?
}
function get_package_list () {
# NO input, NO arg. Result outputs to stdout, seprated by '\n'
pacman -Sy || return $?
if [[ "$aurpar_config_aur_manager" == "yaourt" ]]; then
echo n | "$aurpar_config_aur_manager_path" -Su --aur 2>/dev/null | sed 's/\r/\n/g' | grep '^aur/'
return $?
elif [[ "$aurpar_config_aur_manager" == "pakku" ]]; then
"$aurpar_config_aur_manager_path" -Syup | grep aur.archlinux.org | sed 's/^.*aur.archlinux.org.//g' | sed 's/.git$//g'
return $?
else
echo "ERROR: Unknown package manager '$aurpar_config_aur_manager'. Supports: yaourt, pakku" 1>&2
return 1
fi
}
pkgs=`get_package_list` || { echo "Failed to get package list. Exiting..." 1>&2; exit $?; }
echo "============ Packages to UPGRADE: "
echo "$pkgs"
echo "$pkgs" | parallel --max-procs "$aurpar_config_threads" do_install '{}' || echo "Done. But there is some failure. " 1>&2
exit 0
############ notes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment