summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorP. 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)
commit42c3aaa46c6a109351c8d4c40127205785248713 (patch)
tree2ad0fa7d1cdf5d2d5067387beafe2a8df633c49e /src
parent143be949563795c73e007f64606339c224da120c (diff)
Check if package should be built for target arch.
Diffstat (limited to 'src')
-rw-r--r--src/opkbuild9
1 files changed, 7 insertions, 2 deletions
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.