summaryrefslogtreecommitdiff
path: root/buildrepo.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-02-22 08:34:57 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-02-22 08:34:57 +0000
commit109a3c1ec87dbc5dff9cb9cbf3518b6fca31fd9b (patch)
treebe34244ced522f43c4054339ebcabde30cd3ab93 /buildrepo.in
parent060e25d7de9f7ba4616fb2015de087e31d1b3a2d (diff)
downloadabuild-109a3c1ec87dbc5dff9cb9cbf3518b6fca31fd9b.tar.gz
abuild-109a3c1ec87dbc5dff9cb9cbf3518b6fca31fd9b.tar.bz2
abuild-109a3c1ec87dbc5dff9cb9cbf3518b6fca31fd9b.tar.xz
abuild-109a3c1ec87dbc5dff9cb9cbf3518b6fca31fd9b.zip
buildrepo: use CARCH from abuild.conf
Diffstat (limited to 'buildrepo.in')
-rwxr-xr-xbuildrepo.in26
1 files changed, 16 insertions, 10 deletions
diff --git a/buildrepo.in b/buildrepo.in
index 51031b1..f1a5749 100755
--- a/buildrepo.in
+++ b/buildrepo.in
@@ -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