package-info 359 B

123456789101112131415161718
  1. #!/bin/bash
  2. root="$(readlink -f $(dirname $BASH_SOURCE)/..)";
  3. . $root/etc/packages.conf
  4. unset package;
  5. for val in "${packages[@]}"; do
  6. unset p;
  7. declare -A p;
  8. eval "p=($val)";
  9. if [[ "${p[name]}" == "$1" ]];then
  10. echo "${p[name]}";
  11. for i in "${!p[@]}";do
  12. echo -e "\t$i: ${p[$i]}";
  13. done;
  14. exit 0;
  15. fi;
  16. done;
  17. echo "Package $1 does not exist";
  18. exit 1;