diff options
author | Florian Pritz <bluewind@xinu.at> | 2014-01-31 17:24:00 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2015-05-27 15:46:04 +0200 |
commit | 5340bef937c5ce288d323873529545ffd5878e21 (patch) | |
tree | 546ad67fecd1109d6d9e8c2c133e6e4858bf6a72 /db-functions | |
parent | c9e8f60aba3477742fd9592e4e7a9416e6f51449 (diff) | |
download | dbscripts-5340bef937c5ce288d323873529545ffd5878e21.tar.gz dbscripts-5340bef937c5ce288d323873529545ffd5878e21.tar.xz |
add historical git repo; fix db-move
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'db-functions')
-rw-r--r-- | db-functions | 49 |
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 +} + |