2004-07-19 07:16:56 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2009-09-23 21:06:25 +02:00
|
|
|
abort() {
|
|
|
|
echo ${1:-"Cancelled"}
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2009-09-25 10:02:32 +02:00
|
|
|
|
2008-01-13 20:53:29 +01:00
|
|
|
# Source makepkg.conf; fail if it is not found
|
|
|
|
if [ -r "/etc/makepkg.conf" ]; then
|
2009-09-23 18:17:47 +02:00
|
|
|
source "/etc/makepkg.conf"
|
2008-01-13 20:53:29 +01:00
|
|
|
else
|
2009-09-23 21:06:25 +02:00
|
|
|
abort "/etc/makepkg.conf not found!"
|
2008-01-13 20:53:29 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Source user-specific makepkg.conf overrides
|
|
|
|
if [ -r ~/.makepkg.conf ]; then
|
2009-09-23 18:17:47 +02:00
|
|
|
source ~/.makepkg.conf
|
2008-01-13 20:53:29 +01:00
|
|
|
fi
|
2004-07-19 07:16:56 +02:00
|
|
|
|
2009-09-25 10:02:33 +02:00
|
|
|
cmd=$(basename "$0")
|
2004-07-19 07:16:56 +02:00
|
|
|
|
2004-09-28 20:57:58 +02:00
|
|
|
if [ ! -f PKGBUILD ]; then
|
2009-09-23 21:06:25 +02:00
|
|
|
abort "No PKGBUILD file"
|
2004-07-19 07:16:56 +02:00
|
|
|
fi
|
|
|
|
|
2004-09-28 20:57:58 +02:00
|
|
|
source PKGBUILD
|
2009-09-25 10:02:33 +02:00
|
|
|
pkgbase=${pkgbase:-$pkgname}
|
2004-09-28 20:57:58 +02:00
|
|
|
|
2009-09-23 18:17:48 +02:00
|
|
|
# set up repo-specific opts depending on how we were called
|
|
|
|
server="gerolde.archlinux.org"
|
|
|
|
if [ "$cmd" == "extrapkg" ]; then
|
|
|
|
repo="extra"
|
|
|
|
elif [ "$cmd" == "corepkg" ]; then
|
|
|
|
repo="core"
|
|
|
|
elif [ "$cmd" == "testingpkg" ]; then
|
|
|
|
repo="testing"
|
|
|
|
elif [ "$cmd" == "communitypkg" ]; then
|
|
|
|
repo="community"
|
|
|
|
server="aur.archlinux.org"
|
|
|
|
elif [ "$cmd" == "community-testingpkg" ]; then
|
|
|
|
repo="community-testing"
|
|
|
|
server="aur.archlinux.org"
|
|
|
|
else
|
|
|
|
if [ $# -eq 0 ]; then
|
2009-09-23 21:06:25 +02:00
|
|
|
abort "usage: commitpkg <reponame> [-l limit] [commit message]"
|
2009-09-23 18:17:48 +02:00
|
|
|
fi
|
|
|
|
repo="$1"
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
|
2010-02-11 15:19:13 +01:00
|
|
|
# check if all local source files are under version control
|
2010-02-11 23:48:06 +01:00
|
|
|
(for s in ${source[@]} $install; do
|
2010-02-11 15:19:13 +01:00
|
|
|
echo $s | grep -vq '://' && \
|
|
|
|
svn status $s | grep -q '?' && \
|
|
|
|
abort "$s is not under version control"
|
|
|
|
done) || true
|
|
|
|
|
2010-02-11 15:27:24 +01:00
|
|
|
# see if any limit options were passed, we'll send them to rsync
|
2010-02-11 13:53:30 +01:00
|
|
|
unset rsyncopts
|
2009-09-23 18:17:48 +02:00
|
|
|
if [ "$1" = "-l" ]; then
|
2010-02-11 13:53:30 +01:00
|
|
|
rsyncopts="--bwlimit=$2"
|
2009-09-23 18:17:48 +02:00
|
|
|
shift 2
|
|
|
|
fi
|
|
|
|
|
2010-02-13 04:03:10 +01:00
|
|
|
echo -n 'committing changes to trunk...'
|
2010-02-11 13:53:30 +01:00
|
|
|
if [ -n "$1" ]; then
|
2010-02-11 14:01:45 +01:00
|
|
|
svn commit -q -m "upgpkg: $pkgbase $pkgver-$pkgrel
|
|
|
|
$1" || abort
|
2010-02-11 13:53:30 +01:00
|
|
|
else
|
2010-02-11 14:01:45 +01:00
|
|
|
svn commit -q || abort
|
2010-02-11 13:53:30 +01:00
|
|
|
fi
|
2010-02-13 04:03:10 +01:00
|
|
|
echo 'done'
|
2010-02-11 13:53:30 +01:00
|
|
|
|
2009-10-21 10:20:31 +02:00
|
|
|
for _arch in ${arch[@]}; do
|
2009-09-23 18:17:49 +02:00
|
|
|
for _pkgname in ${pkgname[@]}; do
|
2009-10-21 10:20:31 +02:00
|
|
|
pkgfile=$_pkgname-$pkgver-$pkgrel-${_arch}$PKGEXT
|
2009-09-02 04:35:25 +02:00
|
|
|
|
2009-09-25 10:02:33 +02:00
|
|
|
if [ ! -f $pkgfile -a -f "$PKGDEST/$pkgfile" ]; then
|
|
|
|
pkgfile="$PKGDEST/$pkgfile"
|
2009-09-23 18:17:49 +02:00
|
|
|
elif [ ! -f $pkgfile ]; then
|
2010-02-13 04:03:10 +01:00
|
|
|
echo "skipping ${_arch}"
|
2009-09-23 18:17:49 +02:00
|
|
|
continue 2
|
|
|
|
fi
|
|
|
|
|
2010-02-13 04:03:10 +01:00
|
|
|
echo -n 'uploading '
|
2010-02-12 01:07:45 +01:00
|
|
|
rsync -c -h --progress $rsyncopts "${pkgfile}" -e ssh $server:staging/$repo || abort
|
2009-09-23 18:17:49 +02:00
|
|
|
done
|
2009-10-21 10:20:31 +02:00
|
|
|
archrelease $repo-${_arch} || abort
|
2009-09-02 04:35:25 +02:00
|
|
|
done
|
2004-08-22 22:24:02 +02:00
|
|
|
|
2009-09-23 18:17:49 +02:00
|
|
|
if [ "${arch[*]}" == "any" ]; then
|
2009-09-25 10:02:33 +02:00
|
|
|
if [ -d ../repos/$repo-i686 -a -d ../repos/$repo-x86_64 ]; then
|
2010-02-12 01:11:59 +01:00
|
|
|
pushd ../repos/ >/dev/null
|
2010-02-13 04:03:10 +01:00
|
|
|
echo -n "removing $repo-i686 and $repo-x86_64..."
|
2009-09-18 21:39:37 +02:00
|
|
|
svn rm $repo-i686
|
|
|
|
svn rm $repo-x86_64
|
2010-02-13 04:03:10 +01:00
|
|
|
svn commit -q -m "removed $repo-i686 and $repo-x86_64 for $pkgname"
|
|
|
|
echo 'done'
|
2010-02-12 01:11:59 +01:00
|
|
|
popd >/dev/null
|
2009-09-18 21:39:37 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2007-11-29 04:20:24 +01:00
|
|
|
# vim:ft=sh:ts=4:sw=4:et:
|