Split funcs to build binpkgs into its own file.
--HG-- extra : convert_revision : a4fd0f4506bd257308936e0d0c0187fa62a840ed
This commit is contained in:
@@ -428,81 +428,3 @@ _EOF
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
xbps_make_binpkg()
|
||||
{
|
||||
local pkg="$1"
|
||||
local subpkg
|
||||
|
||||
for subpkg in ${subpackages}; do
|
||||
if [ "$pkg" = "$pkgname-$subpkg" ]; then
|
||||
. $XBPS_TEMPLATESDIR/$pkgname/$subpkg.template
|
||||
pkgname=${sourcepkg}-${subpkg}
|
||||
set_tmpl_common_vars
|
||||
xbps_make_binpkg_real
|
||||
return $?
|
||||
fi
|
||||
run_template ${sourcepkg}
|
||||
done
|
||||
|
||||
set_tmpl_common_vars
|
||||
xbps_make_binpkg_real
|
||||
return $?
|
||||
}
|
||||
|
||||
#
|
||||
# This function builds a binary package from an installed xbps
|
||||
# package in destdir.
|
||||
#
|
||||
xbps_make_binpkg_real()
|
||||
{
|
||||
local binpkg pkgdir arch use_sudo
|
||||
|
||||
if [ ! -d ${DESTDIR} ]; then
|
||||
echo "$pkgname: unexistent destdir... skipping!"
|
||||
return 0
|
||||
fi
|
||||
|
||||
cd ${DESTDIR}
|
||||
|
||||
if [ -n "$noarch" ]; then
|
||||
arch=noarch
|
||||
else
|
||||
arch=$xbps_machine
|
||||
fi
|
||||
|
||||
if [ -n "$base_chroot" ]; then
|
||||
use_sudo=no
|
||||
else
|
||||
use_sudo=yes
|
||||
fi
|
||||
|
||||
binpkg=$pkgname-$version.$arch.xbps
|
||||
pkgdir=$XBPS_PACKAGESDIR/$arch
|
||||
|
||||
if [ -x ./INSTALL ]; then
|
||||
#
|
||||
# Make sure that INSTALL is the first file on the archive,
|
||||
# this is to ensure that it's run before any other file is
|
||||
# unpacked.
|
||||
#
|
||||
run_rootcmd $use_sudo tar cfp $XBPS_DESTDIR/$binpkg ./INSTALL && \
|
||||
run_rootcmd $use_sudo tar rfp $XBPS_DESTDIR/$binpkg . \
|
||||
--exclude "./INSTALL" \
|
||||
--exclude "./var/db/xbps/metadata/*/flist" && \
|
||||
bzip2 -9 $XBPS_DESTDIR/$binpkg && \
|
||||
mv $XBPS_DESTDIR/$binpkg.bz2 $XBPS_DESTDIR/$binpkg
|
||||
else
|
||||
run_rootcmd $use_sudo tar cfp $XBPS_DESTDIR/$binpkg . \
|
||||
--exclude "./var/db/xbps/metadata/*/flist" && \
|
||||
bzip2 -9 $XBPS_DESTDIR/$binpkg && \
|
||||
mv $XBPS_DESTDIR/$binpkg.bz2 $XBPS_DESTDIR/$binpkg
|
||||
fi
|
||||
if [ $? -eq 0 ]; then
|
||||
[ ! -d $pkgdir ] && mkdir -p $pkgdir
|
||||
mv -f $XBPS_DESTDIR/$binpkg $pkgdir
|
||||
echo "=> Built package: $binpkg"
|
||||
fi
|
||||
|
||||
return $?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user