removepkg_find_pkg pattern variable
Find packages matching given pattern based on the value of Variables such as ASK and REMOVEALL.
Default behaviour is to use the first matched package.If -u|--unique was specified, ie when REMOVEALL is 2, the package matched must be the only match. Or if, --remove-all (REMOVEALL is 1) all the packages matched are stored( the check for maximum removals allowed is not done here).If --ask was specified (ASK is 1), again all matched packages are stored. (The difference between REMOVALL=1 and ASK=1 is that in case of REMOVEALL=1 all packages are directly selected for removal even if ASK=1 in case the number of matched packages is less than REMOVEPKG_MAXRM. If REMOVEALL is 0, and ASK is 1, all packages matched are asked one by one for users confirmation instead of falling to default behaviour when REMOVEALL and ASK both are zero).
If REMOVEALL is 2, means the user specifically wants to remove a package only if a single match was found.In that case we call meta_find_pkg_unique. Otherwise, if REMOVEALL is 1(ie we remove all packages matching the given pattern if number of such packages is within specified limit) or if ASK mode is active we call to meta_find_pkg to get a list of all matched package.If none of above conditions are met, ie REMOVEALL and ASK are zero, we fall back to default behaviour.We use the first among the matched packages.