mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-16 03:16:19 +02:00
Compare commits
32 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6922cc39f0 | ||
![]() |
61e8cd97fb | ||
![]() |
23aa9719a8 | ||
![]() |
40791b305f | ||
![]() |
db962d9b7c | ||
![]() |
4fb916c824 | ||
![]() |
169c33195f | ||
![]() |
86416b25b3 | ||
![]() |
fd82cb3eb7 | ||
![]() |
54ae50500b | ||
![]() |
bb1ab73c74 | ||
![]() |
219ec9f196 | ||
![]() |
14947cf645 | ||
![]() |
381f91c336 | ||
![]() |
fa47bd1a17 | ||
![]() |
8130fd3846 | ||
![]() |
3d9c9c1b46 | ||
![]() |
70e48eff7a | ||
![]() |
e82825dd6d | ||
![]() |
80061e2051 | ||
![]() |
eebe3a49b7 | ||
![]() |
06b02906b8 | ||
![]() |
71a6d2c895 | ||
![]() |
3b383b50fc | ||
![]() |
29b19aaa8b | ||
![]() |
e1b0d23027 | ||
![]() |
a5651376b4 | ||
![]() |
9561089142 | ||
![]() |
92a83232e3 | ||
![]() |
40251235a8 | ||
![]() |
c9d1b3457c | ||
![]() |
0a35566e2b |
6
Makefile
6
Makefile
@@ -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
|
||||
|
@@ -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"
|
||||
|
89
checkpkg
89
checkpkg
@@ -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
178
commitpkg
@@ -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:
|
||||
|
@@ -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"
|
@@ -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:
|
||||
|
Reference in New Issue
Block a user