summaryrefslogtreecommitdiffstats
path: root/db-functions
diff options
context:
space:
mode:
Diffstat (limited to 'db-functions')
-rw-r--r--db-functions18
1 files changed, 18 insertions, 0 deletions
diff --git a/db-functions b/db-functions
index 05ff1b9..47d23ef 100644
--- a/db-functions
+++ b/db-functions
@@ -598,3 +598,21 @@ arch_history_commit() {
popd
}
+pkgentry_from_db() {
+ local repo="$1"
+ local arch="$2"
+ local pkgname="$3"
+
+ local db="$FTP_BASE/$repo/os/$arch/$repo$DBEXT"
+ local line
+
+ for line in $(tar tf "$db" | sed -n 's#^\([^/]*\)/$#\1#p'); do
+ local name=${line##*/}
+ if [[ ${line%-*-*} = $pkgname ]]; then
+ echo $name
+ return 0
+ fi
+ done
+
+ return 1
+}