abuild: added REPODEST
This will let user specify a directory where the repositories are. Setting REPODEST will override PKGDEST.
This commit is contained in:
parent
df4dd0e688
commit
200eb22b52
15
abuild
15
abuild
@ -10,10 +10,6 @@
|
|||||||
|
|
||||||
abuild_ver=1.4.1
|
abuild_ver=1.4.1
|
||||||
|
|
||||||
# read config
|
|
||||||
MAKEAPK_CONF=${MAKEAPK_CONF:-/etc/abuild.conf}
|
|
||||||
[ -f "$MAKEAPK_CONF" ] && . "$MAKEAPK_CONF"
|
|
||||||
|
|
||||||
# source functions
|
# source functions
|
||||||
# if abuild was not run from PATH, then look for func lib at same location
|
# if abuild was not run from PATH, then look for func lib at same location
|
||||||
if [ -z "$FUNCLIB" ]; then
|
if [ -z "$FUNCLIB" ]; then
|
||||||
@ -32,6 +28,8 @@ startdir="$PWD"
|
|||||||
srcdir=${srcdir:-"$startdir/src"}
|
srcdir=${srcdir:-"$startdir/src"}
|
||||||
pkgdir=${pkgdir:-"$startdir/pkg"}
|
pkgdir=${pkgdir:-"$startdir/pkg"}
|
||||||
pkgrel=0
|
pkgrel=0
|
||||||
|
repo=${startdir%/*}
|
||||||
|
repo=${repo##*/}
|
||||||
|
|
||||||
# defaults
|
# defaults
|
||||||
SRCDEST=${SRCDEST:-$startdir}
|
SRCDEST=${SRCDEST:-$startdir}
|
||||||
@ -40,6 +38,15 @@ BUILD_BASE="binutils gcc make patch uclibc-dev"
|
|||||||
|
|
||||||
default_cmds="sanitycheck builddeps clean fetch unpack rootpkg"
|
default_cmds="sanitycheck builddeps clean fetch unpack rootpkg"
|
||||||
|
|
||||||
|
# read config
|
||||||
|
ABUILD_CONF=${ABUILD_CONF:-"/etc/abuild.conf"}
|
||||||
|
[ -f "$ABUILD_CONF" ] && . "$ABUILD_CONF"
|
||||||
|
|
||||||
|
# If REPODEST is set then it will override the PKGDEST
|
||||||
|
if [ -n "$REPODEST" ]; then
|
||||||
|
PKGDEST="$REPODEST/$repo"
|
||||||
|
fi
|
||||||
|
|
||||||
set_xterm_title() {
|
set_xterm_title() {
|
||||||
if [ "$TERM" = xterm ]; then
|
if [ "$TERM" = xterm ]; then
|
||||||
printf "\033]0;$1\007" >&2
|
printf "\033]0;$1\007" >&2
|
||||||
|
@ -15,4 +15,6 @@ USE_COLORS=1
|
|||||||
#SRCDEST=/var/cache/distfiles
|
#SRCDEST=/var/cache/distfiles
|
||||||
|
|
||||||
# uncomment line below to store built packages in other location
|
# uncomment line below to store built packages in other location
|
||||||
#PKGDEST=/var/lib/packages
|
# The package will be stored as $REPODEST/$repo/$pkgname-$pkgver-r$pkgrel.apk
|
||||||
|
# where $repo is the name of the parent directory of $startdir.
|
||||||
|
#REPODEST=/var/lib/packages/
|
||||||
|
@ -36,6 +36,7 @@ purge() {
|
|||||||
trap 'rm -f "$tmp"; exit 1' INT
|
trap 'rm -f "$tmp"; exit 1' INT
|
||||||
( listpackages "$1") >$tmp
|
( listpackages "$1") >$tmp
|
||||||
ls *.apk 2>/dev/null | grep -v -w -f $tmp | xargs rm 2>/dev/null
|
ls *.apk 2>/dev/null | grep -v -w -f $tmp | xargs rm 2>/dev/null
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
@ -46,7 +47,7 @@ build() {
|
|||||||
|
|
||||||
for i in */APKBUILD; do
|
for i in */APKBUILD; do
|
||||||
( cd ${i%/*} || return 1
|
( cd ${i%/*} || return 1
|
||||||
PKGDEST="$repodir/$repo" abuild -k -r || return 1
|
REPODEST="$repodir" abuild -k -r || return 1
|
||||||
) || return 1
|
) || return 1
|
||||||
done
|
done
|
||||||
cd "$repodir/$repo"
|
cd "$repodir/$repo"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user