diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-04-10 02:33:02 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-04-10 02:33:02 +0200 |
commit | ce1d818e401e640dea188926ab66b7113d0c067f (patch) | |
tree | 7a3795071fb62ca62700a11a845cebe06f16214a /sogrep | |
download | repo-tools-ce1d818e401e640dea188926ab66b7113d0c067f.tar.gz repo-tools-ce1d818e401e640dea188926ab66b7113d0c067f.tar.xz |
initial commit
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} |