From patchwork Tue Jul 23 17:23:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadym Kochan X-Patchwork-Id: 1135815 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="sLO3P9bs"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45tQLd0Pqvz9s4Y for ; Wed, 24 Jul 2019 03:23:52 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 3EB4686FF9; Tue, 23 Jul 2019 17:23:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lIpDHcouB20w; Tue, 23 Jul 2019 17:23:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 9025A87001; Tue, 23 Jul 2019 17:23:48 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 5B2EB1BF83E for ; Tue, 23 Jul 2019 17:23:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5368787001 for ; Tue, 23 Jul 2019 17:23:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c5eSw4K8PHnZ for ; Tue, 23 Jul 2019 17:23:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by hemlock.osuosl.org (Postfix) with ESMTPS id 586EB86FF9 for ; Tue, 23 Jul 2019 17:23:46 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id m8so8234617lji.7 for ; Tue, 23 Jul 2019 10:23:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=XmE0l9aPIllW9wYS4jC7rHo/qB2yp/QVFBxf9/dVs68=; b=sLO3P9bs8LHkX9+FBHho8PBYDLAQ3k6766q51Oc495UdgKk85L38JZxoglZ5S5uaeU T0PlqcjeZ5f9mUwu6XvPParje0bDeB4dPh0VqikyW/PQLgsYOcGXZhMVZjgQEu0UPtoE C/+A0kDSdud8FkRx42rBCebbj9bTiMxGlbaOIgEGkRYFLe65hnkm/lBSRtLxSwtSlIDK /HrxFXWS3W+uhTovOLc57dP7IIne50cC8yv+JjeDvpH2Q93N9Xs10FCDul5oAFI2Nzzf uigTSEprxFSx12zIgflliCw4wnm+DAUqA24o11yS0i6mZVbLgqlVGtgH055xDLrt6MAx f7nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=XmE0l9aPIllW9wYS4jC7rHo/qB2yp/QVFBxf9/dVs68=; b=TdNG1cWfOoEmufzklib4S8/cZ3avnYJVpgZhbQn7Y3q85M9HJ9ciOVV1mfEGi7TArz uzwtPYjSem7459l1ZClX/2dfnOHGQMn0wJUTuq0pyT+KC9PHvanS7fMU6RPJrDF/wct3 ZUD/4yeGxxeRlcivP2VtWzunbDRsRFonWhrxuApfUSGyI/GTphslorajuNzCeQmA0Xdo V+P+Txdv+GAOgcSImMUSOMUKqBX5G0AH7hoxoAe/NOfRMUyIHN46Da52qbr15dncUlSS WGsU5Zt1/lBqEYPxz3lPH31v1ItlLFnq7k0kiojwlNMtuf8nu8o0SqaRqID3BQun22AJ l4lg== X-Gm-Message-State: APjAAAUO7/JlcuHNe4TRnrmiSzAXvz3rCWD8ii2Y6p22+cUFzazhuUeM AxU4lhvFph589MWae9XbcOWMea1BlT4= X-Google-Smtp-Source: APXvYqxFwD+str0VW870Socd6Con9rUBMwIEoRg59HaFOAd2/bKmD0hxCZeSBZ8Xf+iEeAZIjdb6pQ== X-Received: by 2002:a2e:b0ea:: with SMTP id h10mr34032757ljl.50.1563902624189; Tue, 23 Jul 2019 10:23:44 -0700 (PDT) Received: from pc60716vkochan.x.ow.s (92-130-179-94.pool.ukrtel.net. [94.179.130.92]) by smtp.gmail.com with ESMTPSA id p13sm8163357ljc.39.2019.07.23.10.23.43 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 10:23:43 -0700 (PDT) From: Vadim Kochan To: buildroot@buildroot.org Date: Tue, 23 Jul 2019 20:23:36 +0300 Message-Id: <20190723172336.24010-1-vadim4j@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [Buildroot] [PATCH 1/1] utils/test-pkg: add option to enable NLS support X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vadim Kochan MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Sometimes the package or specific configuration should be build with and without NLS support which requires additionally append NLS related config options or to have separate config file or use additional shell script. So add helper command line option which appends config file with NLS options to the final config file which is now always stored in temporary file before merge it with the default configuration (even only -c was specified). Signed-off-by: Vadim Kochan --- utils/test-pkg | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/utils/test-pkg b/utils/test-pkg index f3b34d5d0d..6a48e039e0 100755 --- a/utils/test-pkg +++ b/utils/test-pkg @@ -16,9 +16,10 @@ main() { local ret nb nb_skip nb_fail nb_legal nb_tc build_dir keep local -a toolchains local pkg_br_name + local with_nls - o='hakc:d:n:p:r:t:' - O='help,all,keep,config-snippet:,build-dir:,number:,package:,random:,toolchains-csv:' + o='hakNc:d:n:p:r:t:' + O='help,all,keep,with-nls,config-snippet:,build-dir:,number:,package:,random:,toolchains-csv:' opts="$(getopt -n "${my_name}" -o "${o}" -l "${O}" -- "${@}")" eval set -- "${opts}" @@ -27,6 +28,7 @@ main() { keep=0 number=0 mode=0 + with_nls=0 toolchains_csv="${TOOLCHAINS_CSV}" while [ ${#} -gt 0 ]; do case "${1}" in @@ -41,6 +43,10 @@ main() { ;; (-c|--config-snippet) cfg="${2}"; shift 2 + + if [ ! -e "${cfg}" ]; then + printf "error: %s: no such file\n" "${cfg}" >&2; exit 1 + fi ;; (-d|--build-dir) dir="${2}"; shift 2 @@ -57,6 +63,9 @@ main() { (-t|--toolchains-csv) toolchains_csv="${2}"; shift 2 ;; + (-N|--with-nls) + with_nls=1; shift 1 + ;; (--) shift; break ;; @@ -65,16 +74,21 @@ main() { trap do_clean INT TERM HUP EXIT + TEMP_CONF=$(mktemp /tmp/test-${pkg}-config.XXXXXX) + if [ -z "${cfg}" ]; then pkg_br_name="${pkg//-/_}" pkg_br_name="BR2_PACKAGE_${pkg_br_name^^}" - TEMP_CONF=$(mktemp /tmp/test-${pkg}-config.XXXXXX) - echo "${pkg_br_name}=y" > ${TEMP_CONF} - cfg="${TEMP_CONF}" + echo "${pkg_br_name}=y" >> ${TEMP_CONF} + else + cat "${cfg}" >> ${TEMP_CONF} fi - if [ ! -e "${cfg}" ]; then - printf "error: %s: no such file\n" "${cfg}" >&2; exit 1 + + if [ ${with_nls} -eq 1 ]; then + echo "BR2_USE_WCHAR=y" >> ${TEMP_CONF} + echo "BR2_SYSTEM_ENABLE_NLS=y" >> ${TEMP_CONF} fi + if [ -z "${dir}" ]; then dir="${HOME}/br-test-pkg" fi @@ -127,7 +141,7 @@ main() { toolchain="$(basename "${toolchainconfig}" .config)" build_dir="${dir}/${toolchain}" printf "%40s [%*d/%d]: " "${toolchain}" ${#nb_tc} ${nb} ${nb_tc} - build_one "${build_dir}" "${toolchainconfig}" "${cfg}" "${pkg}" && ret=0 || ret=${?} + build_one "${build_dir}" "${toolchainconfig}" "${TEMP_CONF}" "${pkg}" && ret=0 || ret=${?} case ${ret} in (0) printf "OK\n";; (1) : $((nb_skip++)); printf "SKIPPED\n";; @@ -251,6 +265,10 @@ Options: Note: the logfile and configuration is always retained, even without this option. + -N, --with-nls + Build with NLS support enabled. Required config options + for NLS support will be automatically enabled. + Example: Testing libcec would require a config snippet that contains: