File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ group_list=($( curl -s https://archlinux.org/groups/ | grep " /groups/x86_64" | cut -d " /" -f 4) )
4+
5+ function searchpkg(){
6+ if printf " %s\n" " ${group_list[@]} " | grep -x " ${1} " > /dev/null; then
7+ return 0
8+ fi
9+ # if pacman -Ssq "${1}" 2>/dev/null | grep -o "^${1}*\$" 1>/dev/null; then
10+ if [[ -n " $( curl -sL " https://archlinux.org/packages/search/json/?name=${1} " | jq -r ' .results[]' ) " ]]; then
11+ return 0
12+ elif [[ -n " $( curl -sL " https://archlinux.org/packages/search/json/?q=${1} " | jq -r " .results[].provides[]" ) " ]]; then
13+ return 0
14+ elif [[ -n " $( curl -s https://repo.dyama.net/alter-stable/x86_64/ | grep ' \./' | grep " pkg.tar" | sed " s| ||g" | cut -d ' "' -f 2 | xargs -If basename f | grep " ${1} " ) " ]]; then
15+ return 0
16+ else
17+ return 1
18+ fi
19+ }
20+
21+ function trap_exit() {
22+ local status=" ${?} "
23+ exit " ${status} "
24+ }
25+
26+ trap ' trap_exit' 1 2 3 15
27+
28+ script_path=" $( cd -P " $( dirname " $( readlink -f " $0 " ) " ) " && cd .. && pwd ) "
29+ packages=" $( " ${script_path} /tools/allpkglist.sh" -s -a " x86_64" ) "
30+ error=false
31+
32+ for pkg in ${packages[@]} ; do
33+ if ! searchpkg " ${pkg} " ; then
34+ echo " ${pkg} is not in the official repository." >&2
35+ error=true
36+ fi
37+ done
38+
39+ if [[ " ${error} " = true ]]; then
40+ exit 1
41+ else
42+ exit 0
43+ fi
You can’t perform that action at this time.
0 commit comments