diff --git a/pkglocate b/pkglocate new file mode 100755 index 0000000..43c4a64 --- /dev/null +++ b/pkglocate @@ -0,0 +1,13 @@ +#!/bin/sh + +REPO_FILE="/etc/scratchpkg.repo" + +if [ -f "$REPO_FILE" ]; then + for repodir in $(grep -Ev '^(#|$)' "$REPO_FILE" | awk '{print $1}'); do + PORT_REPO="$PORT_REPO $repodir" + done +fi + +for repo in $PORT_REPO; do + grep -R $@ $repo/*/.pkgfiles | sed 's/:/ /;s/\/\.pkgfiles//' | awk '{print $1,$4}' | column -t +done diff --git a/scratch b/scratch index ade0d59..939f06e 100755 --- a/scratch +++ b/scratch @@ -206,6 +206,13 @@ scratch_lock() { done } +scratch_locate() { + needarg $@ + for repo in $PORT_REPO; do + grep -R $@ $repo/*/.pkgfiles | sed 's/:/ /;s/\/\.pkgfiles//' | awk '{print $1,$4}' | column -t + done +} + scratch_unlock() { needroot "Unlocking package" for pkg in "$@"; do @@ -1357,6 +1364,7 @@ Options: readme print readme file, if exist files print files installed info print information + locate print location of files in ports repo sync update ports database outdate print outdated ports cache print and clear old pkg and src caches