From 920f14a8c9ec4cdf8e50f5ba0c652de4dec83085 Mon Sep 17 00:00:00 2001 From: Remy Marquis Date: Wed, 20 Jul 2011 11:58:21 +0200 Subject: [PATCH] added ClassifyPkgs() --- pacaur | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pacaur b/pacaur index 0869d93b..13c8654e 100644 --- a/pacaur +++ b/pacaur @@ -516,6 +516,20 @@ Core() { CleanUp ${deps[@]} } +ClassifyPkgs() { +if [[ $fallback = true ]]; then + [[ $repo ]] && repopkgs=${pkgs[@]} + [[ $aur ]] && aurpkgs=${pkgs[@]} + if [[ ! $repo && ! $aur ]]; then + for package in ${pkgs[@]}; do + [[ $($pacmanBin -S --print $package 2>&1 | grep -v "error:") == "" ]] && aurpkgs+=("$package") || repopkgs+=("$package") + done + fi +else + [[ ! $aur ]] && repopkgs=${pkgs[@]} || aurpkgs=${pkgs[@]} +fi +} + # sanity check [[ ! -d $buildDir ]] && error "Build directory does not exist!\nCheck configuration in /etc/${name}.conf" [[ ! -f /usr/bin/$pacmanBin ]] && error "Pacman binary does not exist!\nCheck configuration in /etc/${name}.conf"