Commit 109a3c1e authored by Natanael Copa's avatar Natanael Copa

buildrepo: use CARCH from abuild.conf

parent 060e25d7
......@@ -5,11 +5,17 @@ program=${0##*/}
aportsdir=${APORTSDIR:-$HOME/aports}
repodir=${REPODIR:-$HOME/packages}
machine=$(uname -m)
case $machine in
i[3-9]86) arch=x86;;
*) arch=$machine;;
esac
if [ -f /etc/abuild.conf ]; then
. /etc/abuild.conf
fi
if [ -z "$CARCH" ]; then
machine=$(uname -m)
case $machine in
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment