cpt-extra

Extra utilities for cpt
git clone git://git.carbslinux.org/cpt-extra
Log | Files | Refs | README | LICENSE

cpt-reporevdepends (527B)


      1 #!/bin/sh
      2 # Display packages on the repository which depend on package
      3 # shellcheck disable=2086
      4 
      5 case "$1" in ''|--help|-h) printf 'usage: %s <pkg>\n' "${0##*/}"; exit 0; esac
      6 
      7 pkg="$1"
      8 IFS=:; set -- $CPT_PATH; unset IFS
      9 
     10 for repo do
     11     # Change directory to the upper directory of the repository
     12     # so it outputs packages in this nice looking format.
     13     # repository/package:
     14     cd "$repo/.." ||:
     15     # This grep only checks for the full word
     16     grep "^$pkg\$\|^$pkg\s" -- "${repo##*/}"/*/depends 2>/dev/null ||:
     17 done