diff options
author | Florian Pritz <bluewind@xssn.at> | 2011-01-16 19:35:20 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xssn.at> | 2011-01-16 19:35:20 +0100 |
commit | a596ede1cff7a94a11f2ae9503972cc30fb429bc (patch) | |
tree | 293d598c090537bca8d785a28187063b0c545e34 /relpkg | |
parent | 6605810da359b36f22ae3ee3f0a4ffa9eb1aa33d (diff) | |
download | bin-a596ede1cff7a94a11f2ae9503972cc30fb429bc.tar.gz bin-a596ede1cff7a94a11f2ae9503972cc30fb429bc.tar.xz |
add some nice scripts
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Diffstat (limited to 'relpkg')
-rwxr-xr-x | relpkg | 51 |
1 files changed, 51 insertions, 0 deletions
@@ -0,0 +1,51 @@ +#!/bin/bash + +repodir="/srv/http/sites/bluewind/repo" +host="bluewind.at" +user="web-flo" +dbfile="bluewind.db.tar.gz" +all_arches=(i686 x86_64) + +_startdir="$PWD" + +error() { + echo "ERROR: $@" >&2 + exit 1 +} + +warn() { + echo "WARNING: $@" >&2 +} + +if [[ $# > 0 ]]; then + _dirs="$@" +else + _dirs="." +fi + +for _dir in $_dirs; do + cd "$_startdir/$_dir" + source PKGBUILD + + unset -f build + unset -f package + + for _arch in ${arch[@]}; do + pkgfile="${pkgname}-${pkgver}-${pkgrel}-${_arch}.pkg.tar.xz" + if [[ ! -f "$pkgfile" ]]; then + warn "$pkgfile doesn't exist" + continue + fi + rsync --partial --progress "$pkgfile" "$user@$host://$repodir/$_arch/$pkgfile" + if [[ $_arch == "any" ]]; then + for _arch in ${all_arches[@]}; do + ssh "$user@$host" "ln -sf ../any/$pkgfile $repodir/$_arch/$pkgfile" + ssh "$user@$host" "repo-add -q $repodir/$_arch/$dbfile $repodir/$_arch/$pkgfile" + done + else + ssh "$user@$host" "repo-add -q $repodir/$_arch/$dbfile $repodir/$_arch/$pkgfile" + fi + done + + #ssh "$user@$host" "$repodir/bin/clean_pkg_name" "$pkgname" +done |