commitpkg: upload all available architectures
Now commitpkg will go through each architecture defined in the PKGBUILD and if all packages are present, it will upload them and run archrelease for that architecture. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
This commit is contained in:
parent
3d9c9c1b46
commit
8130fd3846
34
commitpkg
34
commitpkg
|
@ -20,11 +20,6 @@ if [ ! -f PKGBUILD ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$CARCH" ]; then
|
||||
echo "CARCH must be set to a recognized value!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source PKGBUILD
|
||||
pkgbase=${pkgbase:-${pkgname[0]}}
|
||||
|
||||
|
@ -58,28 +53,25 @@ if [ "$1" = "-l" ]; then
|
|||
shift 2
|
||||
fi
|
||||
|
||||
for CARCH in ${arch[@]}; do
|
||||
echo "===> Uploading to $repo-$CARCH"
|
||||
for _pkgname in ${pkgname[@]}; do
|
||||
pkgfile=${_pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}
|
||||
anypkgfile=${_pkgname}-${pkgver}-${pkgrel}-any${PKGEXT}
|
||||
|
||||
if [ ! -f $pkgfile ]; then
|
||||
if [ -f $PKGDEST/$pkgfile ]; then
|
||||
if [ ! -f $pkgfile -a -f $PKGDEST/$pkgfile ]; then
|
||||
pkgfile=$PKGDEST/$pkgfile
|
||||
elif [ -f $anypkgfile ]; then
|
||||
pkgfile=$anypkgfile
|
||||
CARCH=any
|
||||
elif [ -f $PKGDEST/$anypkgfile ]; then
|
||||
pkgfile=$PKGDEST/$anypkgfile
|
||||
CARCH=any
|
||||
else
|
||||
elif [ ! -f $pkgfile ]; then
|
||||
echo "File $pkgfile doesn't exist"
|
||||
exit 1
|
||||
fi
|
||||
# skip to next architecture
|
||||
continue 2
|
||||
fi
|
||||
|
||||
# combine what we know into a variable
|
||||
uploadto="staging/${repo}/$(basename ${pkgfile})"
|
||||
# don't re-upload the same package (useful for -any sub packages)
|
||||
if [ "$(md5sum "${pkgfile}" | cut -d' ' -f1)" != "$(ssh ${server} md5sum "${uploadto}" | cut -d' ' -f1)" ]; then
|
||||
scp ${scpopts} "${pkgfile}" "${server}:${uploadto}"
|
||||
fi
|
||||
if [ "$(md5sum "${pkgfile}" | cut -d' ' -f1)" != "$(ssh ${server} md5sum "${uploadto}" | cut -d' ' -f1)" ]; then
|
||||
echo "File got corrupted during upload, cancelled."
|
||||
exit 1
|
||||
|
@ -101,8 +93,9 @@ if [ "$1" != "" ]; then
|
|||
echo "Cancelled"
|
||||
exit 1
|
||||
fi
|
||||
echo "===> Commited with \"upgpkg: $pkgbase $pkgver-$pkgrel
|
||||
$1\" message"
|
||||
echo "===> Commited with message:
|
||||
upgpkg: $pkgbase $pkgver-$pkgrel
|
||||
$1"
|
||||
else
|
||||
svn commit
|
||||
if [ $? -ne 0 ]; then
|
||||
|
@ -118,8 +111,9 @@ if [ $? -ne 0 ]; then
|
|||
exit 1
|
||||
fi
|
||||
echo "===> Tagged for $repo-$CARCH"
|
||||
done
|
||||
|
||||
if [ "$CARCH" == "any" ]; then
|
||||
if [ "${arch[*]}" == "any" ]; then
|
||||
if [ -d ../repos/${repo}-i686 -a -d ../repos/${repo}-x86_64 ]; then
|
||||
pushd ..
|
||||
svn rm $repo-i686
|
||||
|
|
Loading…
Reference in New Issue