Compare commits

...

32 Commits
0.7.0 ... 0.8.0

Author SHA1 Message Date
Ronald van Haren
6922cc39f0 Move the determination of unique .install files
Move this inside the split packages loop

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-28 11:59:48 -07:00
Eric Bélanger
61e8cd97fb checkpkg: Check package cache for old packages
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-26 13:20:58 -07:00
Eric Bélanger
23aa9719a8 checkpkg: Made wget quiet
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-26 13:20:51 -07:00
Eric Bélanger
40791b305f checkpkg: Added split package support
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-26 13:20:38 -07:00
Francois Charette
db962d9b7c Change loop var CARCH to _arch
This is just better practice, as CARCH means something else in
makepkg.conf

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-26 13:18:27 -07:00
Francois Charette
4fb916c824 Change "uploading to" message to be less ambiguous
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-26 13:18:02 -07:00
Evangelos Foutras
169c33195f commitpkg: tidy quotes and remove unneeded braces
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-06 09:25:09 -07:00
Evangelos Foutras
86416b25b3 Move package verification into a separate function
Also switch to openssl and sha1 checksums.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-06 09:25:00 -07:00
Andrea Scarpino
fd82cb3eb7 makechrootpkg: Ensure SRC/PKGDEST are directories
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-06 09:22:49 -07:00
François Charette
54ae50500b commitpkg: tagged msg is now in archrelease
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-06 09:20:59 -07:00
François Charette
bb1ab73c74 archrelease: exit if working copy is not committed
Check with svn diff if the PKGBUILD etc has been committed,
and exit with an error message if not.

Also moved message from commitpkg to here.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-06 09:20:03 -07:00
François Charette
219ec9f196 checkpkg: Set CARCH=any when arch=any
Fixes FS#16419

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-06 09:18:02 -07:00
Daniel J Griffiths
14947cf645 commitpkg: Fix pushd for any packages
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-23 12:31:19 -07:00
Evangelos Foutras
381f91c336 commitpkg: introduce abort function for errors
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-23 12:06:25 -07:00
Evangelos Foutras
fa47bd1a17 commitpkg: correct svn commit message spacing
[Aaron: Remove trailing whitespace]
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-23 12:02:26 -07:00
Evangelos Foutras
8130fd3846 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>
2009-09-23 12:01:11 -07:00
Evangelos Foutras
3d9c9c1b46 Move initialization code out of the upload loop
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-23 12:00:45 -07:00
Evangelos Foutras
70e48eff7a commitpkg: get rid of tabs and indent comments
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-23 12:00:00 -07:00
Francois Charette
e82825dd6d minor syntax fix
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-21 13:08:59 -07:00
Francois Charette
80061e2051 fix indentation
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-21 13:08:43 -07:00
Eric Bélanger
eebe3a49b7 makechrootpkg: Fixed add_to_db option check
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 15:02:41 -07:00
Aaron Griffin
06b02906b8 makechrootpkg: fixed copying of split packages
This patch fixed copying of packages with splitting (FS#16181)
It also adds missing quotes around chrootdir variable.

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 14:54:50 -07:00
Aaron Griffin
71a6d2c895 Attempted fix for SRCDEST/PKGDEST parsing
- Do *not* overwrite the makepkg.conf in the chroot
- Source global makepkg configs for SRCDEST and PKGDEST

Original commit 4bc819a20e
by Evangelos Foutras <foutrelis@gmail.com>

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 14:04:02 -07:00
Aaron Griffin
3b383b50fc Remove some extra cleanup umounts
Leftovers from when we used to bind-mount PKGDEST and SRCDEST

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 13:30:36 -07:00
Francois Charette
29b19aaa8b Remove refs to commitpkg2any in Makefile
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 13:13:43 -07:00
Francois Charette
e1b0d23027 remove commitpkg2any
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 13:13:08 -07:00
Francois Charette
a5651376b4 Automate rm of repo-*86* when commiting "any" pkg
This commit integrates part of the functionality of commitpkg2any
in the standard commitpkg script. If the package is for arch=any
and there exists ../repos/$repo-{i686,x86_64}, then these are
removed.

NB: I believe commitpkg2any should be removed, as it encourages
converting a pkg to arch=any with the same $pkgver. It is better
practice to wait for a new version before releasing the pkg
with arch=any. It also saves bandwidth!

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 13:12:44 -07:00
Eric Blanger
9561089142 Fixed Makefile to install/uninstall new cmds
communityco, commitpkg2any and rebuildpkgs

Signed-off-by: Eric Blanger <snowmaniscool@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 11:59:48 -07:00
Aaron Griffin
92a83232e3 Revert "Don't copy makepkg.conf into the chroot"
This reverts commit 4bc819a20e.

Temporary revert until we get this sorted out

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 11:56:48 -07:00
Francois Charette
40251235a8 Fix indentation
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 11:55:34 -07:00
Daniel J Griffiths
c9d1b3457c Add support for community-testing repo
[Aaron: Added Makefile entries]
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 11:53:18 -07:00
Dan McGee
0a35566e2b Make commitpkg not lock up without a message 2009-09-14 21:00:30 -05:00
6 changed files with 182 additions and 196 deletions

View File

@@ -9,8 +9,10 @@ install:
ln -sf commitpkg $(DESTDIR)/usr/bin/corepkg
ln -sf commitpkg $(DESTDIR)/usr/bin/testingpkg
ln -sf commitpkg $(DESTDIR)/usr/bin/communitypkg
ln -sf commitpkg $(DESTDIR)/usr/bin/community-testingpkg
# arch{co,release,rm}
install -m 755 archco $(DESTDIR)/usr/bin
install -m 755 communityco $(DESTDIR)/usr/bin
install -m 755 archrelease $(DESTDIR)/usr/bin
install -m 755 archrm $(DESTDIR)/usr/bin
# new chroot tools, only usable by root
@@ -20,6 +22,7 @@ install:
#Additional packaging helper scripts
install -m 755 lddd $(DESTDIR)/usr/bin
install -m 755 finddeps $(DESTDIR)/usr/bin
install -m 755 rebuildpkgs $(DESTDIR)/usr/bin
uninstall:
# remove all files we installed
@@ -29,6 +32,7 @@ uninstall:
rm $(DESTDIR)/usr/bin/corepkg
rm $(DESTDIR)/usr/bin/testingpkg
rm $(DESTDIR)/usr/bin/communitypkg
rm $(DESTDIR)/usr/bin/community-testingpkg
rm $(DESTDIR)/usr/sbin/mkarchroot
rm $(DESTDIR)/usr/sbin/makechrootpkg
rm $(DESTDIR)/usr/bin/lddd
@@ -36,3 +40,5 @@ uninstall:
rm $(DESTDIR)/usr/bin/archco
rm $(DESTDIR)/usr/bin/archrelease
rm $(DESTDIR)/usr/bin/archrm
rm $(DESTDIR)/usr/bin/communityco
rm $(DESTDIR)/usr/bin/rebuildpkgs

View File

@@ -5,7 +5,7 @@ if [ "$1" = "" ]; then
exit 1
fi
if [ ! -f "PKGBUILD" ]; then
if [ ! -f PKGBUILD ]; then
echo "archrelease: PKGBUILD not found"
exit 1
fi
@@ -15,6 +15,12 @@ if [ "$(basename $(readlink -f .))" != "trunk" ]; then
exit 1
fi
if [ "$(svn diff)" != "" ]; then
echo "archrelease: You have not committed your changes yet!"
echo " Please run 'upgpkg' or 'svn commit' first"
exit 1
fi
if [ ! -d ../repos/$1 ]; then
pushd ..
[ -d repos ] || mkdir repos
@@ -46,3 +52,4 @@ else
popd
fi
echo "===> Tagged for $1"

View File

@@ -23,65 +23,72 @@ if [ ! -f PKGBUILD ]; then
fi
source PKGBUILD
pkgfile=${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}
oldstylepkgfile=${pkgname}-${pkgver}-${pkgrel}${PKGEXT}
if [ -f "$(pwd)/$pkgfile" ]; then
pkgfile=$(pwd)/$pkgfile
elif [ -f "$PKGDEST/$pkgfile" ]; then
pkgfile=$PKGDEST/$pkgfile
elif [ -f "$(pwd)/$oldstylepkgfile" ]; then
pkgfile=$(pwd)/$oldstylepkgfile
elif [ -f "$PKGDEST/$oldstylepkgfile" ]; then
pkgfile=$PKGDEST/$oldstylepkgfile
else
echo "File \"$pkgfile\" doesn't exist"
exit 1
if [ "$arch" == "any" ]; then
CARCH="any"
fi
tmp=`pacman -Spd --noconfirm $pkgname`
for _pkgname in ${pkgname[@]}; do
pkgfile=${_pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}
oldstylepkgfile=${_pkgname}-${pkgver}-${pkgrel}${PKGEXT}
if [ $? -ne 0 ]; then
echo "Couldn't download previous package."
if [ -f "$(pwd)/$pkgfile" ]; then
pkgfile=$(pwd)/$pkgfile
elif [ -f "$PKGDEST/$pkgfile" ]; then
pkgfile=$PKGDEST/$pkgfile
elif [ -f "$(pwd)/$oldstylepkgfile" ]; then
pkgfile=$(pwd)/$oldstylepkgfile
elif [ -f "$PKGDEST/$oldstylepkgfile" ]; then
pkgfile=$PKGDEST/$oldstylepkgfile
else
echo "File \"$pkgfile\" doesn't exist"
exit 1
fi
fi
pkgurl=`echo $tmp | rev | cut -d ' ' -f 1 | rev`
tmp=`pacman -Spd --noconfirm $_pkgname`
oldpkg=`strip_url $pkgurl`
if [ "$(basename $oldpkg)" = "$(basename $pkgfile)" ]; then
echo "The built package is the one in the repo right now!"
if [ $? -ne 0 ]; then
echo "Couldn't download previous package for $_pkgname."
exit 1
fi
fi
if [ ! -f $oldpkg ]; then
pkgurl=`echo $tmp | rev | cut -d ' ' -f 1 | rev`
oldpkg=`strip_url $pkgurl`
if [ "$(basename $oldpkg)" = "$(basename $pkgfile)" ]; then
echo "The built package ($_pkgname) is the one in the repo right now!"
exit 1
fi
if [ ! -f $oldpkg ]; then
if echo $pkgurl | grep "^file:///" > /dev/null 2>&1; then
cp `echo $pkgurl | sed 's#^file://##'` .
cp `echo $pkgurl | sed 's#^file://##'` .
elif [ -f $PKGDEST/$oldpkg ]; then
cp $PKGDEST/$oldpkg .
else
wget $pkgurl
wget --quiet $pkgurl
fi
fi
fi
bsdtar tf $oldpkg > filelist-old
bsdtar tf "$pkgfile" > filelist
bsdtar tf $oldpkg > filelist-$_pkgname-old
bsdtar tf "$pkgfile" > filelist-$_pkgname
sort -o filelist filelist
sort -o filelist-old filelist-old
sort -o filelist-$_pkgname filelist-$_pkgname
sort -o filelist-$_pkgname-old filelist-$_pkgname-old
diff filelist-old filelist
diff filelist-$_pkgname-old filelist-$_pkgname
if diff filelist-old filelist | grep '\.so\.' > /dev/null 2>&1; then
if diff filelist-$_pkgname-old filelist-$_pkgname | grep '\.so\.' > /dev/null 2>&1; then
mkdir -p pkg
cd pkg
bsdtar xf "$pkgfile" > /dev/null
for i in `diff ../filelist-old ../filelist | grep \> | grep \.so\. | awk '{print $2}'`; do
echo -n "${i}: "
objdump -p $i | grep SONAME
for i in `diff ../filelist-$_pkgname-old ../filelist-$_pkgname | grep \> | grep \.so\. | awk '{print $2}'`; do
echo -n "${i}: "
objdump -p $i | grep SONAME
done
else
echo "No filename differences"
fi
else
echo "No filename differences for $_pkgname."
fi
done
# vim:ft=sh:ts=4:sw=4:et:

178
commitpkg
View File

@@ -1,119 +1,121 @@
#!/bin/bash
abort() {
echo ${1:-"Cancelled"}
exit 1
}
# Verify that a remote file exists and is identical to a local one
# Usage: package_verify <local path> <remote host> <remote path>
package_verify() {
local remote_checksum=$(ssh $2 openssl sha1 "'$3'" 2>/dev/null |
grep -o '[0-9a-f]\{40\}$')
local local_checksum=$(openssl sha1 "$1" | grep -o '[0-9a-f]\{40\}$')
if [ -n "$remote_checksum" -a "$remote_checksum" == "$local_checksum" ]; then
return 0
fi
return 1
}
# Source makepkg.conf; fail if it is not found
if [ -r "/etc/makepkg.conf" ]; then
source "/etc/makepkg.conf"
source "/etc/makepkg.conf"
else
echo "/etc/makepkg.conf not found!"
exit 1
abort "/etc/makepkg.conf not found!"
fi
# Source user-specific makepkg.conf overrides
if [ -r ~/.makepkg.conf ]; then
source ~/.makepkg.conf
source ~/.makepkg.conf
fi
cmd=$(basename $0)
cmd=$(basename "$0")
if [ ! -f PKGBUILD ]; then
echo "No PKGBUILD file"
exit 1
fi
if [ -z "$CARCH" ]; then
echo "CARCH must be set to a recognized value!"
exit 1
abort "No PKGBUILD file"
fi
source PKGBUILD
pkgbase=${pkgbase:-${pkgname[0]}}
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
pkgfile=$PKGDEST/$pkgfile
elif [ -f $anypkgfile ]; then
pkgfile=$anypkgfile
CARCH=any
elif [ -f $PKGDEST/$anypkgfile ]; then
pkgfile=$PKGDEST/$anypkgfile
CARCH=any
else
echo "File $pkgfile doesn't exist"
exit 1
fi
fi
pkgbase=${pkgbase:-$pkgname}
# 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"
else
if [ $# -eq 0 ]; then
echo "usage: commitpkg <reponame> [-l limit] [commit message]"
exit 1
fi
repo="$1"
shift
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
abort "usage: commitpkg <reponame> [-l limit] [commit message]"
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
unset scpopts
if [ "$1" = "-l" ]; then
scpopts="-l $2"
shift 2
fi
# 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
for _arch in ${arch[@]}; do
echo "===> Uploading to staging/$repo for arch=${_arch}"
for _pkgname in ${pkgname[@]}; do
pkgfile=$_pkgname-$pkgver-$pkgrel-${_arch}$PKGEXT
if [ ! -f $pkgfile -a -f "$PKGDEST/$pkgfile" ]; then
pkgfile="$PKGDEST/$pkgfile"
elif [ ! -f $pkgfile ]; then
echo "File $pkgfile doesn't exist"
# 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 ! package_verify "$pkgfile" $server "$uploadto"; then
scp $scpopts "$pkgfile" $server:"$uploadto" || abort
fi
if ! package_verify "$pkgfile" $server "$uploadto"; then
abort "File got corrupted during upload, cancelled."
else
echo "File integrity okay."
fi
echo "===> Uploaded $pkgfile"
done
if [ -n "$1" ]; then
svn commit -m "upgpkg: $pkgbase $pkgver-$pkgrel
$1" >/dev/null || abort
echo "===> Commited with message:
upgpkg: $pkgbase $pkgver-$pkgrel
$1"
else
echo "File integrity okay."
svn commit || abort
echo "===> Commited"
fi
if [ $? -ne 0 ]; then
echo "Cancelled"
exit 1
fi
echo "===> Uploaded $pkgfile"
archrelease $repo-${_arch} || abort
done
if [ "$1" != "" ]; then
svn commit -m "upgpkg: $pkgbase $pkgver-$pkgrel
$1" > /dev/null
if [ $? -ne 0 ]; then
echo "Cancelled"
exit 1
if [ "${arch[*]}" == "any" ]; then
if [ -d ../repos/$repo-i686 -a -d ../repos/$repo-x86_64 ]; then
pushd ../repos/
svn rm $repo-i686
svn rm $repo-x86_64
svn commit -m "removed $repo-i686 and $repo-x86_64 for $pkgname"
popd
fi
echo "===> Commited with \"upgpkg: $pkgbase $pkgver-$pkgrel
$1\" message"
else
svn commit >/dev/null
if [ $? -ne 0 ]; then
echo "Cancelled"
exit 1
fi
echo "===> Commited with \"upgpkg: $pkgbase $pkgver-$pkgrel\" message"
fi
archrelease $repo-$CARCH
if [ $? -ne 0 ]; then
echo "Cancelled"
exit 1
fi
echo "===> Tagged for $repo-$CARCH"
# vim:ft=sh:ts=4:sw=4:et:

View File

@@ -1,33 +0,0 @@
#!/bin/bash
# This script commits an existing package as an 'any'
# package. It is simply to help aid in the conversion
# to any-based packages
if [ $# -ne 1 ]; then
echo "Syntax: $(basename $0) <repo>"
exit 1
fi
repo=$1
source PKGBUILD
sed -i 's|^arch=.\+$|arch=(any)|' PKGBUILD
svn commit -m "upgpkg: $pkgname $pkgver-$pkgrel
Converted to arch=any" > /dev/null
archrelease $repo-any
if [ $? -ne 0 ]; then
echo "Cancelled"
exit 1
fi
echo "===> Tagged for $repo-any"
pushd ..
svn rm $repo-i686
svn rm $repo-x86_64
svn commit -m "removed $repo-i686 and $repo-x86_64 for $pkgname"
popd
echo "Don't forget to run \"/arch/db-update $repo\" on gerolde"

View File

@@ -104,15 +104,13 @@ if [ ! -d "$chrootdir/root" ]; then
usage
fi
[ -d "$chrootdir/$LAYER" -a "$clean_first" -eq "1" ] && rm -rf "$chrootdir/$LAYER/"
[ -d "$chrootdir/$LAYER" -a "$clean_first" -eq "1" ] && rm -rf "$chrootdir/$LAYER/"
[ -d "$chrootdir/$LAYER" ] || mkdir "$chrootdir/$LAYER"
[ -d "$chrootdir/union" ] || mkdir "$chrootdir/union"
cleanup ()
{
echo "cleaning up unioned mounts"
umount "$chrootdir/union/pkgdest" 2>/dev/null
umount "$chrootdir/union/srcdest" 2>/dev/null
umount "$chrootdir/union"
}
@@ -152,8 +150,6 @@ if [ "$REPACK" != "1" ]; then
rm -rf "$uniondir/build/"*
fi
source $uniondir/etc/makepkg.conf
[ -d "$uniondir/pkgdest" ] || mkdir "$uniondir/pkgdest"
if ! grep "PKGDEST=/pkgdest" "$uniondir/etc/makepkg.conf" >/dev/null 2>&1; then
echo "Setting PKGDEST in makepkg.conf"
@@ -186,10 +182,9 @@ install_files=$(grep "install=" PKGBUILD)
for pkg in ${pkgname[@]}; do
install_files+=' '
install_files+=$(echo $install_files |sed "s/\$pkgname/$pkg/"|sed "s/\${pkgname}/$pkg/")
install_files=$(eval echo $install_files |tr '[:blank:]' '\n'|sort |uniq)
done
install_files=$(eval echo $install_files |tr '[:blank:]' '\n'|sort |uniq)
for f in $install_files;do
install="${f#"install="}"
if [ "$install" != "" -a -f "$install" ]; then
@@ -224,33 +219,34 @@ EOF
chmod +x "$uniondir/chrootbuild"
if mkarchroot -r "/chrootbuild" "$uniondir"; then
source ${WORKDIR}/PKGBUILD
for _pkgname in ${pkgname[@]}; do
pkgfile="${chrootdir}"/union/pkgdest/${_pkgname}-*${PKGEXT}
# Source global makepkg.conf for SRCDEST and PKGDEST vars
[ -f /etc/makepkg.conf ] && source /etc/makepkg.conf
[ -f ~/.makepkg.conf ] && source ~/.makepkg.conf
if [ -n "$add_to_db" -a -e "$pkgfile" ]; then
[ -d "${chrootdir}/union/repo" ] || mkdir -p "${chrootdir}/union/repo"
pushd "${chrootdir}/union/repo" >/dev/null
cp "$pkgfile" .
repo-add repo.db.tar.${DB_COMPRESSION} ${_pkgname}-${pkgver}-${pkgrel}-*${PKGEXT}
popd >/dev/null
fi
for pkgfile in "${chrootdir}"/union/pkgdest/*${PKGEXT}; do
[ -e "$pkgfile" ] || continue
_pkgname=$(basename "$pkgfile")
if [ "$add_to_db" -eq "1" ]; then
[ -d "${chrootdir}/union/repo" ] || mkdir -p "${chrootdir}/union/repo"
pushd "${chrootdir}/union/repo" >/dev/null
cp "$pkgfile" .
repo-add repo.db.tar.${DB_COMPRESSION} "$_pkgname"
popd >/dev/null
fi
if [ -e $pkgfile ]; then
if [ -n "$PKGDEST" ]; then
echo "Moving completed ${_pkgname} package file to ${PKGDEST}"
mv $pkgfile "${PKGDEST}"
else
echo "Moving completed ${_pkgname} package file to ${WORKDIR}"
mv $pkgfile "${WORKDIR}"
fi
fi
if [ -d "$PKGDEST" ]; then
echo "Moving completed ${_pkgname%${PKGEXT}} package file to ${PKGDEST}"
mv "$pkgfile" "${PKGDEST}"
else
echo "Moving completed ${_pkgname%${PKGEXT}} package file to ${WORKDIR}"
mv "$pkgfile" "${WORKDIR}"
fi
done
for f in ${chrootdir}/union/srcdest/*; do
for f in "${chrootdir}"/union/srcdest/*; do
[ -e "$f" ] || continue
if [ -n "$SRCDEST" ]; then
if [ -d "$SRCDEST" ]; then
echo "Moving downloaded source file $(basename $f) to ${SRCDEST}"
mv "$f" "${SRCDEST}"
else
@@ -260,15 +256,16 @@ if mkarchroot -r "/chrootbuild" "$uniondir"; then
done
else
#just in case. We returned 1, make sure we fail
touch ${chrootdir}/union/build/BUILD_FAILED
touch "${chrootdir}/union/build/BUILD_FAILED"
fi
if [ -e ${chrootdir}/union/build/BUILD_FAILED ]; then
if [ -e "${chrootdir}/union/build/BUILD_FAILED" ]; then
echo "Build failed, check $chrootdir/$LAYER/build"
rm ${chrootdir}/union/build/BUILD_FAILED
rm "${chrootdir}/union/build/BUILD_FAILED"
else
rm -rf ${chrootdir}/union/build/*
rm -rf "${chrootdir}"/union/build/*
echo "Build complete"
fi
fi
# vim:ft=sh:ts=4:sw=4:et: