|
@ -482,12 +482,21 @@ function build_pkg() { |
|
|
local pkgdir |
|
|
local pkgdir |
|
|
local cleanlist |
|
|
local cleanlist |
|
|
local pkgbuild_file |
|
|
local pkgbuild_file |
|
|
|
|
|
local pkg_archive |
|
|
|
|
|
local arch_pkg_validsuffixes |
|
|
|
|
|
|
|
|
pkgname=${1} |
|
|
pkgname=${1} |
|
|
pkgname_friendly=${2} |
|
|
pkgname_friendly=${2} |
|
|
pkgdir=${3} |
|
|
pkgdir=${3} |
|
|
cleanlist=${4} |
|
|
cleanlist=${4} |
|
|
|
|
|
|
|
|
|
|
|
arch_pkg_validsuffixes=( |
|
|
|
|
|
'tar.gz' |
|
|
|
|
|
'tar.xz' |
|
|
|
|
|
'tar.lz' |
|
|
|
|
|
'tar.zst' |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
# Fetch extra files if any defined |
|
|
# Fetch extra files if any defined |
|
|
fetch_extra_pkg_files ${pkgname} ${pkgdir} |
|
|
fetch_extra_pkg_files ${pkgname} ${pkgdir} |
|
|
|
|
|
|
|
@ -548,13 +557,24 @@ function build_pkg() { |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# After successful compilation... |
|
|
# After successful compilation... |
|
|
if [[ $(ls ./${pkgname}-*tar.xz 2>/dev/null | wc -l) -ne 0 ]]; then |
|
|
|
|
|
|
|
|
pkg_archive= |
|
|
|
|
|
for pkg_suffix in "${arch_pkg_validsuffixes[@]}"; do |
|
|
|
|
|
find_suffix=$(find . -mindepth 1 -maxdepth 1 -iname "${pkgname}-*${pkg_suffix}") |
|
|
|
|
|
|
|
|
|
|
|
if [[ ${find_suffix} ]]; then |
|
|
|
|
|
pkg_archive=${find_suffix} |
|
|
|
|
|
break 1 |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
if [[ -f ${pkg_archive} ]]; then |
|
|
|
|
|
|
|
|
if [[ ! -v NO_INSTALL ]]; then |
|
|
if [[ ! -v NO_INSTALL ]]; then |
|
|
yes | sudo pacman -U ${pkgname}-*.tar.xz |
|
|
|
|
|
|
|
|
yes | sudo pacman -U ${pkg_archive} |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
mv ${pkgname}-*.tar.xz ${ARCH_BUILDROOT}/compiled_pkg/${datedir}/ && \ |
|
|
|
|
|
|
|
|
mv ${pkg_archive} ${ARCH_BUILDROOT}/compiled_pkg/${datedir}/ && \ |
|
|
echo -e "\nCompiled ${pkgname_friendly} is stored at '$(readlink -f ${ARCH_BUILDROOT}/compiled_pkg/${datedir}/)/'\n" |
|
|
echo -e "\nCompiled ${pkgname_friendly} is stored at '$(readlink -f ${ARCH_BUILDROOT}/compiled_pkg/${datedir}/)/'\n" |
|
|
for rml in ${cleanlist[*]}; do |
|
|
for rml in ${cleanlist[*]}; do |
|
|
rm -rf "${ARCH_BUILDROOT}/${pkgdir}/${rml}" |
|
|
rm -rf "${ARCH_BUILDROOT}/${pkgdir}/${rml}" |
|
|