buildrepo: use CARCH from abuild.conf
This commit is contained in:
parent
060e25d7de
commit
109a3c1ec8
20
buildrepo.in
20
buildrepo.in
@ -5,11 +5,17 @@ program=${0##*/}
|
||||
aportsdir=${APORTSDIR:-$HOME/aports}
|
||||
repodir=${REPODIR:-$HOME/packages}
|
||||
|
||||
if [ -f /etc/abuild.conf ]; then
|
||||
. /etc/abuild.conf
|
||||
fi
|
||||
|
||||
if [ -z "$CARCH" ]; then
|
||||
machine=$(uname -m)
|
||||
case $machine in
|
||||
i[3-9]86) arch=x86;;
|
||||
*) arch=$machine;;
|
||||
i[3-9]86) CARCH=x86;;
|
||||
*) CARCH=$machine;;
|
||||
esac
|
||||
fi
|
||||
|
||||
usage() {
|
||||
echo "usage: $program [-a APORTSDIR] [-d REPODIR] [-hp] [-l LOGPREFIX ]"
|
||||
@ -73,8 +79,8 @@ build() {
|
||||
# try link or copy the files if they are in the ports dir
|
||||
if all_exist $pkgs; then
|
||||
echo ">>> Copying " $pkgs
|
||||
cp -p -l $pkgs "$repodir/$repo/$arch"/ 2>/dev/null \
|
||||
|| cp -p $pkgs "$repodir/$repo/$arch"/ \
|
||||
cp -p -l $pkgs "$repodir/$repo/$CARCH"/ 2>/dev/null \
|
||||
|| cp -p $pkgs "$repodir/$repo/$CARCH"/ \
|
||||
|| needbuild="$needbuild $i"
|
||||
else
|
||||
needbuild="$needbuild $i"
|
||||
@ -94,7 +100,7 @@ build() {
|
||||
echo ">>> Removing old packages from $repo..."
|
||||
local tmp=$(mktemp /tmp/$program-XXXXXX)
|
||||
local purgefiles
|
||||
cd "$repodir/$repo/$arch" || return 1
|
||||
cd "$repodir/$repo/$CARCH" || return 1
|
||||
trap 'rm -f "$tmp"; exit 1' INT
|
||||
( listpackages "$1") >$tmp
|
||||
purge=$(ls *.apk 2>/dev/null | grep -v -w -f $tmp)
|
||||
@ -106,7 +112,7 @@ build() {
|
||||
|
||||
# generate the repository index
|
||||
echo ">>> Generating Index for $repo..."
|
||||
cd "$repodir/$repo/$arch"
|
||||
cd "$repodir/$repo/$CARCH"
|
||||
local deps
|
||||
for i in $deprepo; do
|
||||
deps="--repo $repodir/$i"
|
||||
@ -116,7 +122,7 @@ build() {
|
||||
oldindex="--index APKINDEX.tar.gz"
|
||||
fi
|
||||
tmpindex=$(mktemp).tar.gz
|
||||
apk index --rewrite-arch $arch $oldindex -o $tmpindex \
|
||||
apk index --rewrite-arch $CARCH $oldindex -o $tmpindex \
|
||||
--description "$repo $(cd $aportsdir && git describe)" \
|
||||
-- *.apk
|
||||
abuild-sign $tmpindex && mv $tmpindex APKINDEX.tar.gz
|
||||
|
Loading…
x
Reference in New Issue
Block a user