diff options
author | P. J. McDermott <pjm@nac.net> | 2012-01-29 20:56:36 (EST) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2012-01-29 20:58:25 (EST) |
commit | 42c3aaa46c6a109351c8d4c40127205785248713 (patch) | |
tree | 2ad0fa7d1cdf5d2d5067387beafe2a8df633c49e | |
parent | 143be949563795c73e007f64606339c224da120c (diff) |
Check if package should be built for target arch.
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | src/opkbuild | 9 |
2 files changed, 8 insertions, 3 deletions
@@ -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 <http://www.gnu.org/licenses/>. . @@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. |