diff options
Diffstat (limited to 'sogrep')
-rwxr-xr-x | sogrep | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -0,0 +1,35 @@ +#!/bin/bash + +home="$(dirname "${0}")" +target="${home}/repo" +tmp=$(mktemp -d) +arches=('i686' 'x86_64') +lock='/tmp/mirrorsync.lck' + +[ -f "${lock}" ] && exit 1 + +if [ $# -ne 2 ]; then + echo "usage: $(basename $0) <repo> <soname>" + exit 1 +fi + +repo="${1}" +lib="${2}" + +for arch in ${arches[@]}; do + db=${target}/${repo}/os/${arch}/${repo}.links.tar.gz + if [ -f ${db} ]; then + mkdir -p ${tmp}/${repo}/${arch} + bsdtar -xf ${db} -C ${tmp}/${repo}/${arch} + else + echo "${db} not found!" + exit 1 + fi +done + +for i in $(grep -rl "${lib}" ${tmp}); do + pkg=$(basename $(dirname $i)) + echo ${pkg%-*-*} +done | sort -u + +rm -rf ${tmp} |