2004-07-19 07:16:56 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
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
|
|
|
|
echo "/etc/makepkg.conf not found!"
|
|
|
|
exit 1
|
|
|
|
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-01 14:23:25 +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
|
2007-11-29 04:20:24 +01:00
|
|
|
echo "No PKGBUILD file"
|
|
|
|
exit 1
|
2004-07-19 07:16:56 +02:00
|
|
|
fi
|
|
|
|
|
2008-08-24 07:13:40 +02:00
|
|
|
if [ -z "$CARCH" ]; then
|
|
|
|
echo "CARCH must be set to a recognized value!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2004-09-28 20:57:58 +02:00
|
|
|
source PKGBUILD
|
2009-09-02 04:35:25 +02:00
|
|
|
pkgbase=${pkgbase:-${pkgname[0]}}
|
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
|
|
|
|
echo "usage: commitpkg <reponame> [-l limit] [commit message]"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
repo="$1"
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
|
|
|
|
# see if any limit options were passed, we'll send them to SCP
|
|
|
|
unset scpopts
|
|
|
|
if [ "$1" = "-l" ]; then
|
|
|
|
scpopts="$1 $2"
|
|
|
|
shift 2
|
|
|
|
fi
|
|
|
|
|
2009-09-02 04:35:25 +02:00
|
|
|
for _pkgname in ${pkgname[@]}; do
|
|
|
|
pkgfile=${_pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}
|
|
|
|
anypkgfile=${_pkgname}-${pkgver}-${pkgrel}-any${PKGEXT}
|
|
|
|
|
|
|
|
if [ ! -f $pkgfile ]; then
|
2009-09-19 14:33:13 +02:00
|
|
|
if [ -f $PKGDEST/$pkgfile ]; then
|
2009-09-02 04:35:25 +02:00
|
|
|
pkgfile=$PKGDEST/$pkgfile
|
2009-09-19 14:33:13 +02:00
|
|
|
elif [ -f $anypkgfile ]; then
|
|
|
|
pkgfile=$anypkgfile
|
|
|
|
CARCH=any
|
|
|
|
elif [ -f $PKGDEST/$anypkgfile ]; then
|
|
|
|
pkgfile=$PKGDEST/$anypkgfile
|
|
|
|
CARCH=any
|
|
|
|
else
|
2009-09-02 04:35:25 +02:00
|
|
|
echo "File $pkgfile doesn't exist"
|
|
|
|
exit 1
|
2009-09-19 14:33:13 +02:00
|
|
|
fi
|
2007-11-29 04:20:24 +01:00
|
|
|
fi
|
2004-07-19 07:16:56 +02:00
|
|
|
|
2009-09-23 18:17:47 +02:00
|
|
|
# combine what we know into a variable
|
2009-09-02 04:35:25 +02:00
|
|
|
uploadto="staging/${repo}/$(basename ${pkgfile})"
|
|
|
|
scp ${scpopts} "${pkgfile}" "${server}:${uploadto}"
|
|
|
|
if [ "$(md5sum "${pkgfile}" | cut -d' ' -f1)" != "$(ssh ${server} md5sum "${uploadto}" | cut -d' ' -f1)" ]; then
|
2009-09-23 18:17:47 +02:00
|
|
|
echo "File got corrupted during upload, cancelled."
|
|
|
|
exit 1
|
2009-09-02 04:35:25 +02:00
|
|
|
else
|
2009-09-23 18:17:47 +02:00
|
|
|
echo "File integrity okay."
|
2009-09-02 04:35:25 +02:00
|
|
|
fi
|
2009-04-04 07:00:36 +02:00
|
|
|
|
2009-09-02 04:35:25 +02:00
|
|
|
if [ $? -ne 0 ]; then
|
2009-09-23 18:17:47 +02:00
|
|
|
echo "Cancelled"
|
|
|
|
exit 1
|
2009-09-02 04:35:25 +02:00
|
|
|
fi
|
|
|
|
echo "===> Uploaded $pkgfile"
|
|
|
|
done
|
2004-08-22 22:24:02 +02:00
|
|
|
|
2004-07-24 05:49:38 +02:00
|
|
|
if [ "$1" != "" ]; then
|
2009-09-02 04:35:25 +02:00
|
|
|
svn commit -m "upgpkg: $pkgbase $pkgver-$pkgrel
|
2007-11-29 04:20:24 +01:00
|
|
|
$1" > /dev/null
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "Cancelled"
|
|
|
|
exit 1
|
|
|
|
fi
|
2009-09-02 04:35:25 +02:00
|
|
|
echo "===> Commited with \"upgpkg: $pkgbase $pkgver-$pkgrel
|
2007-11-29 04:20:24 +01:00
|
|
|
$1\" message"
|
2004-07-24 05:49:38 +02:00
|
|
|
else
|
2009-09-15 04:00:30 +02:00
|
|
|
svn commit
|
2007-11-29 04:20:24 +01:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "Cancelled"
|
|
|
|
exit 1
|
|
|
|
fi
|
2009-09-15 04:00:30 +02:00
|
|
|
echo "===> Commited"
|
2004-07-24 05:49:38 +02:00
|
|
|
fi
|
2004-08-22 22:24:02 +02:00
|
|
|
|
2008-04-06 03:12:16 +02:00
|
|
|
archrelease $repo-$CARCH
|
2004-08-22 22:24:02 +02:00
|
|
|
if [ $? -ne 0 ]; then
|
2007-11-29 04:20:24 +01:00
|
|
|
echo "Cancelled"
|
|
|
|
exit 1
|
2004-08-22 22:24:02 +02:00
|
|
|
fi
|
2008-04-06 03:12:16 +02:00
|
|
|
echo "===> Tagged for $repo-$CARCH"
|
2007-11-29 04:20:24 +01:00
|
|
|
|
2009-09-19 10:52:47 +02:00
|
|
|
if [ "$CARCH" == "any" ]; then
|
2009-09-18 21:39:37 +02:00
|
|
|
if [ -d ../repos/${repo}-i686 -a -d ../repos/${repo}-x86_64 ]; then
|
|
|
|
pushd ..
|
|
|
|
svn rm $repo-i686
|
|
|
|
svn rm $repo-x86_64
|
|
|
|
svn commit -m "removed $repo-i686 and $repo-x86_64 for $pkgname"
|
|
|
|
popd
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2007-11-29 04:20:24 +01:00
|
|
|
# vim:ft=sh:ts=4:sw=4:et:
|