mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2024-12-23 23:42:35 +00:00
buildrepo: fixes for new $repo/$arch layout
This commit is contained in:
parent
9054ea713d
commit
5acc501d8b
13
buildrepo.in
13
buildrepo.in
@ -5,6 +5,11 @@ program=${0##*/}
|
|||||||
aportsdir=${APORTSDIR:-$HOME/aports}
|
aportsdir=${APORTSDIR:-$HOME/aports}
|
||||||
repodir=${REPODIR:-$HOME/packages}
|
repodir=${REPODIR:-$HOME/packages}
|
||||||
|
|
||||||
|
machine=$(uname -m)
|
||||||
|
case $machine in
|
||||||
|
i[3-9]86) arch=x86;;
|
||||||
|
*) arch=$machine;;
|
||||||
|
esac
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "usage: $program [-a APORTSDIR] [-d REPODIR] [-hp] [-l LOGPREFIX ]"
|
echo "usage: $program [-a APORTSDIR] [-d REPODIR] [-hp] [-l LOGPREFIX ]"
|
||||||
@ -56,8 +61,8 @@ build() {
|
|||||||
pkgs=$(abuild listpkg)
|
pkgs=$(abuild listpkg)
|
||||||
if all_exist $pkgs; then
|
if all_exist $pkgs; then
|
||||||
echo ">>> Copying " $pkgs
|
echo ">>> Copying " $pkgs
|
||||||
cp -p -l $pkgs "$repodir/$repo"/ 2>/dev/null \
|
cp -p -l $pkgs "$repodir/$repo/$CARCH"/ 2>/dev/null \
|
||||||
|| cp -p $pkgs "$repodir/$repo"/ \
|
|| cp -p $pkgs "$repodir/$repo/$CARCH"/ \
|
||||||
|| needbuild="$needbuild $i"
|
|| needbuild="$needbuild $i"
|
||||||
else
|
else
|
||||||
needbuild="$needbuild $i"
|
needbuild="$needbuild $i"
|
||||||
@ -88,7 +93,7 @@ build() {
|
|||||||
|
|
||||||
# generate the repository index
|
# generate the repository index
|
||||||
echo ">>> Generating Index for $repo..."
|
echo ">>> Generating Index for $repo..."
|
||||||
cd "$repodir/$repo"
|
cd "$repodir/$repo/$arch"
|
||||||
local deps
|
local deps
|
||||||
for i in $deprepo; do
|
for i in $deprepo; do
|
||||||
deps="--repo $repodir/$i"
|
deps="--repo $repodir/$i"
|
||||||
@ -98,7 +103,7 @@ build() {
|
|||||||
oldindex="--index APKINDEX.tar.gz"
|
oldindex="--index APKINDEX.tar.gz"
|
||||||
fi
|
fi
|
||||||
tmpindex=$(mktemp).tar.gz
|
tmpindex=$(mktemp).tar.gz
|
||||||
apk index $oldindex -o $tmpindex \
|
apk index --rewrite-arch $arch $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
|
||||||
|
Loading…
Reference in New Issue
Block a user