Skip to content
Snippets Groups Projects
Commit 109a3c1e authored by Natanael Copa's avatar Natanael Copa
Browse files

buildrepo: use CARCH from abuild.conf

parent 060e25d7
No related branches found
No related tags found
No related merge requests found
...@@ -5,11 +5,17 @@ program=${0##*/} ...@@ -5,11 +5,17 @@ program=${0##*/}
aportsdir=${APORTSDIR:-$HOME/aports} aportsdir=${APORTSDIR:-$HOME/aports}
repodir=${REPODIR:-$HOME/packages} repodir=${REPODIR:-$HOME/packages}
machine=$(uname -m) if [ -f /etc/abuild.conf ]; then
case $machine in . /etc/abuild.conf
i[3-9]86) arch=x86;; fi
*) arch=$machine;;
esac if [ -z "$CARCH" ]; then
machine=$(uname -m)
case $machine in
i[3-9]86) CARCH=x86;;
*) CARCH=$machine;;
esac
fi
usage() { usage() {
echo "usage: $program [-a APORTSDIR] [-d REPODIR] [-hp] [-l LOGPREFIX ]" echo "usage: $program [-a APORTSDIR] [-d REPODIR] [-hp] [-l LOGPREFIX ]"
...@@ -73,8 +79,8 @@ build() { ...@@ -73,8 +79,8 @@ build() {
# try link or copy the files if they are in the ports dir # try link or copy the files if they are in the ports dir
if all_exist $pkgs; then if all_exist $pkgs; then
echo ">>> Copying " $pkgs echo ">>> Copying " $pkgs
cp -p -l $pkgs "$repodir/$repo/$arch"/ 2>/dev/null \ cp -p -l $pkgs "$repodir/$repo/$CARCH"/ 2>/dev/null \
|| cp -p $pkgs "$repodir/$repo/$arch"/ \ || cp -p $pkgs "$repodir/$repo/$CARCH"/ \
|| needbuild="$needbuild $i" || needbuild="$needbuild $i"
else else
needbuild="$needbuild $i" needbuild="$needbuild $i"
...@@ -94,7 +100,7 @@ build() { ...@@ -94,7 +100,7 @@ build() {
echo ">>> Removing old packages from $repo..." echo ">>> Removing old packages from $repo..."
local tmp=$(mktemp /tmp/$program-XXXXXX) local tmp=$(mktemp /tmp/$program-XXXXXX)
local purgefiles local purgefiles
cd "$repodir/$repo/$arch" || return 1 cd "$repodir/$repo/$CARCH" || return 1
trap 'rm -f "$tmp"; exit 1' INT trap 'rm -f "$tmp"; exit 1' INT
( listpackages "$1") >$tmp ( listpackages "$1") >$tmp
purge=$(ls *.apk 2>/dev/null | grep -v -w -f $tmp) purge=$(ls *.apk 2>/dev/null | grep -v -w -f $tmp)
...@@ -106,7 +112,7 @@ build() { ...@@ -106,7 +112,7 @@ build() {
# generate the repository index # generate the repository index
echo ">>> Generating Index for $repo..." echo ">>> Generating Index for $repo..."
cd "$repodir/$repo/$arch" cd "$repodir/$repo/$CARCH"
local deps local deps
for i in $deprepo; do for i in $deprepo; do
deps="--repo $repodir/$i" deps="--repo $repodir/$i"
...@@ -116,7 +122,7 @@ build() { ...@@ -116,7 +122,7 @@ build() {
oldindex="--index APKINDEX.tar.gz" oldindex="--index APKINDEX.tar.gz"
fi fi
tmpindex=$(mktemp).tar.gz 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)" \ --description "$repo $(cd $aportsdir && git describe)" \
-- *.apk -- *.apk
abuild-sign $tmpindex && mv $tmpindex APKINDEX.tar.gz abuild-sign $tmpindex && mv $tmpindex APKINDEX.tar.gz
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment