abuild: create symlink to package in tmprepo
The tmprepo is a temporary repository used by abuild to handle the dependencies of the newly built packages.
This commit is contained in:
parent
2fd4128e20
commit
83f9d177ed
23
abuild.in
23
abuild.in
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# script to build apk packages (light version og makepkg)
|
# script to build apk packages (light version of makepkg)
|
||||||
# Copyright (c) 2008 Natanael Copa <natanael.copa@gmail.com>
|
# Copyright (c) 2008 Natanael Copa <natanael.copa@gmail.com>
|
||||||
#
|
#
|
||||||
# Distributed under GPL-2
|
# Distributed under GPL-2
|
||||||
@ -17,6 +17,7 @@ pkgbasedir=${pkgbasedir:-"$startdir/pkg"}
|
|||||||
pkgrel=0
|
pkgrel=0
|
||||||
repo=${startdir%/*}
|
repo=${startdir%/*}
|
||||||
repo=${repo##*/}
|
repo=${repo##*/}
|
||||||
|
tmprepo=/var/cache/abuild/tmprepo
|
||||||
|
|
||||||
# defaults
|
# defaults
|
||||||
SRCDEST=${SRCDEST:-$startdir}
|
SRCDEST=${SRCDEST:-$startdir}
|
||||||
@ -293,7 +294,6 @@ prepare_metafiles() {
|
|||||||
|
|
||||||
[ ! -d "$dir" ] && die "Missing $dir"
|
[ ! -d "$dir" ] && die "Missing $dir"
|
||||||
cd "$dir"
|
cd "$dir"
|
||||||
msg "Creating ${subpkgname:+sub}package $pkg..."
|
|
||||||
local builddate=$(date -u "+%s")
|
local builddate=$(date -u "+%s")
|
||||||
local size=$(du -sk | awk '{print $1 * 1024}')
|
local size=$(du -sk | awk '{print $1 * 1024}')
|
||||||
|
|
||||||
@ -367,6 +367,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
prepare_package() {
|
prepare_package() {
|
||||||
|
msg "Preparing ${subpkgname:+sub}package ${subpkgname:-$pkgname}..."
|
||||||
options_has "!strip" || stripbin
|
options_has "!strip" || stripbin
|
||||||
prepare_metafiles
|
prepare_metafiles
|
||||||
}
|
}
|
||||||
@ -383,15 +384,29 @@ create_apks() {
|
|||||||
local dir="${file%/.PKGINFO}"
|
local dir="${file%/.PKGINFO}"
|
||||||
local name=$(pkginfo_val pkgname $file)
|
local name=$(pkginfo_val pkgname $file)
|
||||||
local ver=$(pkginfo_val pkgver $file)
|
local ver=$(pkginfo_val pkgver $file)
|
||||||
local apk="$PKGDEST"/$name-$ver.apk
|
local apk=$name-$ver.apk
|
||||||
(
|
(
|
||||||
set *
|
set *
|
||||||
[ "$1" = '*' ] && set --
|
[ "$1" = '*' ] && set --
|
||||||
cd "$dir" && tar -zcf "$apk" $(cat .metafiles) $@
|
cd "$dir" && tar -zcf "$PKGDEST"/$apk $(cat .metafiles) $@
|
||||||
)
|
)
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
update_tmprepo() {
|
||||||
|
if ! up2date; then
|
||||||
|
sanitycheck && builddeps && clean && fetch && unpack && rootpkg || return 1
|
||||||
|
fi
|
||||||
|
local apk
|
||||||
|
for apk in $(listpkg); do
|
||||||
|
ln -sf "$PKGDEST"/$apk "$tmprepo"/$apk
|
||||||
|
done
|
||||||
|
|
||||||
|
# update the tmprepo cache here
|
||||||
|
msg "Updating the cached build repository index..."
|
||||||
|
apk index "$tmprepo"/*.apk | gzip > "$tmprepo"/APK_INDEX.gz
|
||||||
|
}
|
||||||
|
|
||||||
# predefined splitfunc doc
|
# predefined splitfunc doc
|
||||||
default_doc() {
|
default_doc() {
|
||||||
depends="$depends_doc"
|
depends="$depends_doc"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user