[util-pkg] complete #197
This commit is contained in:
parent
c5b3de7f2a
commit
97806edd1a
1 changed files with 11 additions and 6 deletions
|
@ -193,22 +193,26 @@ sign_pkg(){
|
||||||
}
|
}
|
||||||
|
|
||||||
move_to_cache(){
|
move_to_cache(){
|
||||||
msg2 "Moving [%s] to [%s]" "$1" "${pkg_dir}"
|
msg2 "Moving [%s] -> [%s]" "${1##*/}" "${pkg_dir}"
|
||||||
mv $1 ${pkg_dir}/
|
mv $1 ${pkg_dir}/
|
||||||
}
|
}
|
||||||
|
|
||||||
archive_logs(){
|
archive_logs(){
|
||||||
msg2 "Archiving log file ..."
|
msg2 "Archiving log files %s ..." "$1.log.tar.xz"
|
||||||
tar -cJf $1.log.tar.xz $2
|
tar -cJf $1.log.tar.xz $2
|
||||||
}
|
}
|
||||||
|
|
||||||
post_build(){
|
post_build(){
|
||||||
source PKGBUILD
|
source PKGBUILD
|
||||||
local ext='pkg.tar.xz'
|
local ext='pkg.tar.xz' tarch
|
||||||
for pkg in ${pkgname[@]};do
|
for pkg in ${pkgname[@]};do
|
||||||
|
case $arch in
|
||||||
|
any) tarch='any' ;;
|
||||||
|
*) tarch=${target_arch}
|
||||||
|
esac
|
||||||
local ver=$(get_full_version "$pkg") src logsrc
|
local ver=$(get_full_version "$pkg") src logsrc
|
||||||
src=$pkg-$ver-$arch.$ext
|
src=$pkg-$ver-$tarch.$ext
|
||||||
logsrc=
|
|
||||||
if [[ -n $PKGDEST ]];then
|
if [[ -n $PKGDEST ]];then
|
||||||
move_to_cache "$PKGDEST/$src"
|
move_to_cache "$PKGDEST/$src"
|
||||||
else
|
else
|
||||||
|
@ -219,7 +223,8 @@ post_build(){
|
||||||
if [[ -z $LOGDEST ]];then
|
if [[ -z $LOGDEST ]];then
|
||||||
local name=${pkgbase:-$pkgname}
|
local name=${pkgbase:-$pkgname}
|
||||||
local ver=$(get_full_version "$name")
|
local ver=$(get_full_version "$name")
|
||||||
archive_logs "$name-$ver-$arch.log.tar.xz" "$name-$ver-$arch"*.log
|
logsrc=$(find . -maxdepth 1 -name "$name-$ver-$target_arch*.log")
|
||||||
|
archive_logs "$name-$ver-$target_arch" "${logsrc[@]}"
|
||||||
find . -maxdepth 1 -name '*.log' -delete #&> /dev/null
|
find . -maxdepth 1 -name '*.log' -delete #&> /dev/null
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue