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
|
|
|
|
source "/etc/makepkg.conf"
|
|
|
|
else
|
|
|
|
echo "/etc/makepkg.conf not found!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Source user-specific makepkg.conf overrides
|
|
|
|
if [ -r ~/.makepkg.conf ]; then
|
|
|
|
source ~/.makepkg.conf
|
|
|
|
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-05-13 10:01:13 +02:00
|
|
|
pkgfile=${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}
|
2009-08-12 22:39:25 +02:00
|
|
|
anypkgfile=${pkgname}-${pkgver}-${pkgrel}-any${PKGEXT}
|
2004-09-28 20:57:58 +02:00
|
|
|
|
2006-03-20 03:48:43 +01:00
|
|
|
if [ ! -f $pkgfile ]; then
|
2007-11-29 04:20:24 +01:00
|
|
|
if [ -f $PKGDEST/$pkgfile ]; then
|
|
|
|
pkgfile=$PKGDEST/$pkgfile
|
2009-08-12 22:39:25 +02:00
|
|
|
anypkgfile=$PKGDEST/$anypkgfile
|
|
|
|
elif [ -f $anypkgfile ]; then
|
|
|
|
pkgfile=$anypkgfile
|
|
|
|
CARCH=any
|
|
|
|
elif [ -f $PKGDEST/$anypkgfile ]; then
|
|
|
|
pkgfile=$PKGDEST/$anypkgfile
|
|
|
|
CARCH=any
|
2007-11-29 04:20:24 +01:00
|
|
|
else
|
|
|
|
echo "File $pkgfile doesn't exist"
|
|
|
|
exit 1
|
|
|
|
fi
|
2004-07-19 07:16:56 +02:00
|
|
|
fi
|
|
|
|
|
2009-04-04 07:00:36 +02:00
|
|
|
# set up repo-specific opts depending on how we were called
|
2009-09-01 03:13:38 +02:00
|
|
|
server="gerolde.archlinux.org"
|
2004-07-19 07:16:56 +02:00
|
|
|
if [ "$cmd" == "extrapkg" ]; then
|
2007-11-29 04:20:24 +01:00
|
|
|
repo="extra"
|
2007-10-02 06:05:18 +02:00
|
|
|
elif [ "$cmd" == "corepkg" ]; then
|
2007-11-29 04:20:24 +01:00
|
|
|
repo="core"
|
2004-07-19 07:16:56 +02:00
|
|
|
elif [ "$cmd" == "testingpkg" ]; then
|
2007-11-29 04:20:24 +01:00
|
|
|
repo="testing"
|
2005-05-17 08:28:33 +02:00
|
|
|
elif [ "$cmd" == "communitypkg" ]; then
|
2007-11-29 04:20:24 +01:00
|
|
|
repo="community"
|
2009-08-03 18:36:57 +02:00
|
|
|
server="aur.archlinux.org"
|
2009-03-03 18:00:56 +01:00
|
|
|
else
|
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
echo "usage: commitpkg <reponame> [-l limit] [commit message]"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
repo="$1"
|
|
|
|
shift
|
2004-07-19 07:16:56 +02:00
|
|
|
fi
|
|
|
|
|
2007-10-02 06:29:01 +02:00
|
|
|
# see if any limit options were passed, we'll send them to SCP
|
|
|
|
unset scpopts
|
|
|
|
if [ "$1" = "-l" ]; then
|
2007-11-29 04:20:24 +01:00
|
|
|
scpopts="$1 $2"
|
|
|
|
shift 2
|
2007-10-02 06:29:01 +02:00
|
|
|
fi
|
|
|
|
|
2009-04-04 07:00:36 +02:00
|
|
|
# combine what we know into a variable
|
|
|
|
uploadto="staging/${repo}/$(basename ${pkgfile})"
|
|
|
|
scp ${scpopts} "${pkgfile}" "${server}:${uploadto}"
|
|
|
|
if [ "$(md5sum "${pkgfile}" | cut -d' ' -f1)" != "$(ssh ${server} md5sum "${uploadto}" | cut -d' ' -f1)" ]; then
|
|
|
|
echo "File got corrupted during upload, cancelled."
|
|
|
|
exit 1
|
2005-05-17 08:28:33 +02:00
|
|
|
else
|
2009-04-04 07:00:36 +02:00
|
|
|
echo "File integrity okay."
|
2005-05-17 08:28:33 +02:00
|
|
|
fi
|
2009-04-04 07:00:36 +02:00
|
|
|
|
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
|
2004-07-19 07:16:56 +02:00
|
|
|
echo "===> Uploaded $pkgfile"
|
2004-08-22 22:24:02 +02:00
|
|
|
|
2004-07-24 05:49:38 +02:00
|
|
|
if [ "$1" != "" ]; then
|
2008-04-06 03:12:16 +02:00
|
|
|
svn commit -m "upgpkg: $pkgname $pkgver-$pkgrel
|
2007-11-29 04:20:24 +01:00
|
|
|
$1" > /dev/null
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "Cancelled"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "===> Commited with \"upgpkg: $pkgname $pkgver-$pkgrel
|
|
|
|
$1\" message"
|
2004-07-24 05:49:38 +02:00
|
|
|
else
|
2009-06-12 17:54:36 +02:00
|
|
|
svn commit >/dev/null
|
2007-11-29 04:20:24 +01:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "Cancelled"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "===> Commited with \"upgpkg: $pkgname $pkgver-$pkgrel\" message"
|
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
|
|
|
|
|
|
|
# vim:ft=sh:ts=4:sw=4:et:
|