1 # This hook registers a XBPS binary package into the specified local repository.
4 local repo
="$1" pkg
="$2" arch
="$3"
6 if [ ! -f ${repo}/${pkg} ]; then
7 msg_error
"Nonexistent binary package ${repo}/${pkg}!\n"
10 printf "%s:%s:%s\n" "${arch}" "${repo}" "${pkg}" >> "${XBPS_STATEDIR}/.${sourcepkg}_register_pkg"
14 local arch
= binpkg
= pkgdir
=
16 if [ -n "$repository" ]; then
17 pkgdir
=$XBPS_REPOSITORY/$repository
19 pkgdir
=$XBPS_REPOSITORY
21 arch
=$XBPS_TARGET_MACHINE
22 binpkg
=${pkgver}.
${arch}.xbps
23 binpkg32
=${pkgname}-32bit-${version}_${revision}.x86_64.xbps
24 binpkg_dbg
=${pkgname}-dbg-${version}_${revision}.${arch}.xbps
27 if [ -f ${pkgdir}/${binpkg} ]; then
28 registerpkg
${pkgdir} ${binpkg}
31 # Register -dbg binpkg if it exists.
32 pkgdir
=$XBPS_REPOSITORY/debug
33 PKGDESTDIR
="${XBPS_DESTDIR}/${XBPS_CROSS_TRIPLET}/${pkgname}-dbg-${version}"
34 if [ -d ${PKGDESTDIR} -a -f ${pkgdir}/${binpkg_dbg} ]; then
35 registerpkg
${pkgdir} ${binpkg_dbg}
38 # Register 32bit binpkg if it exists.
39 if [ "$XBPS_TARGET_MACHINE" != "i686" ]; then
42 if [ -n "$repository" ]; then
43 pkgdir
=$XBPS_REPOSITORY/multilib
/$repository
45 pkgdir
=$XBPS_REPOSITORY/multilib
47 PKGDESTDIR
="${XBPS_DESTDIR}/${pkgname}-32bit-${version}"
48 if [ -d ${PKGDESTDIR} -a -f ${pkgdir}/${binpkg32} ]; then
49 registerpkg
${pkgdir} ${binpkg32} x86_64