From cc27b1a54a96531bb7963a6643bd1ea019733011 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 3 Nov 2008 08:38:38 +0100 Subject: [PATCH] Added a new var for templates: only_for_archs. This accepts a list of archs where the package makes sense. Use this in the glibc32 pkg and restrict it to x86_64. --HG-- extra : convert_revision : 4d64b281e1f2ab6b104d43a1f37def1ec767b0a1 --- templates/glibc32.tmpl | 2 ++ xbps.sh | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/templates/glibc32.tmpl b/templates/glibc32.tmpl index ae567e3583d..1765b805092 100644 --- a/templates/glibc32.tmpl +++ b/templates/glibc32.tmpl @@ -24,6 +24,8 @@ long_desc=" This version is only for 64 bits systems." +# This package doesn't make sense on 32bit systems. +only_for_archs=x86_64 cross_compiler=yes base_package=yes build_depends="perl-5.10.0" diff --git a/xbps.sh b/xbps.sh index 0fdd9d25525..b81c9c8a14a 100755 --- a/xbps.sh +++ b/xbps.sh @@ -237,6 +237,7 @@ reset_tmpl_vars() tar_override_cmd xml_entries sgml_entries \ build_depends libtool_fixup_la_stage no_fixup_libtool \ disable_parallel_build run_depends cross_compiler \ + only_for_archs \ XBPS_EXTRACT_DONE XBPS_CONFIGURE_DONE \ XBPS_BUILD_DONE XBPS_INSTALL_DONE" @@ -272,6 +273,7 @@ setup_tmpl() prepare_tmpl() { local i= + local found= # # There's nothing of interest if we are a meta template. @@ -288,6 +290,13 @@ prepare_tmpl() fi done + for i in ${only_for_archs}; do + [ "$i" = "$xbps_machine" ] && found=si && break + done + if [ -n ${only_for_archs} -a -z $found ]; then + msg_error "this package is only for: ${only_for_archs}." + fi + unset XBPS_EXTRACT_DONE XBPS_APPLYPATCHES_DONE unset XBPS_CONFIGURE_DONE XBPS_BUILD_DONE XBPS_INSTALL_DONE @@ -1386,18 +1395,9 @@ unstow_pkg() # while getopts "Cc:" opt; do case $opt in - C) - dontrm_builddir=yes - ;; - c) - config_file_specified=yes - XBPS_CONFIG_FILE="$OPTARG" - shift - ;; - --) - shift - break - ;; + C) dontrm_builddir=yes;; + c) config_file_specified=yes; XBPS_CONFIG_FILE="$OPTARG";; + --) shift; break;; esac done shift $(($OPTIND - 1))