summaryrefslogtreecommitdiffstats
path: root/db-functions
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2014-02-01 12:40:49 +0100
committerFlorian Pritz <bluewind@xinu.at>2015-05-27 15:46:04 +0200
commitba0094839da328a6820ced5fe07e32c9630b6b23 (patch)
tree4848a6f472558bbcbd361661317f6e7190a18534 /db-functions
parentbf9c9f045dbd0f329dc914adc2b5ef9d79870f21 (diff)
downloaddbscripts-ba0094839da328a6820ced5fe07e32c9630b6b23.tar.gz
dbscripts-ba0094839da328a6820ced5fe07e32c9630b6b23.tar.xz
make db-move work with pkgnames
Signed-off-by: Florian Pritz <bluewind@xinu.at>
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
+}