From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SZohi-00018I-06 for garchives@archives.gentoo.org; Wed, 30 May 2012 19:37:10 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 973FBE07A1; Wed, 30 May 2012 19:36:57 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 66862E07A1 for ; Wed, 30 May 2012 19:36:57 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6CA591B4036 for ; Wed, 30 May 2012 19:36:56 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 0968FE5428 for ; Wed, 30 May 2012 19:36:55 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1338401024.4244739b888da20e9203b2ccd6c16978790865e7.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: / X-VCS-Repository: proj/R_overlay X-VCS-Files: test_ebuildcreation.sh X-VCS-Directories: / X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 4244739b888da20e9203b2ccd6c16978790865e7 X-VCS-Branch: master Date: Wed, 30 May 2012 19:36:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: f62ca835-0b29-471f-bc24-b95267dc08bd X-Archives-Hash: 1eee1a10462173b4628194e2e9d67e49 commit: 4244739b888da20e9203b2ccd6c16978790865e7 Author: Andre Erdmann mailerd de> AuthorDate: Wed May 30 18:03:44 2012 +0000 Commit: Andr=C3=A9 Erdmann mailerd de> CommitDate: Wed May 30 18:03:44 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/R_overlay.git= ;a=3Dcommit;h=3D4244739b test_ebuildcreation.sh: temporary script; tests run_ebuildcreation.py wit= h a high package number at once new file: test_ebuildcreation.sh --- test_ebuildcreation.sh | 56 ++++++++++++++++++++++++++++++++++++++++++= ++++++ 1 files changed, 56 insertions(+), 0 deletions(-) diff --git a/test_ebuildcreation.sh b/test_ebuildcreation.sh new file mode 100755 index 0000000..7f838e8 --- /dev/null +++ b/test_ebuildcreation.sh @@ -0,0 +1,56 @@ +#!/bin/bash +set -u +set -e +readonly ARGV=3D"$*" +readonly _SELF=3D"${0##*/}" +readonly _SELF_NAME=3D"${_SELF%.*sh}" +readonly TEST_SECTION=3D"${_SELF_NAME#test_}" +# +readonly py=3Dpython3 +# +_ROOT=3D`pwd` +if [[ ! -e "${_ROOT}/examples" ]]; then + _ROOT=3D"${_ROOT%/*}" +fi +readonly EXAMPLES=3D"${_ROOT}/examples" +readonly PKGDIR=3D"${EXAMPLES}/packages" + + +if [[ "${TEST_SECTION}" =3D=3D "ebuildcreation" ]]; then + if [[ "${1:-}" =3D=3D "-q" ]]; then + q=3D1 + shift ||: + else q=3D0; fi + + declare -i multiply=3D${1:-1} + [[ $multiply -gt 0 ]] || multiply=3D1 + pkgline=3D"" + pkgcount=3D0 + for x in "${PKGDIR}"/*.tar.gz "${PKGDIR}"/*.tgz; do + if [[ -r "$x" ]]; then + pkgline+=3D" ${x}" + ((pkgcount++)) ||: + fi + done + pkgline=3D"${pkgline# }" + + argline=3D"" + for i in `seq 1 $multiply`; do + argline+=3D" ${pkgline}" + done + + num=3D$(( $multiply * $pkgcount )) + echo "Please note: python may return 'Argument list too long'. Double c= heck your result if it's too fantastic to believe. (28500 pkgs could work= , but 30000 don't)." 1>&2 + echo "Creating $num packages" 1>&2 + time { + if [[ $q -eq 1 ]]; then + &>/dev/null $py "${_ROOT}/run_ebuildcreation.py" $argline || echo fai= l 1>&2 + else + $py "${_ROOT}/run_ebuildcreation.py" $argline + fi; + } + echo "Done creating $num packages" 1>&2 +else + echo "test section not defined: ${TEST_SECTION}" + exit ${__UNDEF__:-102} +fi