summaryrefslogtreecommitdiffstats
path: root/db-functions
diff options
context:
space:
mode:
Diffstat (limited to 'db-functions')
-rw-r--r--db-functions49
1 files changed, 47 insertions, 2 deletions
diff --git a/db-functions b/db-functions
index fbd25e6..4b90d51 100644
--- a/db-functions
+++ b/db-functions
@@ -521,8 +521,8 @@ arch_db_add() {
local tarches=(${@:3})
for tarch in ${tarches[@]}; do
- srcfile="$FTP_BASE/${PKGPOOL}/${pkgfile}"
- dstdir="$FTP_BASE/$repo/os/$tarch"
+ local srcfile="$FTP_BASE/${PKGPOOL}/${pkgfile}"
+ local dstdir="$FTP_BASE/$repo/os/$tarch"
if [[ ! -f "${srcfile}" ]]; then
die "Package file ${pkgfile} not found in ${FTP_BASE}/${PKGPOOL}"
@@ -536,5 +536,50 @@ arch_db_add() {
fi
arch_repo_add "${repo}" "${tarch}" ${pkgfile}
+ arch_history_add "$repo" "$dstdir/$pkgfile" "$tarch"
done
}
+
+arch_db_remove() {
+ local repo=$1
+ local arch=$2
+ local pkgs=(${@:3})
+
+ arch_repo_remove "$@"
+
+ for pkgname in "${pkgs[@]}"; do
+ arch_history_remove "$repo" "$pkgname" "$arch"
+ done
+}
+
+arch_history_add() {
+ local repo="$1"
+ local pkgfile="$2"
+ local tarches="$3"
+ local pkgname=$(getpkgname "$pkgfile")
+ local pkgbase=$(getpkgbase "$pkgfile")
+ local pkgver=$(getpkgver "$pkgfile")
+
+ local history_file="$GITREPO/$repo/$tarch/$pkgname"
+
+ mkdir -p "${history_file%/*}"
+ echo "$pkgbase $pkgver" > "$history_file"
+
+ arch_git add "$history_file"
+}
+
+arch_history_remove() {
+ local repo="$1"
+ local pkgname="$2"
+ local tarches="$3"
+
+ local history_file="$GITREPO/$repo/$tarch/$pkgname"
+ arch_git rm "$history_file"
+}
+
+arch_git() {
+ pushd "$GITREPO"
+ git "$@"
+ popd
+}
+