mirror of
https://github.com/outbackdingo/scratchpkg.git
synced 2026-02-05 08:28:00 +00:00
add locate function
This commit is contained in:
13
pkglocate
Executable file
13
pkglocate
Executable file
@@ -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
|
||||
8
scratch
8
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 <port> print readme file, if exist
|
||||
files <port> print files installed
|
||||
info <port> print information
|
||||
locate <files> print location of files in ports repo
|
||||
sync update ports database
|
||||
outdate print outdated ports
|
||||
cache print and clear old pkg and src caches
|
||||
|
||||
Reference in New Issue
Block a user