From 42c3aaa46c6a109351c8d4c40127205785248713 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 29 Jan 2012 20:56:36 -0500 Subject: Check if package should be built for target arch. --- diff --git a/TODO b/TODO index ed0363f..21b412d 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,7 @@ TODO: * Fix oh-strip. * Make oh-strip obey a missing '-l' option. - * Handle "Architecture" field in oh-gencontrol, opkbuild, and oh-buildopk. + * Handle "Architecture" field in oh-gencontrol and oh-buildopk. * Check on file ownership and modes. * Finish tar archive handling in opkhelper. * Build packages with copyright information and changelogs. [1][2] diff --git a/src/opkbuild b/src/opkbuild index d85a0ad..b687d4c 100644 --- a/src/opkbuild +++ b/src/opkbuild @@ -20,6 +20,7 @@ # along with this program. If not, see . . @@LIBDIR@@/opkhelper/controlfields +. @@LIBDIR@@/opkhelper/architecture print_usage() { @@ -125,6 +126,9 @@ version=$(oh_get_field Version) # Set environment variables for the build configuration. export OH_PLATFORM="${platform}" export OH_ARCH="${arch}" +echo "${OH_ARCH}" | \ + IFS=- read OH_ARCH_CPU OH_ARCH_VENDOR OH_ARCH_KERNEL OH_ARCH_LIBS +export OH_ARCH_CPU OH_ARCH_VENDOR OH_ARCH_KERNEL OH_ARCH_LIBS export OH_SRCPKG="${srcpkg}" export OH_PKGVER="${version%'-'*}" export OH_PKGREV="${version#*'-'}" @@ -160,8 +164,9 @@ for binpkgdir in ../*.pkg/; do binpkg=${binpkgdir#'../'} binpkg=${binpkg%'.pkg/'} export OH_BINPKG="${binpkg}" - # TODO: Check architecture. - if true; then + # Check architecture. + oh_is_buildable "${binpkg}" + if [ ${?} -eq 0 ]; then printf 'opkbuild: Attempting to build package "%s"...\n' "${binpkg}" # Make installation directory. # TODO: Maybe this should be an FHS-compliant filesystem hierarchy. -- cgit v0.9.1